An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translation

Author:

Tufano Michele1ORCID,Watson Cody1,Bavota Gabriele2,Penta Massimiliano Di3,White Martin1,Poshyvanyk Denys1

Affiliation:

1. College of William and Mary, Williamsburg, Virginia

2. Università della Svizzera italiana (USI), Lugano, Switzerland

3. University of Sannio, Benevento, Italy

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. First, we mine millions of bug-fixes from the change histories of projects hosted on GitHub in order to extract meaningful examples of such bug-fixes. Next, 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. In our empirical investigation, we found that such a model is able to fix thousands of unique buggy methods in the wild. Overall, this model is capable of predicting fixed patches generated by developers in 9--50% of the cases, depending on the number of candidate patches we allow it to generate. Also, the model is able to emulate a variety of different Abstract Syntax Tree operations and generate candidate patches in a split second.

Funder

NSF

SNF

Swiss National Science Foundation for the CCQR project

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference95 articles.

1. What's a Typical Commit? A Characterization of Open Source Software Repositories

2. Miltiadis Allamanis. 2018. The adverse effects of code duplication in machine learning models of code. CoRR abs/1812.06469. http://arxiv.org/abs/1812.06469 Miltiadis Allamanis. 2018. The adverse effects of code duplication in machine learning models of code. CoRR abs/1812.06469. http://arxiv.org/abs/1812.06469

3. Suggesting accurate method and class names

4. Is it a bug or an enhancement?

5. A novel co-evolutionary approach to automatic software bug fixing

Cited by 189 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Automated patch correctness predicting to fix software defect;Expert Systems with Applications;2024-12

2. Calico: Automated Knowledge Calibration and Diagnosis for Elevating AI Mastery in Code Tasks;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11

3. One Size Does Not Fit All: Multi-granularity Patch Generation for Better Automated Program Repair;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11

4. My Fuzzers Won’t Build: An Empirical Study of Fuzzing Build Failures;ACM Transactions on Software Engineering and Methodology;2024-08-21

5. Benchmarking and Categorizing the Performance of Neural Program Repair Systems for Java;ACM Transactions on Software Engineering and Methodology;2024-08-19

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3