arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1708.09492cs.SEcs.CL
收藏

使用神经机器翻译从差异自动生成提交消息

Automatically Generating Commit Messages from Diffs using Neural Machine Translation

University of Notre Dame(圣母大学)

Siyuan Jiang, Ameer Armaly, Collin McMillan

摘要:

提交消息是理解软件演化的宝贵资源,因为它们提供了诸如功能添加和错误修复之类的更改记录。不幸的是,程序员经常忽视编写好的提交消息。已经提出了不同的技术来帮助程序员自动编写这些消息。这些技术在描述变更内容方面是有效的,但通常是冗长的,并且缺乏理解变更背后的基本原理的上下文。相比之下,人类写的信息很短,总结了高层次的理由。在本文中,我们采用神经机器翻译(NMT)来自动“翻译”差异到提交消息。我们使用来自前1k个Github项目的差异和人类编写的提交消息的语料库训练了一个NMT算法。我们设计了一个过滤器来帮助确保我们只在更高质量的提交消息上训练算法。我们的评估揭示了一种模式,在这种模式中,我们生成的消息往往要么质量很高,要么质量很低。因此,我们创建了一个质量保证过滤器来检测我们无法生成好消息的情况,并返回一个警告。

英文摘要:

Commit messages are a valuable resource in comprehension of software evolution, since they provide a record of changes such as feature additions and bug repairs. Unfortunately, programmers often neglect to write good commit messages. Different techniques have been proposed to help programmers by automatically writing these messages. These techniques are effective at describing what changed, but are often verbose and lack context for understanding the rationale behind a change. In contrast, humans write messages that are short and summarize the high level rationale. In this paper, we adapt Neural Machine Translation (NMT) to automatically "translate" diffs into commit messages. We trained an NMT algorithm using a corpus of diffs and human-written commit messages from the top 1k Github projects. We designed a filter to help ensure that we only trained the algorithm on higher-quality commit messages. Our evaluation uncovered a pattern in which the messages we generate tend to be either very high or very low quality. Therefore, we created a quality-assurance filter to detect cases in which we are unable to produce good messages, and return a warning instead.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑