arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2202.02974cs.SEcs.HC
收藏

什么是好的提交消息?

What Makes a Good Commit Message?

Yingchen Tian, Yuxia Zhang, Klaas-Jan Stol, Lin Jiang, Hui Liu

摘要:

协作软件开发中的一个关键问题是开发人员之间的沟通。一种通信方式是提交消息,开发人员在其中描述他们在存储库中所做的更改。因此,提交消息作为一种“审计跟踪”,开发人员可以通过它了解项目的源代码是如何更改的以及更改的原因。因此,提交消息的质量会影响开发人员之间通信的有效性。提交消息通常质量很差,因为开发人员缺乏时间和动力来制作好的消息。已经提出了几种自动方法来生成提交消息。然而,这些都是基于未经策划的数据集,包括相当大比例的措辞拙劣的提交消息。在这个多方法研究中,我们首先定义什么是“好”的提交消息,然后使用来自五个高度活跃的开源项目的近1,600条消息的样本来确定提交消息中缺少信息的比例。我们发现,平均约44%的消息可以得到改进,这表明使用未经策划的数据集可能是使用此类数据训练提交消息生成器时的主要威胁。我们还观察到,以前的工作没有考虑提交消息的语义,并且令人惊讶的是,编写好的提交消息的指导很少。为此,我们开发了一个基于提交消息表达式中重复出现的模式的分类法。最后,我们调查是否可以自动识别“好”的提交消息,这样的自动化可以促使开发人员编写更好的提交消息。

英文摘要:

A key issue in collaborative software development is communication among developers. One modality of communication is a commit message, in which developers describe the changes they make in a repository. As such, commit messages serve as an "audit trail" by which developers can understand how the source code of a project has changed-and why. Hence, the quality of commit messages affects the effectiveness of communication among developers. Commit messages are often of poor quality as developers lack time and motivation to craft a good message. Several automatic approaches have been proposed to generate commit messages. However, these are based on uncurated datasets including considerable proportions of poorly phrased commit messages. In this multi-method study, we first define what constitutes a "good" commit message, and then establish what proportion of commit messages lack information using a sample of almost 1,600 messages from five highly active open source projects. We find that an average of circa 44% of messages could be improved, suggesting the use of uncurated datasets may be a major threat when commit message generators are trained with such data. We also observe that prior work has not considered semantics of commit messages, and there is surprisingly little guidance available for writing good commit messages. To that end, we develop a taxonomy based on recurring patterns in commit messages' expressions. Finally, we investigate whether "good" commit messages can be automatically identified; such automation could prompt developers to write better commit messages.

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

↑