一句话:定义了“好的提交信息”标准,分析近1600条提交发现约44%可改进,并构建表达模式分类体系,探索自动识别。
协作开发中,提交信息是开发者沟通和审计代码变更的重要渠道,但其质量常因缺乏时间和动机而偏低。已有自动生成提交信息的方法多基于未经筛选的数据集,其中包含大量表述不佳的信息。本文采用多方法研究:首先界定何为“好的”提交信息,然后从五个高活跃开源项目中抽取近1600条信息,评估缺少信息的比例;接着归纳提交信息表达的反复出现模式,构建分类体系;最后探究能否自动识别“好的”提交信息,以提示开发者改进。研究发现平均约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.