论文标题

了解代码评论中的代码段

Understanding Code Snippets in Code Reviews: A Preliminary Study of the OpenStack Community

论文作者

Fu, Liming, Liang, Peng, Zhang, Beiqi

论文摘要

代码审查是软件开发中软件质量保证的成熟实践,审阅者检查了开发人员所做的代码,并验证代码的质量。在《代码审查讨论》中,审阅者和开发人员可能会使用代码段提供必要的信息(例如建议或说明)。但是,对于代码评论中代码段的意图和影响知之甚少。为此,我们进行了一项初步研究,以研究代码片段的性质及其在代码审查中的目的。我们手动收集并检查了OpenStack社区NOVA和中子项目的10,790条评论评论,并最终获得了626个评论评论,其中包含代码snippets以进行进一步分析。结果表明:(1)代码摘要在代码评论中不普遍使用,并且大多数代码片段由审阅者提供。 (2)我们确定了审稿人提供的两个高级代码段(即建议和引文)的高级目的,其中有六个详细的目的,其中改进代码实施是最常见的目的。 (3)对于代码审查中的代码片段,其目的是建议,开发人员接受了约68.1%的内容。结果突出了有关在代码评论中使用代码段的有希望的研究指示。

Code review is a mature practice for software quality assurance in software development with which reviewers check the code that has been committed by developers, and verify the quality of code. During the code review discussions, reviewers and developers might use code snippets to provide necessary information (e.g., suggestions or explanations). However, little is known about the intentions and impacts of code snippets in code reviews. To this end, we conducted a preliminary study to investigate the nature of code snippets and their purposes in code reviews. We manually collected and checked 10,790 review comments from the Nova and Neutron projects of the OpenStack community, and finally obtained 626 review comments that contain code snippets for further analysis. The results show that: (1) code snippets are not prevalently used in code reviews, and most of the code snippets are provided by reviewers. (2) We identified two high-level purposes of code snippets provided by reviewers (i.e., Suggestion and Citation) with six detailed purposes, among which, Improving Code Implementation is the most common purpose. (3) For the code snippets in code reviews with the aim of suggestion, around 68.1% was accepted by developers. The results highlight promising research directions on using code snippets in code reviews.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源