Complexity-Weighted Test Coverage Prioritization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional code coverage tools do not significantly enhance quality control and there is a need for more efficient test prioritization techniques to improve source code quality and reduce the risk of failures, especially in complex software applications where code coverage alone is not a reliable indicator of quality.

Innovation Solution

A system that prioritizes quality improvements by assigning test coverage levels to source code modules based on their complexity measures and desired quality levels, using a priori knowledge of relationships between code complexity, coverage, and quality to determine the necessary test coverage for each module, thereby guiding test case development and ensuring better code quality.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional code coverage tools are used to identify untested code, then code coverage can be measured, but quality control is not significantly enhanced

Engineering Contradiction:
Improvecode coverage measurementVSAvoidquality control effectiveness
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

The patent changes the parameter from simple code coverage measurement to complexity-weighted test prioritization. By incorporating code complexity metrics (such as cyclomatic complexity, number of parameters, statement count) as weighting factors, the system transforms the单一 coverage measurement into a multi-dimensional quality assessment that identifies which untested code segments pose the greatest risk and should be prioritized for testing.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If test cases are developed for all code sections to ensure quality, then code quality improves, but testing costs and time increase

Engineering Contradiction:
Improvecode qualityVSAvoidtesting efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies local quality by differentiating test coverage requirements across different code segments based on their complexity characteristics. High-complexity code sections (with more statements, parameters, or cyclomatic complexity) are assigned higher test coverage targets, while low-complexity sections receive lower priorities. This localized approach ensures quality focus on critical areas without uniformly testing all code, thereby improving testing efficiency.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system performs preliminary analysis of code complexity metrics before test case development. By pre-calculating complexity weights for each code segment and identifying high-risk areas in advance, the system guides test case prioritization and development efforts toward the most critical sections first, reducing overall testing time and costs while maintaining quality.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If higher test coverage is assigned to complex code modules, then quality of complex sections improves, but testing resources are consumed disproportionately

Engineering Contradiction:
Improvequality of complex code segmentsVSAvoidtesting resources
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent introduces complexity-based weighting parameters (such as cyclomatic complexity, number of parameters, statement count) to transform uniform resource allocation into proportional resource distribution. These parameters enable the system to calculate risk scores for different code segments and allocate testing resources accordingly, ensuring that complex high-risk modules receive appropriate attention without excessive resource consumption.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS8627287B2Prioritizing quality improvements to source code
Publication Date: 2014.01.07 MICROSOFT TECHNOLOGY LICENSING LLC
  • US8627287B2 patent drawing
  • US8627287B2 patent drawing
  • US8627287B2 patent drawing

AI summary

An exemplary method includes receiving source code having a plurality of code segments, providing a desired level of quality for the source code, analyzing the source code to assign a complexity measure to each of the plurality of code segments and assigning a level of code coverage to each of the plurality of code segments based at least in part on the desired level of quality and the complexity measures. An exemplary system prioritizes quality improvements to source code based, in part, on a quality assessment. Such a system can improve code quality by assigning higher test coverage levels to modules with higher complexity.