Source Code Change Instrumentation for Test Coverage
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing code coverage tools face inefficiencies in determining test coverage, particularly when dealing with changed code, as they often require instrumentation of the entire software product, leading to significant lag times during testing.
Innovation Solution
A method that identifies changes in source code using a source code history change-set, instruments only the object code associated with those changes, and generates a coverage report indicating the proportion of changed code covered by test cases, thereby excluding unchanged code to minimize performance impact.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If the entire software product is instrumented for code coverage analysis, then complete test coverage information is obtained, but significant lag times occur during testing
Solution Approach 1:
The patent segments the code coverage analysis by dividing the software product into changed code portions and unchanged code portions. Only the changed code portions are instrumented with coverage tracking, while unchanged portions are excluded from instrumentation. This segmentation allows complete coverage information for modified code without the performance penalty of instrumenting the entire product.
Solution Approach 2:
The patent extracts and isolates only the changed code portions from the entire software product for instrumentation. By taking out just the modified code sections and instrumenting only those, the system achieves accurate coverage measurement for changed code while avoiding the time loss associated with instrumenting and testing the complete product.
2Measurement precision
If code coverage tools instrument the entire software product, then comprehensive coverage data is collected, but performance deteriorates due to processing overhead
Solution Approach 1:
The patent applies segmentation by dividing the software product into changed and unchanged code portions. Coverage instrumentation is applied only to the changed portions, reducing the overall instrumentation overhead and improving performance while still collecting comprehensive coverage data for the modified code.
Solution Approach 2:
The patent implements partial action by instrumenting only the necessary changed code portions rather than the entire software product. This partial instrumentation approach provides sufficient coverage data for the modified code while minimizing the performance impact of the instrumentation overhead.
3Measurement precision
If all source code is included in coverage analysis, then complete testing verification is achieved, but the complexity of the coverage report increases
Solution Approach 1:
The patent extracts only the changed code portions from the complete source code for coverage analysis. By focusing solely on modified code, the system achieves complete testing verification for changes while producing simpler, more manageable coverage reports that exclude unrelated unchanged code.
Solution Approach 2:
The patent segments the coverage report to include only changed code portions separately from unchanged code. This segmentation simplifies the overall report structure by isolating the relevant coverage information for modified code, making it easier to analyze and interpret without the complexity of including all source code.
Data Source
AI summary
A computer-implemented method, computer program product, and system is provided for determining test coverage. In an implementation, a method may include identifying at least one change in source code. The method may also include instrumenting object code of at least one class file associated with a source file of the source code associated with the identified at least one change. The method may further include testing the instrumented object code with at least one test case. The method may further include generating a coverage report associated with the instrumented object code, wherein the coverage report includes a proportion of the at least one change in the source code covered by the at least one test case.


