Self-Boosted Automated Program Repair

Samuel Benton, Mengshi Zhang, Xia Li, Lingming ZhangarXiv 2021

Abstract

Automated Program Repair (APR) tools often generate thousands of candidate patches, creating a significant validation bottleneck as each must be tested against a full suite. SeAPR (Self-Boosted Automated Program Repair) is a novel technique that optimizes this process by learning from its own execution results in real-time. By analyzing the success or failure of early patch attempts, SeAPR dynamically re-prioritizes remaining candidates, reducing the number of expensive test executions by up to 78% with near-zero computational overhead.

Introduction

The primary challenge in modern APR is not just generating potential fixes, but efficiently validating them. Current tools typically employ "static" prioritization, ranking patches once at the start based on fault localization and then executing them sequentially. This approach ignores valuable data generated during the validation process itself. If a patch modifying a specific method fails, other patches making similar changes are likely to fail as well. SeAPR addresses this by introducing on-the-fly learning to the repair pipeline, treating patch validation as a data source rather than just a hurdle.

Methodology

SeAPR treats patch prioritization as an evolving process that adapts as data is collected from test executions. The core logic involves three main steps:

Patch Quality Estimation and Similarity Mapping

As patches are tested, they are categorized based on their performance. A "high-quality" patch is defined as one that passes at least one previously failing test case, indicating progress toward a fix. Conversely, a "low-quality" patch fails to pass any originally failing tests. SeAPR tracks which program elements (at the package, class, method, or statement level) each patch modifies to determine the similarity between unvalidated patches and those already tested.

Similarity mapping of patches to modified code elements

Dynamic Re-ranking

Borrowing from Spectrum-Based Fault Localization (SBFL), SeAPR adapts formulas like Ochiai to score patches. If a candidate patch is similar to many "high-quality" failed attempts, its priority increases. If it resembles "low-quality" failures, its priority decreases. This allows the algorithm to update the priority of thousands of patches simultaneously.

Dynamic scoring and re-ranking of patches based on execution feedback

The authors also proposed SeAPR++, which incorporates repair patterns (e.g., changing operators) into the similarity metric, and Cross-Tool Boosting, which allows one APR tool to benefit from the failure data of another.

Experimental Evaluation

The researchers evaluated SeAPR using the Defects4J (v1.2.0) benchmark, which includes 395 real-world Java bugs. The technique was tested across 12 state-of-the-art APR tools, including Arja, TBar, and SimFix, to ensure broad applicability.

Key Results

  • Efficiency Gains: SeAPR significantly reduced the number of patch executions required. For the tool GenProg-A, it achieved a 78.81% reduction in executions to find a plausible fix, and a 72.96% reduction for Arja to find a correct fix.
  • Universal Applicability: Performance improved across nearly all 12 tools studied.
  • Minimal Overhead: The prioritization logic is highly efficient, adding less than 0.5 seconds to the total repair process per project.
  • Robustness: While various SBFL formulas were effective, the SBI formula showed a slight performance edge in the study's variants.

Discussion and Limitations

The success of SeAPR stems from the realization that every failed test run provides a "behavioral signature" that can predict the success of similar patches. However, the technique has limitations. It is less effective for tools that generate very few patches (e.g., Cardumen), as there is insufficient data for meaningful learning. Future work may explore more nuanced quality metrics, such as regression testing (how many new tests a patch breaks), and extending the approach to other programming languages like C++ or Python.

Conclusion

SeAPR demonstrates that real-time feedback during the validation phase can drastically improve the efficiency of automated program repair. By turning "failed" attempts into actionable intelligence, it paves the way for faster, more scalable software maintenance tools.

Summary updated

BibTeX
@misc{benton2021self,
  author = {Samuel Benton and Mengshi Zhang and Xia Li and Lingming Zhang},
  title = {{Self-Boosted Automated Program Repair}},
  year = {2021},
  eprint = {2104.04611},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.04611},
}
Figure