Introduction
Automated Program Repair (APR) aims to automatically fix software bugs, significantly reducing developer workload. However, the dominant "Generate-and-Validate" paradigm is notoriously computationally expensive. APR tools typically generate thousands of candidate patches, each requiring validation against a test suite to ensure the bug is fixed without introducing regressions. This validation phase is the primary bottleneck in modern repair pipelines.
The State of RTS in APR Research
Despite the maturity of Regression Test Selection (RTS) in general software engineering—a technique that identifies and executes only the tests affected by a specific code change—it remains largely ignored in the APR community. A systematic review of 62 existing APR systems reveals a striking trend: the vast majority of tools validate every patch against the entire test suite, regardless of the patch's scope.
As shown in the table above, while a few systems like SketchFix and PraPR have integrated statement-level RTS, most state-of-the-art tools developed in the last decade do not utilize this optimization. The authors found that 16 out of 17 major APR systems proposed in the last three years don't use RTS at all, highlighting a significant research gap.
Methodology
To quantify the impact of RTS, the researchers conducted a large-scale empirical study:
- Implementation: Dynamic RTS was integrated into 12 state-of-the-art APR systems, supporting three granularities: class-level, method-level, and statement-level.
- Evaluation: The study utilized the Defects4J benchmark (395 real-world Java bugs), generating and analyzing over 2.5 million patches.
- Scenarios: The team evaluated RTS under both "partial validation" (stopping at the first failure) and "full validation" (running all tests) scenarios, as well as its synergy with Regression Test Prioritization (RTP).
Key Insights
Rethinking Efficiency Metrics
The study highlights that the common metric of "patches per minute" is fundamentally flawed. Because different patches have vastly different validation costs, the number of test executions provides a much more stable and accurate measure of repair efficiency.
The Power of Granularity
Granularity is a critical factor in RTS effectiveness. While class-level RTS offers some benefits, it is often too coarse, selecting many irrelevant tests. In contrast, method-level and statement-level RTS provide significantly higher speedups. For "plausible" patches—those that pass the originally failing tests—RTS can reduce the test load by up to 99.95%.
Selection vs. Prioritization
In the context of APR, selecting which tests to run (Selection) is far more impactful than determining the order in which to run them (Prioritization). Interestingly, the study found that traditional regression testing prioritization techniques actually outperform APR-specific prioritization when combined with RTS.
Results and Impact
The empirical results are compelling. In full validation scenarios, statement-level RTS reduced test executions by over 95% for several systems. Even when the "early-exit" optimization was already in place, statement-level RTS still provided an average reduction of 43.5% in test executions across all 12 studied systems.
Furthermore, the authors demonstrated that inconsistent RTS configurations can lead to skewed research conclusions. When comparing two APR tools, the lack of standardized RTS can make a fundamentally slower tool appear faster simply due to validation inefficiencies.
Conclusion
This study provides the first systematic evidence that RTS is a highly effective, yet underutilized, optimization for Automated Program Repair. By slashing test execution counts by over 90% in many cases, RTS can transform the feasibility of large-scale repair tasks. Future work should focus on extending these findings to other languages and exploring how RTS can optimize the high validation costs associated with emerging Large Language Model (LLM) based repair techniques.
Summary updated