Dynamic Test-Case Prioritization After Source-Code Changes
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional automated regression testing is time-consuming and inefficient, particularly for large and complex projects, leading to prolonged testing cycles that delay software releases and expose systems to security vulnerabilities without adequate protection.
Innovation Solution
A method to dynamically prioritize a subset of test cases by updating source code segments with predetermined code pieces that output information about associated test cases, allowing for early identification of defects and focusing testing on affected pipelines.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If all test cases are run in conventional automated regression testing, then comprehensive defect detection is achieved, but testing time is excessively long
Solution Approach 1:
The patent segments the complete test case suite into multiple subsets based on code change analysis. By dividing all test cases into a prioritized subset (first to be run) and a remaining subset (second to be run), the system can stop early if defects are found in the prioritized subset, thereby reducing overall testing time while maintaining comprehensive defect detection capability.
Solution Approach 2:
The patent performs preliminary analysis of code changes and test case associations before executing tests. By pre-processing the source code to identify changed segments and pre-processing test cases to determine their association with changed code, the system establishes a prioritized test execution order in advance, enabling faster defect detection without compromising thoroughness.
2Reliability
If comprehensive test cases are executed to ensure quality assurance, then software quality is maintained, but release timing is delayed
Solution Approach 1:
The patent introduces dynamic test case prioritization based on actual code changes. Instead of using a static, fixed test execution order, the system dynamically determines which test cases to run first by analyzing the relationship between code changes and test case associations. This dynamic approach allows the testing process to adapt to specific change scenarios, maintaining quality assurance while accelerating release timing.
Solution Approach 2:
The system performs preliminary code change analysis and test case mapping before execution. By pre-identifying which test cases are most likely to fail based on code change segments, the system can focus testing efforts on critical areas first, ensuring quality assurance is maintained while reducing overall testing duration and accelerating release speed.
3Reliability
If full regression testing is performed on all code changes, then system security is protected, but testing efficiency is reduced
Solution Approach 1:
The patent segments test cases into prioritized and remaining subsets based on their association with code change segments. This segmentation allows the system to focus security-critical testing on test cases most likely to reveal security issues related to the changes, while deferring or skipping less critical tests, thereby maintaining system security protection while improving testing efficiency.
Solution Approach 2:
The system performs preliminary analysis to identify test cases that are most relevant to security concerns based on code change patterns. By pre-processing code to identify security-sensitive segments and mapping them to associated test cases, the system can prioritize security-critical testing without performing unnecessary full regression testing, thus protecting system security while enhancing testing efficiency.
Data Source
AI summary
A computer-implemented method according to one embodiment includes updating code segments of source code to include predetermined code pieces. The updated code segments are configured to output information about associated test cases upon the test cases being run. The method further includes running the test cases, and subsequent to a change being made to the source code, determining a prioritized subset of the test cases. The prioritized subset of the test cases is run. A computer program product according to another embodiment includes a computer readable storage medium having program instructions embodied therewith. The program instructions are readable and/or executable by a computer to cause the computer to perform the foregoing method.


