理解从业者对清晰代码评审评论的期望
Understanding Practitioners' Expectations on Clear Code Review Comments
AI总结:
本研究通过定义RIE属性并构建ClearCRC模型,系统评估代码评审评论的清晰性,发现28.8%的评论存在清晰性不足,所提模型在自动评估中达到73.04%的平衡准确率与94.61%的F1分数。
摘要:
代码评审评论(CRC)在现代代码评审过程中至关重要。它为评审者提供了识别潜在缺陷、提供建设性反馈和提出改进建议的机会。清晰简洁的代码评审评论(CRC)促进了开发者之间的沟通,对于正确理解已识别的问题和提出的解决方案至关重要。尽管CRC的清晰性很重要,但关于什么构成良好的清晰性以及如何评估它,仍然缺乏指导方针。在本文中,我们对理解和评估CRC的清晰性进行了全面研究。我们首先基于文献综述和从业者调查,推导出一组与CRC清晰性相关的属性,即RIE属性(即相关性、信息量和表达),以及它们相应的评估标准。然后,我们调查了用九种编程语言编写的开源项目中CRC的清晰性,发现很大一部分(即28.8%)的CRC在至少一个属性上缺乏清晰性。最后,我们通过提出ClearCRC来探索自动评估CRC清晰性的潜力。实验结果表明,使用预训练语言模型的ClearCRC在有效评估CRC清晰性方面是有前景的,实现了高达73.04%的平衡准确率和高达94.61%的F1分数。
英文摘要:
The code review comment (CRC) is pivotal in the process of modern code review. It provides reviewers with the opportunity to identify potential bugs, offer constructive feedback, and suggest improvements. Clear and concise code review comments (CRCs) facilitate the communication between developers and are crucial to the correct understanding of the identified issues and proposed solutions. Despite the importance of CRCs' clarity, there is still a lack of guidelines on what constitutes a good clarity and how to evaluate it. In this paper, we conduct a comprehensive study on understanding and evaluating the clarity of CRCs. We first derive a set of attributes related to the clarity of CRCs, namely RIE attributes (i.e., Relevance, Informativeness, and Expression), as well as their corresponding evaluation criteria based on our literature review and survey with practitioners. We then investigate the clarity of CRCs in open-source projects written in nine programming languages and find that a large portion (i.e., 28.8%) of the CRCs lack the clarity in at least one of the attributes. Finally, we explore the potential of automatically evaluating the clarity of CRCs by proposing ClearCRC. Experimental results show that ClearCRC with pre-trained language models is promising for effective evaluation of the clarity of CRCs, achieving a balanced accuracy up to 73.04% and a F-1 score up to 94.61%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。