paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Template-based Neural Program Repair

基于模板的神经程序修复
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 2/10 · 该论文属于模板与神经机器翻译结合的自动程序修复,并非用户关注的静态分析、LLM/Agent 改进程序分析、浮点程序分析或贝叶斯程序分析方向;虽同属 AI+PL 交叉,但方法基于 NMT 且未涉及 Agent/LLM 或形式化验证。引用 27 inbox
Xiangxin Meng, Xu Wang, Hongyu Zhang, Hailong Sun, Xudong Liu, Chunming Hu
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出融合模板与NMT的神经程序修复方法TENURE,用编码器-解码器生成补丁中间表示,在Defects4J上达到最优。

模板式与基于NMT的自动程序修复各有局限:前者受限于模板类型且仅用语法指导补丁合成,后者生成范围小且存在未登录词(OOV)问题。本文提出融合两者的模板式神经修复方法TENURE:为35种修复模板及单行代码生成模板构建大规模数据集,采用编码器-解码器模型学习深层语义特征以生成补丁中间表示(IR),并用优化的拷贝机制缓解OOV;最后开发工具从IR恢复补丁、替换未知词元并过滤错误候选。在Defects4J-v1.2和v2.0上,TENURE分别修复79/52和50/32个缺陷,优于现有方法。

问题
模板式方法无法修复超出模板类型且仅用语法信息指导补丁合成,NMT式方法生成范围小并面临未登录词(OOV)问题。
方法
TENURE为35种修复模板及单行代码生成模板构建大规模数据集,采用编码器-解码器模型学习深层语义特征生成补丁中间表示(IR),用优化的拷贝机制缓解OOV,并开发工具从IR恢复真实补丁、替换未知词元并过滤编译错误候选。
评估
在Defects4J-v1.2上,TENURE在完美与Ochiai故障定位下分别修复79和52个缺陷;在Defects4J-v2.0上分别修复50和32个缺陷,优于现有模板式与NMT式方法。
原文摘要(Abstract)

In recent years, template-based and NMT-based automated program repair methods have been widely studied and achieved promising results. However, there are still disadvantages in both methods. The template-based methods cannot fix the bugs whose types are beyond the capabilities of the templates and only use the syntax information to guide the patch synthesis, while the NMT-based methods intend to generate the small range of fixed code for better performance and may suffer from the OOV (Out-of-vocabulary) problem. To solve these problems, we propose a novel template-based neural program repair approach called TENURE to combine the template-based and NMT- based methods. First, we build two large-scale datasets for 35 fix templates from template-based method and one special fix template (single-line code generation) from NMT-based method, respectively. Second, the encoder-decoder models are adopted to learn deep semantic features for generating patch intermediate representations (IRs) for different templates. The optimized copy mechanism is also used to alleviate the OOV problem. Third, based on the combined patch IRs for different templates, three tools are developed to recover real patches from the patch IRs, replace the unknown tokens, and filter the patch candidates with compilation errors by leveraging the project-specific information. On Defects4J-vl.2, TENURE can fix 79 bugs and 52 bugs with perfect and Ochiai fault localization, respectively. It is able to repair 50 and 32 bugs as well on Defects4J-v2.0. Compared with the existing template-based and NMT-based studies, TENURE achieves the best performance in all experiments.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{MengWZSLH23,
  title = {Template-based Neural Program Repair},
  author = {Xiangxin Meng and Xu Wang and Hongyu Zhang and Hailong Sun and Xudong Liu and Chunming Hu},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00127}
}