一句话:构建结合提交信息与链接内容的分类器,揭示提交信息质量影响缺陷倾向并随时间下降。
提交信息对开发者沟通至关重要,其质量通常要求同时包含代码变更摘要(What)和背后动机/原因(Why),而 issue/PR 链接常被用来提供 Why 信息。本文发现这些链接在提供 Why 时存在若干质量问题,因此开发了一个机器学习分类器,结合提交信息与链接内容自动判断提交信息是否包含 What 和 Why。该分类器在 F1 上比当时最优分类器提高 12 个百分点。作者进一步开展混合方法实证分析,发现提交信息质量会影响软件缺陷倾向,且整体质量随时间下降,但开发者主观上认为自己在写出更好的提交信息。所有工具、脚本和数据均已公开。
Commit messages play an important role in communication among developers. To measure the quality of commit messages, researchers have defined what semantically constitutes a Good commit message: it should have both the summary of the code change (What) and the motivation/reason behind it (Why). The presence of the issue report/pull request links referenced in a commit message has been treated as a way of providing Why information. In this study, we found several quality issues that could hamper the links' ability to provide Why information. Based on this observation, we developed a machine learning classifier for automatically identifying whether a commit message has What and Why information by considering both the commit messages and the link contents. This classifier outperforms state-of-the-art machine learning classifiers by 12 percentage points improvement in the F1 score. With the improved classifier, we conducted a mixed method empirical analysis and found that: (1) Commit message quality has an impact on software defect proneness, and (2) the overall quality of the commit messages decreases over time, while developers believe they are writing better commit messages. All the research artifacts (i.e., tools, scripts, and data) of this study are available on the accompanying website [2].