kirancodes.me
To Proof Maintenance & Beyond!

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

Abstract

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.

BibTeX
@inproceedings{Tufano-al:ASE18,
  author    = {Michele Tufano and
               Cody Watson and
               Gabriele Bavota and
               Massimiliano Di Penta and
               Martin White and
               Denys Poshyvanyk},
  title     = {An empirical investigation into learning bug-fixing patches in the wild via neural machine translation},
  booktitle = {ASE},
  pages     = {832--837},
  publisher = {{ACM}},
  year      = {2018},
}

Related papers