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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Jiang, Jiajun, Li, Fengjie, Zhao, Zijie, Ye, Zhirui, Liu, Mengjiao, Wang, Bo, Zhang, Hongyu, Chen, Junjie
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912553584558080
author Jiang, Jiajun
Li, Fengjie
Zhao, Zijie
Ye, Zhirui
Liu, Mengjiao
Wang, Bo
Zhang, Hongyu
Chen, Junjie
author_facet Jiang, Jiajun
Li, Fengjie
Zhao, Zijie
Ye, Zhirui
Liu, Mengjiao
Wang, Bo
Zhang, Hongyu
Chen, Junjie
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2312_15955
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Boosting Redundancy-based Automated Program Repair by Fine-grained Pattern Mining
Jiang, Jiajun
Li, Fengjie
Zhao, Zijie
Ye, Zhirui
Liu, Mengjiao
Wang, Bo
Zhang, Hongyu
Chen, Junjie
Software Engineering
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.
title Boosting Redundancy-based Automated Program Repair by Fine-grained Pattern Mining
topic Software Engineering
url https://arxiv.org/abs/2312.15955