An empirical investigation into learning bug-fixing patches in the wild via neural machine translation
- Michele Tufano ,
- Cody Watson ,
- Gabriele Bavota ,
- Massimiliano Di Penta ,
- Martin White ,
- Denys Poshyvanyk
2018 Automated Software Engineering |
Published by ACM
PDF | Publication | Publication | Publication
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.