Source Code Change Instrumentation for Test Coverage

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvetest coverage informationVSAvoidtesting lag times
Core Design Contradiction:
Measurement precisionVSLoss of time

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #2Taking out (Extraction)

2Measurement precision

If code coverage tools instrument the entire software product, then comprehensive coverage data is collected, but performance deteriorates due to processing overhead

Engineering Contradiction:
Improvecoverage dataVSAvoidperformance
Core Design Contradiction:
Measurement precisionVSProductivity

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #16Partial or excessive action

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

Engineering Contradiction:
Improvetesting verificationVSAvoidcoverage report complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

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.

Inventive Principle:
Principle #2Taking out (Extraction)

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.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS9946634B2System and method for determining test coverage
Publication Date: 2018.04.17 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US9946634B2 patent drawing
  • US9946634B2 patent drawing
  • US9946634B2 patent drawing

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.