论文标题

较少的培训,更多的维修:通过零射门学习重新访问自动化程序维修

Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learning

论文作者

Xia, Chunqiu Steven, Zhang, Lingming

论文摘要

由于自动化计划维修(APR)的前途有希望的未来,研究人员提出了各种APR技术,包括基于启发式,基于模板和基于约束的技术。在这种经典的APR技术中,基于模板的技术已被广泛认为是最新技术。但是,这种基于模板的技术需要预定义的模板才能进行维修,因此其有效性受到限制。为此,研究人员利用了深度学习的最新进展来进一步改善APR。这样的基于学习的技术将APR视为神经机器翻译问题,使用越野车/固定代码段作为翻译的源/目标语言。这样,这种技术在很大程度上依赖大量高质量的固定构成,这可能是非常昂贵且具有挑战性的。此外,这些基于学习的技术的编辑多样性仅限于其培训数据集中的可用错误修复。因此,在本文中,我们旨在重新审视基于学习的APR问题,并提出AlpharePair,以使用大型预训练的代码模型直接利用零射击学习。我们的主要洞察力是对维修编辑的外观进行建模,而是可以直接根据上下文信息预测正确的代码。我们已经根据最近的Codebert模型实施了AlpharePair作为一种实用的多语言APR工具。我们对广泛使用的缺陷4J基准的结果表明,AlpharePair可以大大优于最先进的APR工具。我们还研究了不同设计选择的影响,并表明AlpharePair在较新版本的缺陷4J(2.0)上的表现更好,其修复程序比最佳性能基线要多3.3倍,这表明AlpharePair可能会避免避免使用数据集对基于学习的基于学习的技术的问题。

Due to the promising future of Automated Program Repair (APR), researchers have proposed various APR techniques, including heuristic-based, template-based, and constraint-based techniques. Among such classic APR techniques, template-based techniques have been widely recognized as state of the art. However, such template-based techniques require predefined templates to perform repair, and their effectiveness is thus limited. To this end, researchers leveraged the recent advances in Deep Learning to further improve APR. Such learning-based techniques view APR as a Neural Machine Translation problem, using the buggy/fixed code snippets as the source/target languages for translation. In this way, such techniques heavily rely on large numbers of high-quality bug-fixing commits, which can be extremely costly and challenging to construct. Furthermore, the edit variety of these learning-based techniques are limited to the available bug-fixes within their training datasets. Therefore, in this paper, we aim to revisit the learning-based APR problem, and propose AlphaRepair, to leverage zero-shot learning directly using large pre-trained code models for APR. Our main insight is instead of modeling what a repair edit should look like, we can directly predict what the correct code is based on the context information. We have implemented AlphaRepair as a practical multilingual APR tool based on the recent CodeBERT model. Our results on the widely used Defects4J benchmark show that AlphaRepair can substantially outperform state-of-the-art APR tools. We also studied the impact of different design choices and show that AlphaRepair performs even better on a newer version of Defects4J (2.0) with 3.3X more fixes than best performing baseline, indicating that AlphaRepair can potentially avoid the dataset-overfitting issue of existing learning-based techniques.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源