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

Comments on评论:代码审查和文档相遇的地方

Comments on Comments: Where Code Review and Documentation Meet

Nikitha Rao, Jason Tsay, Martin Hirzel, Vincent J. Hellendoorn

摘要:

代码评审的一个核心功能是增加理解;帮助评审者理解代码更改有助于知识转移和发现bug。代码中的注释在很大程度上起到了类似的作用,帮助未来的读者理解程序。因此,研究当这两种理解形式发生冲突时会发生什么是很自然的。我们要问:评审员会对文档做出什么样的评论,这些评论如何影响对稿件的理解?我们分析了2,000个(Java和Python)GitHub项目的约70万条评论,并提出了几个过滤器来识别哪些评论可能是对文档更改的响应和/或对此类更改的要求。我们发现了65000个这样的案例。接下来,我们开发了一个“评论评论”背后的评论者意图的分类。我们发现,实现对代码的共同理解是关键:评审员的评论通常集中在澄清,其次是指出需要修复的问题,例如错别字和过时的评论。奇怪的是,评审员经常建议(通常是逐字逐句)澄清注释,这表明他们希望坚持在代码评审期间获得的理解。最后,我们讨论了我们的评论评论数据集对改进代码审查的研究的影响,包括自动化代码审查的潜在好处。

英文摘要:

A central function of code review is to increase understanding; helping reviewers understand a code change aids in knowledge transfer and finding bugs. Comments in code largely serve a similar purpose, helping future readers understand the program. It is thus natural to study what happens when these two forms of understanding collide. We ask: what documentation-related comments do reviewers make and how do they affect understanding of the contribution? We analyze ca.700K review comments on 2,000 (Java and Python) GitHub projects, and propose several filters to identify which comments are likely to be either in response to a change in documentation and/or call for such a change. We identify 65K such cases. We next develop a taxonomy of the reviewer intents behind such "comments on comments". We find that achieving a shared understanding of the code is key: reviewer comments most often focused on clarification, followed by pointing out issues to fix, such as typos and outdated comments. Curiously, clarifying comments were frequently suggested (often verbatim) by the reviewer, indicating a desire to persist their understanding acquired during code review. We conclude with a discussion of implications of our comments-on-comments dataset for research on improving code review, including the potential benefits for automating code review.

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

↑