arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2210.03986cs.SE
收藏

TransRepair:上下文感知的编译错误程序修复

TransRepair: Context-aware Program Repair for Compilation Errors

Xueyang Li, Shangqing Liu, Ruitao Feng, Guozhu Meng, Xiaofei Xie, Kai Chen, Yang Liu

摘要:

自动修复编译错误可以通过指导新手或AI程序员编写和调试代码来大大提高软件开发的生产率。近年来,基于学习的程序修复得到了广泛的关注,并成为实践中的前沿。但仍有很大的改进空间。在本文中,我们提出了一个端到端的解决方案TransRepair定位错误行,并创建正确的替代一个C程序的同时。优于同行,我们的方法考虑到错误代码和诊断编译反馈的上下文。然后,我们设计了一个基于transformer的神经网络来学习修复的方式,从错误的代码,以及它的上下文和诊断反馈。为了提高TransRepair的有效性,我们从两个真实世界的程序数据集和互联网上总结了5种类型和74个细粒度子类型的编译错误。然后,开发了一种程序损坏技术,以合成一个包含1,821,275个错误C程序的大型数据集。通过大量的实验,我们证明了TransRepair优于国家的最先进的单次修复精度和完整的修复精度。进一步的分析揭示了当代解决方案的优点和缺点,以供未来改进。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑