Static Dependency Analysis for Targeted Test Selection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Developers face inefficiencies in software testing, particularly when changes are made to existing code, as running all tests can be inconvenient and time-consuming, and existing techniques that use dynamic data can slow down the feedback loop and require significant resources.

Innovation Solution

The method identifies impacted tests using statically collected data by performing static dependency analysis, traversing transitive closure of outward dependency links, and optionally using heuristics and dynamic data to determine which tests are relevant, thereby selecting a subset of tests to run efficiently.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If all tests are run with every code change, then testing completeness is improved, but testing time and resource consumption increase significantly

Engineering Contradiction:
Improvetesting completenessVSAvoidtesting time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent segments the complete test suite into smaller subsets based on code change analysis. By dividing tests into groups associated with specific code elements, only relevant segments are executed when changes occur, rather than running the entire test suite. This segmentation enables selective testing that maintains completeness for affected areas while reducing overall execution time.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by executing only the necessary subset of tests rather than the complete test suite. The system determines the minimal required test coverage based on code change impact analysis, running only those tests that are actually affected by the changes. This partial execution approach maintains sufficient testing quality while significantly reducing time and resource consumption.

Inventive Principle:
Principle #16Partial or excessive action

2Loss of time

If a subset of tests is selected based on developer understanding, then testing time is reduced, but testing accuracy and reliability deteriorate

Engineering Contradiction:
Improvetesting timeVSAvoidtesting accuracy
Core Design Contradiction:
Loss of timeVSReliability

Solution Approach 1:

The patent implements automated feedback mechanisms that analyze code changes and provide information about which tests are affected. The system continuously monitors code modifications, traces dependencies, and automatically determines the appropriate test subset. This automated feedback loop replaces subjective developer judgment with objective analysis, ensuring that the selected test subset accurately reflects the actual impact of changes while maintaining reduced execution time.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent changes the parameter of test selection from manual developer judgment to automated dependency analysis. By transforming the selection criterion from subjective understanding to objective code traceability metrics, the system dynamically adjusts which tests to run based on actual code relationships. This parameter change ensures both time efficiency and testing accuracy through data-driven test selection.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If dynamic data from prior test runs is used to identify relevant tests, then test selection accuracy is improved, but test run speed decreases due to instrumentation overhead

Engineering Contradiction:
Improvetest selection accuracyVSAvoidtest run speed
Core Design Contradiction:
ReliabilityVSSpeed

Solution Approach 1:

The patent performs preliminary static dependency analysis during code compilation or build time, before actual test execution. By pre-computing code element relationships and test associations in advance, the system creates a dependency map that can be quickly queried during testing. This preliminary action eliminates the need for runtime instrumentation, maintaining both high test selection accuracy and fast test execution speed.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent substitutes dynamic runtime instrumentation with static analysis mechanisms. Instead of using probes, sensors, or runtime data collection that slow down test execution, the system uses compile-time or build-time static analysis to determine test dependencies. This mechanical substitution replaces the slow dynamic approach with a faster static analysis approach that achieves the same test selection accuracy without the performance overhead.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

4Productivity

If static dependency analysis is performed to identify impacted tests, then test selection efficiency is improved, but system complexity increases

Engineering Contradiction:
Improvetest selection efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary dependency analysis layer between code changes and test execution. This intermediary component automatically traces code dependencies and maps changes to affected tests, shielding developers from the complexity of the analysis process. The intermediary handles the complex static analysis operations internally while presenting a simple interface that shows only the relevant test subset, thereby improving efficiency without exposing system complexity to users.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP2994835B1Identifying impacted tests from statically collected data
Publication Date: 2020.11.18 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP2994835B1 patent drawingFigure 1
  • EP2994835B1 patent drawingFigure 2
  • EP2994835B1 patent drawingFigure 3

AI summary

The present invention extends to methods, systems, and computer program products for identifying impacted tests from statically collected data. In general, static dependency data, possibly augmented with some dynamic data, is used to find an appropriate set of impacted tests for code changes. In some embodiments, static dependency analysis is used to identify tests impacted by a code change. Heuristics can be used to assist with identifying an appropriate set of impacted tests to run for a code change. Dynamic data can be used to augment static dependency data to identify more optimal sets of impacted tests to run for a code change.