Repair-R1: Better Test Before Repair
Haichuan Hu, Xiaochen Xie, Quanjun Zhang

TL;DR
Repair-R1 introduces a novel training paradigm for automated program repair by generating discriminative test cases before repair, leading to significant improvements in success rates and test coverage across multiple benchmarks.
Contribution
It proposes a new training approach that incorporates test case generation prior to repair, enhancing defect localization and repair effectiveness in APR models.
Findings
Repair-R1 improves repair success rate by up to 48.29%.
Test generation success rate increases by up to 53.28%.
Test coverage is enhanced by up to 53.96%.
Abstract
APR (Automated Program Repair) aims to automatically locate program defects, generate patches and validate the repairs. Existing techniques for APR are often combined with LLMs (Large Language Models), which leverages the code-related knowledge of LLMs to improve repair effectiveness. Current LLM-based APR methods typically utilize test cases only during the inference stage, adopting an iterative approach that performs repair first and validates it through test execution afterward. This conventional paradigm neglects two important aspects: the potential contribution of test cases in the training phase, and the possibility of leveraging testing prior to repair. To address this, we propose Repair-R1, which introduces test cases into the model's training phase and shifts test generation to precede repair. The model is required to first generate discriminative test cases that can…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
