Hash-Based Test Selection for Code Change Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current testing techniques are inefficient and laborious, particularly in distributed environments, as they often require running all tests after code changes, which is unnecessary and resource-intensive, and lack a learning mechanism to detect changes effectively at the class and method levels.

Innovation Solution

Creating unique identifiers for code structures using hash algorithms like MD5, tracking test execution information, and comparing these identifiers before and after code modifications to determine the necessary subset of tests to run, thereby enabling incremental and consistent analysis of performance issues.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If all tests are run after code changes, then reliability of validation is improved, but productivity and resource utilization deteriorate

Engineering Contradiction:
Improvevalidation reliabilityVSAvoidtesting productivity
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the complete test suite into individual test cases and associates each with specific code structures through hash digests. When code changes occur, only the segmented tests related to changed structures are executed, rather than running the entire test suite. This segmentation enables selective test execution that maintains validation reliability while improving productivity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements partial action by executing only the necessary subset of tests rather than the complete test suite. By comparing hash digests of code structures before and after changes, the system identifies and runs only those tests that need to be re-executed, performing partial testing action that suffices for validation while reducing overall test execution time and resource consumption.

Inventive Principle:
Principle #16Partial or excessive action

2Productivity

If hash digests are created for all code structures and tests are selectively executed, then productivity is improved, but device complexity increases

Engineering Contradiction:
Improvetesting productivityVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent creates hash digest copies of code structure identifiers that can be quickly compared without analyzing the actual code. These digest copies serve as lightweight representations that enable rapid change detection. The copying mechanism simplifies the complexity management by working with compact hash values rather than complex code structure comparisons.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent introduces hash digests as intermediary elements between code structures and test execution decisions. Rather than directly analyzing code changes, the system uses hash digests as mediators to detect changes and trigger appropriate test execution. This intermediary layer manages system complexity by providing a simple comparison mechanism.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If code coverage tools are used to track changes, then measurement precision is improved, but ease of operation deteriorates due to manual intervention requirements

Engineering Contradiction:
Improvechange detection precisionVSAvoidtesting ease of operation
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The patent implements self-service by automatically generating hash digests, comparing them to detect changes, and selecting tests for execution without manual intervention. The system serves itself by autonomously identifying changed code structures and determining which tests need re-execution, eliminating the need for manual code coverage analysis while maintaining precise change detection.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces manual mechanical processes of code coverage analysis with an automated computational system based on hash digest comparison. Instead of manually tracking code changes through coverage tools, the system uses automated hashing and comparison algorithms to detect changes precisely without human intervention, substituting mechanical manual operations with automated computational processes.

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

Data Source

PatentUS9032369B2Systems and/or methods for executing appropriate tests based on code modifications using live, distributed, real-time cache and feedback loop
Publication Date: 2015.05.12 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US9032369B2 patent drawing
  • US9032369B2 patent drawing
  • US9032369B2 patent drawing

AI summary

Certain example embodiments relate to systems and/or methods for determining and/or executing an appropriate subset of tests in response to a code change. In certain example embodiments, hash digests or other unique values for code structures (such as, for example, classes, methods, and/or other structural elements) may be created. Tests associated those associated code structures may be identified. New hash digests or other unique values may be generated for the code structures after the source code has been modified. In response to a mismatch as between the existing and new hash digests or other unique values, a list of associated tests for possible subsequent execution may be retrieved. Certain example embodiments additionally or alternatively provide an incremental but consistent way of analyzing performance issues, e.g., in connection with a profiler.