SWR-Bench:评估大语言模型在真实世界代码审查评论生成中的性能
SWR-Bench: Assessing LLM Performance in Real-World Code Review Comment Generation
AI总结:
SWR-Bench通过1000个手动验证的GitHubPull Requests,评估LLM在真实世界代码审查中的性能,提出客观评估方法并验证了多评论聚合策略,显著提升ACR性能。
摘要:
自动化代码审查(ACR)对软件质量至关重要,但现有基准测试往往无法反映真实世界复杂性,阻碍了现代大语言模型(LLMs)的评估。当前基准测试通常聚焦于细粒度代码单元,缺乏完整项目上下文,并使用不充分的评估指标。为解决这些限制,我们引入SWRBench,一个新的包含1000个手动验证的Pull Requests(PRs)的基准测试,提供PR为中心的审查,具有完整的项目上下文。SWRBench采用一种客观的基于LLM的评估方法,通过验证生成的审查是否覆盖结构化的地面真相中的问题,与人类判断高度一致(约90%的一致性)。我们对主流ACR工具和LLMs在SWRBench上的系统评估表明,当前系统表现不佳,ACR工具在检测功能错误方面更擅长。随后,我们提出并验证了一种简单的多审查聚合策略,显著提升了ACR性能,将F1分数提高了高达43.67%。我们的贡献包括SWRBench基准测试、其客观评估方法、对当前ACR能力的全面研究以及一种有效的增强方法,为推进ACR研究提供了有价值的见解。
英文摘要:
Automated Code Review (ACR) is crucial for software quality, yet existing benchmarks often fail to reflect real-world complexities, hindering the evaluation of modern Large Language Models (LLMs). Current benchmarks frequently focus on fine-grained code units, lack complete project context, and use inadequate evaluation metrics. To address these limitations, we introduce SWRBench , a new benchmark comprising 1000 manually verified Pull Requests (PRs) from GitHub, offering PR-centric review with full project context. SWRBench employs an objective LLM-based evaluation method that aligns strongly with human judgment (~90 agreement) by verifying if issues from a structured ground truth are covered in generated reviews. Our systematic evaluation of mainstream ACR tools and LLMs on SWRBench reveals that current systems underperform, and ACR tools are more adept at detecting functional errors. Subsequently, we propose and validate a simple multi-review aggregation strategy that significantly boosts ACR performance, increasing F1 scores by up to 43.67%. Our contributions include the SWRBench benchmark, its objective evaluation method, a comprehensive study of current ACR capabilities, and an effective enhancement approach, offering valuable insights for advancing ACR research.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。