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

面向自动化代码审查反馈分类以支持分析

Towards Automated Classification of Code Review Feedback to Support Analytics

Asif Kamal Turzo, Fahim Faysal, Ovi Poddar, Jaydeb Sarker, Anindya Iqbal, Amiangshu Bosu

AI总结:

本文提出基于DNN和代码上下文的代码审查评论自动分类方法,使用CodeBERT在1,828条评论上达到59.3%准确率,比Fregnan等人方法高18.7%,可支持审查反馈优先级排序和审查者选择。

摘要:

背景:由于提高代码审查(CR)有效性是许多软件开发组织的优先事项,项目已部署代码审查分析平台以识别潜在的改进领域。所识别问题的数量是衡量代码审查有效性的关键指标,但如果将所有问题都归入同一类别,该指标可能会产生误导。因此,对代码审查期间识别出的问题进行更细粒度的分类,可以为提高代码审查有效性提供可操作的见解。尽管Fregnan等人最近的工作提出了自动化模型来对代码审查引发的变更进行分类,但我们注意到两个潜在的改进领域——i)对不引发变更的评论进行分类,以及ii)将深度神经网络(DNN)与代码上下文结合使用以提高性能。目标:本研究旨在开发一种自动化的代码审查评论分类器,利用DNN模型实现比Fregnan等人更可靠的性能。方法:使用包含1,828条代码审查评论的人工标注数据集,我们训练并评估了基于监督学习的DNN模型,利用代码上下文、评论文本和一组代码度量指标,将代码审查评论分类为Turzo和Bosu提出的五个高层类别之一。结果:基于我们对多种分词方法组合的10折交叉验证评估,我们发现使用CodeBERT的模型达到了59.3%的最佳准确率。我们的方法比Fregnan等人的方法准确率高出18.7%。结论:除了促进改进的代码审查分析之外,我们提出的模型还可以帮助开发人员确定代码审查反馈的优先级并选择审查者。

英文摘要:

Background: As improving code review (CR) effectiveness is a priority for many software development organizations, projects have deployed CR analytics platforms to identify potential improvement areas. The number of issues identified, which is a crucial metric to measure CR effectiveness, can be misleading if all issues are placed in the same bin. Therefore, a finer-grained classification of issues identified during CRs can provide actionable insights to improve CR effectiveness. Although a recent work by Fregnan et al. proposed automated models to classify CR-induced changes, we have noticed two potential improvement areas -- i) classifying comments that do not induce changes and ii) using deep neural networks (DNN) in conjunction with code context to improve performances. Aims: This study aims to develop an automated CR comment classifier that leverages DNN models to achieve a more reliable performance than Fregnan et al. Method: Using a manually labeled dataset of 1,828 CR comments, we trained and evaluated supervised learning-based DNN models leveraging code context, comment text, and a set of code metrics to classify CR comments into one of the five high-level categories proposed by Turzo and Bosu. Results: Based on our 10-fold cross-validation-based evaluations of multiple combinations of tokenization approaches, we found a model using CodeBERT achieving the best accuracy of 59.3%. Our approach outperforms Fregnan et al.'s approach by achieving 18.7% higher accuracy. Conclusion: Besides facilitating improved CR analytics, our proposed model can be useful for developers in prioritizing code review feedback and selecting reviewers.

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

↑