首页> 外文会议>International Conference on Software Engineering >On Learning Meaningful Code Changes Via Neural Machine Translation
【24h】

On Learning Meaningful Code Changes Via Neural Machine Translation

机译:通过神经机器翻译学习有意义的代码更改

获取原文

摘要

Recent years have seen the rise of Deep Learning (DL) techniques applied to source code. Researchers have exploited DL to automate several development and maintenance tasks, such as writing commit messages, generating comments and detecting vulnerabilities among others. One of the long lasting dreams of applying DL to source code is the possibility to automate non-trivial coding activities. While some steps in this direction have been taken (e.g., learning how to fix bugs), there is still a glaring lack of empirical evidence on the types of code changes that can be learned and automatically applied by DL. Our goal is to make this first important step by quantitatively and qualitatively investigating the ability of a Neural Machine Translation (NMT) model to learn how to automatically apply code changes implemented by developers during pull requests. We train and experiment with the NMT model on a set of 236k pairs of code components before and after the implementation of the changes provided in the pull requests. We show that, when applied in a narrow enough context (i.e., small/medium-sized pairs of methods before/after the pull request changes), NMT can automatically replicate the changes implemented by developers during pull requests in up to 36% of the cases. Moreover, our qualitative analysis shows that the model is capable of learning and replicating a wide variety of meaningful code changes, especially refactorings and bug-fixing activities. Our results pave the way for novel research in the area of DL on code, such as the automatic learning and applications of refactoring.
机译:近年来,已经看到了应用于源代码的深度学习(DL)技术的兴起。研究人员已经利用DL来自动化一些开发和维护任务,例如编写提交消息,生成注释和检测漏洞等。将DL应用于源代码的长期梦想之一是使非平凡的编码活动自动化的可能性。尽管已经朝着这个方向采取了一些步骤(例如,学习如何修复错误),但是仍然缺少针对DL可以学习和自动应用的代码更改类型的经验证据。我们的目标是通过定量和定性研究神经机器翻译(NMT)模型学习如何自动应用开发人员在请求请求期间实施的代码更改的能力,迈出第一步。在实施拉取请求中提供的更改之前和之后,我们在一组236k对代码组件上训练和试验NMT模型。我们证明,如果在足够狭窄的上下文中应用(即,拉取请求更改之前/之后的中小型方法对),NMT可以自动复制开发人员在拉取请求期间实现的更改的多达36%。案件。此外,我们的定性分析表明,该模型能够学习和复制各种有意义的代码更改,尤其是重构和错误修复活动。我们的研究结果为在DL上的代码研究(例如自动学习和重构应用)铺平了道路。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号