Confix: Combining node-level fix templates and masked language model for automatic program repair

被引:0
|
作者
Xiao, Jianmao [1 ]
Xu, Zhipeng [2 ]
Chen, Shiping [3 ]
Lei, Gang [1 ]
Fan, Guodong [4 ]
Cao, Yuanlong [5 ]
Deng, Shuiguang [6 ]
Feng, Zhiyong [4 ]
机构
[1] Jiangxi Normal Univ, Sch Software, Nanchang, Peoples R China
[2] Jiangxi Normal Univ, Sch Digital Ind, Shangrao, Peoples R China
[3] CSIRO Data61, Sydney, NSW, Australia
[4] Tianjin Univ, Coll Intelligence & Comp, Tianjin, Peoples R China
[5] Jiangxi Normal Univ, Sch Comp & Informat Engn, Nanchang, Peoples R China
[6] Zhejiang Univ, Coll Comp Sci & Technol, Zhejiang, Peoples R China
基金
中国国家自然科学基金;
关键词
Automatic program repair; Fix templates; Masked language model;
D O I
10.1016/j.jss.2024.112116
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Automatic program repair (APR) is a promising technique to fix program defects by generating patches. In the current APR techniques, template-based and learning-based techniques have demonstrated different advantages. Template-based APR techniques rely on pre-defined fix templates, providing higher controllability but limited by the variety of templates and edit expressiveness. In contrast, learning-based APR techniques treat repair as a neural machine translation task, improving the edit expressiveness through training neural networks. However, this technique also faces the influence of quality and variety of training data, leading to numerous errors and redundant code generation. To overcome their limitations, this paper proposes an innovative APR technique called Confix. Confix first constructs a code information tree to assist in mining edit changes during historical repair. It then further enriches the types of fix templates using node information in the tree. Afterward, Confix defines masked lines based on node-level fix templates to control the scope of patch generation, avoiding redundant semantic code generation. Finally, Confix leverages the powerful edit expressiveness of the masked language model and combines it with fix strategies to generate correct patches more efficiently and accurately. Experimental results show that Confix exhibits state-of-the-art performance on the Defects4J 1.2 and QuixBugs benchmarks.
引用
收藏
页数:15
相关论文
empty
未找到相关数据