arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.11627cs.SE
收藏

示例驱动的代码评审解释

Example Driven Code Review Explanation

Shadikur Rahman, Umme Ayman Koana, Maleknaz Nayebi

摘要:

背景:代码审查是软件开发的重要组成部分,以确保软件质量。然而,审评任务的繁重和审评人员工作量的繁重对审评质量产生了负面影响。简短的评论文本通常是不可操作的,这需要评论者和开发人员之间进一步的互动。这个问题在动态团队中变得更加关键,在新团队成员不太熟悉他们的评审员和观点的情况下。目的:我们提出了示例驱动评审解释(EDRE)方法,通过示例添加额外的解释来促进代码评审过程。EDRE推荐类似的代码评审作为示例,以进一步解释评审,并帮助开发人员以更少的通信开销理解收到的评审。方法:通过在工业环境中的实证研究,并通过分析三个开源项目的3,722个代码评审,我们比较了数据检索,文本分类和文本推荐的五种方法。结果如下:使用TF-IDF词嵌入和SVM分类器的EDRE可以为每个代码审查提供实际示例,F分数为92%,准确率为90%。结论:基于实例的解释是一种辅助专家解释决策的既定方法。EDRE是基于相同的理念开发的,可以准确地提供一组特定于上下文的示例,以促进软件团队中的代码评审过程。

英文摘要:

Background: Code reviewing is an essential part of software development to ensure software quality. However, the abundance of review tasks and the intensity of the workload for reviewers negatively impact the quality of the reviews. The short review text is often unactionable, which needs further interaction between the reviewer and the developer. The problem becomes more critical in dynamic teams and in the case of new team members who are less familiar with their reviewers and perspectives. Aims: We are proposing the Example Driven Review Explanation (EDRE) method to facilitate the code review process by adding additional explanations through examples. EDRE recommends similar code reviews as examples to further explain a review and help a developer to understand the received reviews with less communication overhead. Method: Through an empirical study in an industrial setting and by analyzing 3,722 code reviews across three open-source projects, we compared five methods of data retrieval, text classification, and text recommendation. Results: EDRE using TF-IDF word embedding along with an SVM classifier can provide practical examples for each code review with 92% F-score and 90% Accuracy. Conclusions: The example-based explanation is an established method for assisting experts in explaining decisions. EDRE was developed based on the same philosophy and can accurately provide a set of context-specific examples to facilitate the code review process in software teams.

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

↑