English

Boosting Redundancy-based Automated Program Repair by Fine-grained Pattern Mining

Software Engineering 2025-08-27 v3

Abstract

Redundancy-based automated program repair (APR), which generates patches by referencing existing source code, has gained much attention since they are effective in repairing real-world bugs with good interpretability. However, since existing approaches either demand the existence of multi-line similar code or randomly reference existing code, they can only repair a small number of bugs with many incorrect patches, hindering their wide application in practice. In this work, we aim to improve the effectiveness of redundancy-based APRs by exploring more effective source code reuse methods for improving the number of correct patches and reducing incorrect patches. Specifically, we have proposed a new repair technique named Repatt, which incorporates a two-level pattern mining process for guiding effective patch generation (i.e., token and expression levels). We have conducted an extensive experiment on the widely-used Defects4J benchmark and compared Repatt with ten state-of-the-art APR approaches. The results show that it complements existing approaches by repairing 9 unique bugs compared with the latest Large Language Model (LLM)-based and deep learning-based methods and 19 unique bugs compared with traditional repair methods when providing the perfect fault localization. In addition, when the perfect fault localization is unknown in real practice, Repatt significantly outperforms the baseline approaches by achieving much higher patch precision, i.e., 83.8\%, although it repairs fewer bugs. Moreover, we further proposed an effective patch ranking strategy for combining the strength of Repatt and the baseline methods. The result shows that it repairs 124 bugs when only considering the Top-1 patches and improves the best-performing repair method by repairing 39 more bugs. The results demonstrate the effectiveness of our approach for practical use.

Keywords

Cite

@article{arxiv.2312.15955,
  title  = {Boosting Redundancy-based Automated Program Repair by Fine-grained Pattern Mining},
  author = {Jiajun Jiang and Fengjie Li and Zijie Zhao and Zhirui Ye and Mengjiao Liu and Bo Wang and Hongyu Zhang and Junjie Chen},
  journal= {arXiv preprint arXiv:2312.15955},
  year   = {2025}
}

Comments

This paper has been accepted by ICSME 2025

R2 v1 2026-06-28T14:01:55.719Z