paperbot · PL 论文追踪

全部论文 待读 收藏

P2 TransRepair: Context-aware Program Repair for Compilation Errors

TransRepair:面向编译错误的上下文感知程序修复
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 3/10 · 该论文属于机器学习辅助的编译错误程序修复,与用户关注的“静态分析/形式化验证×LLM/Agent”核心方向距离较远,也未涉及浮点程序分析或贝叶斯程序分析;仅可归入较宽泛的 PL+ML 软件工程修复范畴。引用 32 inbox
Xueyang Li, Shangqing Liu, Ruitao Feng, Guozhu Meng, Xiaofei Xie, Kai Chen, Yang Liu
crossref: 2026-09-12

AI 速览

一句话:提出端到端 Transformer 方法,结合代码上下文与编译诊断反馈,同时定位错误行并生成 C 程序修复替换。

自动修复编译错误能显著提升软件开发效率,尤其有助于新手或 AI 程序员调试代码。现有基于学习的程序修复虽已成为实践中的先进方法,但仍未充分利用错误代码上下文与编译器诊断反馈。本文提出端到端方案 TransRepair,使用 Transformer 神经网络同时定位错误行并生成正确替换,学习错误代码、上下文及诊断反馈中的修复模式。为提升效果,作者从真实程序数据集和互联网总结出 5 类、74 个细粒度编译错误子类型,并通过程序破坏技术合成包含 1,821,275 个错误 C 程序的大规模数据集。实验表明,TransRepair 在单次修复准确率和完整修复准确率上均优于当时最先进方法,并进一步分析了现有方案的强弱。

问题
自动修复编译错误对开发效率很重要,但现有基于学习的修复方法尚未充分利用错误代码上下文与编译器诊断反馈,仍有较大改进空间。
方法
提出端到端 TransRepair,采用 Transformer 网络联合建模错误代码、上下文与编译诊断反馈,同时定位错误行并生成正确替换;并总结 5 类 74 个细粒度编译错误子类型,用程序破坏技术合成大规模错误 C 程序数据集。
评估
在合成的 1,821,275 个错误 C 程序及真实数据上进行广泛实验,比较单次修复准确率和完整修复准确率,证明其优于当时最先进方法,并分析现有方案的优势与不足。
原文摘要(Abstract)

Automatically fixing compilation errors can greatly raise the productivity of software development, by guiding the novice or AI programmers to write and debug code. Recently, learning-based program repair has gained extensive attention and became the state-of-the-art in practice. But it still leaves plenty of space for improvement. In this paper, we propose an end-to-end solution TransRepair to locate the error lines and create the correct substitute for a C program simultaneously. Superior to the counterpart, our approach takes into account the context of erroneous code and diagnostic compilation feedback. Then we devise a Transformer-based neural network to learn the ways of repair from the erroneous code as well as its context and the diagnostic feedback. To increase the effectiveness of TransRepair, we summarize 5 types and 74 fine-grained sub-types of compilations errors from two real-world program datasets and the Internet. Then a program corruption technique is developed to synthesize a large dataset with 1,821,275 erroneous C programs. Through the extensive experiments, we demonstrate that TransRepair outperforms the state-of-the-art in both single repair accuracy and full repair accuracy. Further analysis sheds light on the strengths and weaknesses in the contemporary solutions for future improvement.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7197,
  title = {TransRepair: Context-aware Program Repair for Compilation Errors},
  author = {Xueyang Li and Shangqing Liu and Ruitao Feng and Guozhu Meng and Xiaofei Xie and Kai Chen and Yang Liu},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3560422}
}