一句话:实证研究用神经机器翻译从GitHub历史中学习真实缺陷修复补丁,能修复数百个真实bug方法,9%情况下复现开发者补丁。
该论文探索能否利用神经机器翻译(NMT)技术从开源软件开发历史中自动学习缺陷修复补丁。作者从GitHub仓库的变更历史中挖掘数百万条bug修复记录,从中抽取有意义的修复示例;随后对缺陷代码与对应修复代码进行抽象化处理,用以训练一个Encoder-Decoder模型,将缺陷代码“翻译”为修复后的代码。评估表明,该模型能够在真实场景(in the wild)中修复数百个不同的缺陷方法,并在9%的案例中预测出与开发者实际提交的修复补丁完全一致的补丁。论文以此实证性结论论证了从大规模代码变更历史中学习通用缺陷修复模式的可行性,同时揭示了当前NMT方法在该任务上的效果上限。
Millions of open-source projects with numerous bug fixes are available in code repositories. This proliferation of software development histories can be leveraged to learn how to fix common programming bugs. To explore such a potential, we perform an empirical study to assess the feasibility of using Neural Machine Translation techniques for learning bug-fixing patches for real defects. We mine millions of bug-fixes from the change histories of GitHub repositories to extract meaningful examples of such bug-fixes. Then, we abstract the buggy and corresponding fixed code, and use them to train an Encoder-Decoder model able to translate buggy code into its fixed version. Our model is able to fix hundreds of unique buggy methods in the wild. Overall, this model is capable of predicting fixed patches generated by developers in 9% of the cases.
@inproceedings{paperbot4763,
title = {An empirical investigation into learning bug-fixing patches in the wild via neural machine translation},
author = {Michele Tufano and Cody Watson and Gabriele Bavota and Massimiliano Di Penta and Martin White and Denys Poshyvanyk},
booktitle = {ASE},
year = {2018},
doi = {10.1145/3238147.3240732}
}