用新评估框架发现代码评审自动生成效果差,但能显著提升效率。
DeepCRCEval: Revisiting the Evaluation of Code Review Comment Generation
- 引入人类与大模型结合的评估框架,突破传统相似度指标局限
- 仅不到10%的基准评论适合自动化,传统方法误判率高
- 新框架效率提升超88%,适合关注代码质量的开发者和研究者
代码评审是软件开发中关键但繁重的环节,自动化生成评审意见受到广泛关注。传统评估方法主要依赖文本相似度,面临两大问题:开源项目中人工评论质量不一,且相似度与提升代码质量、发现缺陷等目标相关性弱。本研究基于前期研究和开发者访谈,提出一套新的评估标准,对基准评论和现有方法进行重新评估。提出的DeepCRCEval框架融合人类评估者与大语言模型(LLMs),基于新标准全面重评当前技术。此外,还设计了高效基线LLM-Reviewer,利用大模型少样本学习能力实现目标导向对比。研究发现,仅有不足10%的基准评论具备高质量自动化潜力。相比之下,DeepCRCEval能有效区分高低质量评论,评估更可靠。将LLM评估者融入后,评估时间与成本分别降低88.78%和90.32%。同时,LLM-Reviewer展现出聚焦任务目标的生成潜力。
原文摘要 · Abstract (English)
Code review is a vital but demanding aspect of software development, generating significant interest in automating review comments. Traditional evaluation methods for these comments, primarily based on text similarity, face two major challenges: inconsistent reliability of human-authored comments in open-source projects and the weak correlation of text similarity with objectives like enhancing code quality and detecting defects. This study empirically analyzes benchmark comments using a novel set of criteria informed by prior research and developer interviews. We then similarly revisit the evaluation of existing methodologies. Our evaluation framework, DeepCRCEval, integrates human evaluators and Large Language Models (LLMs) for a comprehensive reassessment of current techniques based on the criteria set. Besides, we also introduce an innovative and efficient baseline, LLM-Reviewer, leveraging the few-shot learning capabilities of LLMs for a target-oriented comparison. Our research highlights the limitations of text similarity metrics, finding that less than 10% of benchmark comments are high quality for automation. In contrast, DeepCRCEval effectively distinguishes between high and low-quality comments, proving to be a more reliable evaluation mechanism. Incorporating LLM evaluators into DeepCRCEval significantly boosts efficiency, reducing time and cost by 88.78% and 90.32%, respectively. Furthermore, LLM-Reviewer demonstrates significant potential of focusing task real targets in comment generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。