Determining functional design/requirements coverage of a computer code
Abstract
A method that includes: running a set of functional tests over a computer code; determining, for each code element of the computer code, which functional test covered it, to yield a tests-elements coverage map; associating portions of the computer code with corresponding design portions or requirements derived from a design document or a requirements document respectively, associated with the computer code, to yield a design/requirements-code tracing map; deriving, from the tests-code coverage map and the design/requirements-code tracing map, a design/requirements-tests coverage map, exhibiting coverage of the computer code by the functional tests, in terms of the design or the requirements, wherein at least one of the running, the determining, the associating, and the deriving is executed by at least one processor.
Claims
exact text as granted — not AI-modified1 . A method comprising:
running a set of functional tests over a computer code; determining, for each code element of the computer code, which functional test covered it, to yield a tests-elements coverage map; associating portions of the computer code with corresponding design portions or requirements derived from a design document or a requirements document respectively, associated with the computer code, to yield a design/requirements-code tracing map; and deriving, from the tests-code coverage map and the design/requirements-code tracing map, a design/requirements-tests coverage map, exhibiting a coverage of the computer code by the functional tests, in terms of the design or the requirements, wherein at least one of the running, the determining, the associating, and the deriving is executed by at least one processor.
2 . The method according to claim 1 , further comprising applying a scoring function to the design/requirements-tests coverage map, to yield a design/requirements-coverage score for each design portion or requirement, representing a test coverage in design or requirement terms, for each one of the functional tests that has been run over the computer code.
3 . The method according to claim 1 , further comprising applying a scoring function to the design/requirements/tests coverage map, wherein the scoring function associates a specified weight for each one of the requirements or design portion in accordance with a respective importance index, to yield a design/requirement-coverage score for the set of functional tests representing the set's coverage in design or requirement terms, in view of the respective importance index of respective design/requirement.
4 . The method according to claim 1 , wherein the associating comprising:
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 portions by applying the search engine to each one of respective queries.
5 . The method according to claim 1 , wherein the computer code has been generated in order to meet the design or the requirements.
6 . The method according to claim 1 , wherein at least some of the elements are functions and at least some of the elements are classes.
7 . The method according to claim 1 , wherein the design document or the requirements document are provides in a natural language form.
8 . The method according to claim 1 , further comprising building a graph representing dependencies between the code elements, wherein the determining is further applied to each dependent code element being a code element that depends upon another code element, based on the graph, such that the tests-elements coverage map further relates to dependent code elements.
9 . A system comprising:
a testing component configured to:
run a set of functional tests over a computer code; and
determine, for each element of the computer code, which functional test covered it, to yield a tests-elements coverage map;
a tracing component configured to associate portions of the computer code with corresponding design portions or requirements of a design document or requirements document respectively, associated with the computer code, to yield a design/requirements-code tracing map; and an analysis component configured to derive, from the tests-code coverage map and the design/requirements-code tracing map, a design/requirements-tests coverage map, exhibiting coverage of the functional tests of the computer code, in terms of the design portions or the requirements.
10 . The system according to claim 9 , further comprising a scoring component configured to apply a scoring function to the design/requirements-tests coverage map, to yield a design/requirements-coverage score for each design portion or requirement, representing a test coverage in design or requirements terms, for each one of the functional tests that have been run over the computer code.
11 . The system according to claim 9 , further comprising a scoring component configured to apply a scoring function to the design/requirements-tests coverage map, wherein the scoring function associates a specified weight for each one of the design/requirements in accordance with a respective importance index, to yield a design/requirements-coverage score for the set of functional tests representing the set's coverage in design/requirements terms, based on the respective importance index of respective design/requirements.
12 . The system according to claim 9 , wherein the tracing component is further configured to:
segment the design or 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 design portions or requirements by applying the search engine to each one of respective queries.
13 . The system according to claim 9 , further comprising a builder component configured to build a graph representing dependencies between the elements,
wherein the determining of the testing component is further applied to each dependent element that depends upon an element of the computer code, based on the graph, such that the tests-elements coverage map further relates to dependent elements.
14 . 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 run a set of functional tests over a computer code; and computer readable program configured to determine, for each element of the computer code, which functional test covered it, to yield a tests-elements coverage map; computer readable program configured to associate portions of the computer code with corresponding design portions or requirements of a design document or a requirements document respectively, associated with the computer code, to yield a design/requirements-code tracing map; and computer readable program configured to derive, from the tests-code coverage map and the design/requirements-code tracing map, a design/requirements-tests coverage map, exhibiting coverage of the functional tests of the computer code, in terms of the design or the requirements.
15 . The computer program product according to claim 14 , further comprising a computer readable program configured to apply a scoring function to the design/requirements-tests coverage map, to yield a design/requirements-coverage score for each design portion or requirement, representing a test coverage in design or requirement terms, for each one of the functional tests that have been run over the computer code.
16 . The computer program product according to claim 14 , further comprising a computer readable program configured to apply a scoring function to the design/requirements-tests coverage map, wherein the scoring function associates a specified weight for each one of the design portions or the requirements in accordance with a respective importance index, to yield a design/requirements-coverage score for the set of functional tests representing the set's coverage in design or requirements terms, based on the respective importance index of respective design portion or requirement.
17 . The computer program product according to claim 14 , wherein the computer readable program configured to associate, is further configured to:
segment the design document or the requirements document into sections, each section having a single design portion or single requirement respectively; 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 design portions or requirements by applying the search engine to each one of respective queries.
18 . The computer program product according to claim 14 , further comprising a computer readable program configured to build a graph representing dependencies between the code elements,
wherein the determining of the testing component is further applied to each dependent code element that depends upon a code element of the computer code, in view of the graph, such that the tests-elements coverage map further relates to dependent code elements.
19 . The computer program product according to claim 14 , wherein the computer code has been generated in order to meet the design or the requirements.
20 . The computer program product according to claim 14 , wherein the design document or the requirements document are provided in a natural language form.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.