US2011271253A1PendingUtilityA1

Enhancing functional tests coverage using traceability and static analysis

44
Assignee: IBMPriority: Apr 28, 2010Filed: Apr 28, 2010Published: Nov 3, 2011
Est. expiryApr 28, 2030(~3.8 yrs left)· nominal 20-yr term from priority
G06F 11/3676G06F 8/20G06F 8/75G06F 8/10G06F 8/73
44
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

A method that may include: building a dependencies graph representing dependencies between code elements of a computer code; associating portions of the computer code with corresponding design specifications or requirements derived from a design specifications document or a requirements document respectively which is associated with the computer code, to yield a design specifications or requirements-code tracing map; and analyzing the design specifications or requirements-code tracing map based on the dependencies graph to yield an ordered list of design specifications or requirements respectively, wherein the order is selected such that functional tests written for the computer code and addressing design specifications or requirements of a higher order, will yield a higher level of functional test coverage of the computer code in terms of design specifications or requirements.

Claims

exact text as granted — not AI-modified
1 . A method comprising:
 building a dependencies graph representing dependencies between code elements of a computer code;   associating portions of the computer code with corresponding design specifications or requirements derived from a design document or a requirements document respectively which is associated with the computer code, to yield a design specifications or requirements-code tracing map; and   analyzing the design specifications or requirements-code tracing map based at least partially on the dependencies graph to yield an ordered list of design specifications or requirements respectively, wherein the order is selected such that functional tests written for the computer code and addressing design specifications or requirements of a higher order, will yield a higher level of functional test coverage of the computer code in terms of design specifications or requirements,   wherein at least one of the building, the associating, and the analyzing is executed by at least one processor.   
     
     
         2 . The method according to  claim 1 , further comprising generating functional tests based on the design specifications or requirements in the ordered list and their respective order. 
     
     
         3 . The method according to  claim 1 , wherein the associating comprises:
 segmenting the design or the requirements document into sections, each section having a single design portion or a single requirement;   indexing the sections into a search engine;   creating a query according to words obtained from the code, wherein the words are ranked according to their respective semantic meaning, for each segment of the computer code; and   retrieving respective requirements or design specifications by applying the search engine to each one of respective queries.   
     
     
         4 . The method according to  claim 1 , further comprising:
 running a set of functional tests over the computer code;   determining, based on the graph, for each code element and code element that depends on it, which functional test covered it, to yield a tests-elements coverage map,   wherein in the analyzing, the tests-elements coverage map is further used to yield the ordered list.   
     
     
         5 . The method according to  claim 4 , further comprising applying a scoring function to the design specifications or requirements-code tracing map and the tests-elements coverage map, to yield a design specifications or requirements-coverage score for each design portion or requirement, representing a level of code coverage by the functional tests, in design or requirement terms, wherein design or requirements presenting lower design specifications or requirements-coverage score are assigned with a higher order in the ordered list. 
     
     
         6 . The method according to  claim 5 , wherein design specifications or requirements presenting substantially a common score are reordered in the ordered list according to a number of code elements and dependent code elements each design/requirement are addressing in their corresponding functional tests. 
     
     
         7 . The method according to  claim 5 , further comprising generating functional tests based on the order of the ordered list of design specifications or requirements. 
     
     
         8 . A system comprising:
 a builder component configured to build a dependencies graph representing dependencies between code elements of a computer code;   an association component configured to associate portions of the computer code with corresponding design specifications or requirements derived from a design document or a requirements document respectively which is associated with the computer code, to yield a design specifications or requirements-code tracing map; and   an analyzing component configured to analyze the design specifications or requirements-code tracing map based at least partially on the dependencies graph to yield an ordered list of design specifications or requirements respectively, wherein the order is selected such that functional tests written for the computer code and addressing design specifications or requirements of a higher order, will yield a higher level of functional test coverage of the computer code in terms of design specifications or requirements,   wherein at least one of the components is executed by at least one processor.   
     
     
         9 . The system according to  claim 8 , further comprising a test generating component configured to generate functional tests based on the design specifications or requirements in the ordered list and their respective order. 
     
     
         10 . The system according to  claim 8 , wherein the associating components is further configured to:
 segment the design or the requirements document into sections, each section having a single design portion or a single requirement;   index the sections into a search engine;   create a query according to words obtained from the code, wherein the words are ranked according to their respective semantic meaning, for each segment of the computer code; and   retrieve respective requirements or design specifications by applying the search engine to each one of respective queries.   
     
     
         11 . The system according to  claim 8 , further comprising:
 A testing component configured to run a set of functional tests over the computer code and determine, based on the graph, for each code element and code element that depends on it, which functional test covered it, to yield a tests-elements coverage map,   wherein the analyzing component is further configured to use the tests-elements coverage map to yield the ordered list.   
     
     
         12 . The system according to  claim 11 , further comprising a scoring component configured to apply a scoring function to the design specifications or requirements-code tracing map and the tests-elements coverage map, to yield a design specifications or requirements-coverage score for each design portion or requirement, representing a level of code coverage by the functional tests, in design or requirement terms, wherein design or requirements presenting lower design specifications or requirements-coverage score are assigned with a higher order in the ordered list. 
     
     
         13 . The system according to  claim 12 , wherein design specifications or requirements presenting substantially a common score are reordered in the ordered list according to a number of code elements and dependent code elements each design/requirement are addressing in their corresponding functional tests. 
     
     
         14 . The system according to  claim 13 , further comprising a test generating component configured to generate functional tests based on the design specifications or requirements in the ordered list and their respective order. 
     
     
         15 . A computer program product, the computer program product comprising:
 a computer readable storage medium having computer readable program embodied therewith, the computer readable program comprising:   computer readable program configured to build a dependencies graph representing dependencies between code elements of a computer code;   computer readable program configured to associate portions of the computer code with corresponding design specifications or requirements derived from a design document or a requirements document respectively which is associated with the computer code, to yield a design specifications or requirements-code tracing map; and   computer readable program configured to analyze the design specifications or requirements-code tracing map based at least partially on the dependencies graph to yield an ordered list of design specifications or requirements respectively, wherein the order is selected such that functional tests written for the computer code and addressing design specifications or requirements of a higher order, will yield a higher level of functional test coverage of the computer code in terms of design specifications or requirements.   
     
     
         16 . The computer program product according to  claim 15 , further comprising computer readable program configured to generate functional tests based on the design specifications or requirements in the ordered list and their respective order. 
     
     
         17 . The computer program product according to  claim 15 , wherein the computer readable program configure to associate, is further configured to:
 segment the design or the requirements document into sections, each section having a single design portion or a single requirement;   index the sections into a search engine;   create a query according to words obtained from the code, wherein the words are ranked according to their respective semantic meaning, for each segment of the computer code; and   retrieve respective requirements or design specifications by applying the search engine to each one of respective queries.   
     
     
         18 . The computer program product according to  claim 15 , further comprising:
 computer readable program configured to run a set of functional tests over the computer code and determine, based on the graph, for each code element and code element that depends on it, which functional test covered it, to yield a tests-elements coverage map,   wherein the computer readable program configured to analyze is further configured to use the tests-elements coverage map to yield the ordered list.   
     
     
         19 . The computer program product according to  claim 18 , further comprising computer readable program configured to apply a scoring function to the design specifications or requirements-code tracing map and the tests-elements coverage map, to yield a design specifications or requirements-coverage score for each design portion or requirement, representing a level of code coverage by the functional tests, in design or requirement terms, wherein design specifications or requirements presenting lower design specifications or requirements-coverage score are assigned with a higher order in the ordered list. 
     
     
         20 . The computer program product according to  claim 19 , wherein design specifications or requirements presenting substantially a common score are reordered in the ordered list according to a number of code elements and dependent code elements each design specification/requirement are addressing in their corresponding functional tests. 
     
     
         21 . The computer program product according to  claim 20 , further comprising computer readable program configured to generate functional tests based on the design specifications or requirements in the ordered list and their respective order.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.