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

基于大语言模型的人类代码审查评论自动分类

Automated Classification of Human Code Review Comments with Large Language Models

Bilkent University(比尔肯特大学)

Semih Çağlar, Şükrü Eren Gökırmak, Eray Tüzün

AI总结:

本文提出一种自动分类系统,针对代码审查评论中的具体问题类别进行分类,通过九类标签体系和手动标注数据,评估了不同模型在零样本和单样本分类中的表现。

摘要:

上下文:代码审查对于维护软件质量至关重要,然而许多人类审查评论存在冗余、模糊或缺乏建设性的问题。这类评论可能会减慢反馈速度并掩盖重要见解。先前关于代码审查评论的研究大多探讨了有用评论的检测和分类,而对评论问题的细粒度分类仍处于探索阶段。目标:本文旨在设计并评估一种自动分类系统,根据具体问题类别对代码审查评论进行分类。方法:我们引入了一个九标签的代码审查评论分类体系,涵盖六个审查评论异味和三个常见有用意图,并手动标注了来自公开数据集的448条评论。我们对每条评论及其关联的统一差异补丁进行了零样本和单样本单标签分类的基准测试,比较了GPT-5-mini、LLaMA-3.3和DeepSeek-R1模型。我们以宏F1值作为主要评估指标。结果:在类别不平衡的情况下,零样本性能表现一般(宏F1 0.360至0.374)。单样本示例条件对模型有依赖性影响:GPT-5-mini和DeepSeek-R1的宏F1分数有所提高,然而LLaMA-3.3则略有下降。示例最一致地帮助了意图边界标签,而对证据敏感的标签分类仍具有挑战性。结论:我们的结果表明,评论-差异证据对于某些标签是足够的,但对于证据敏感的异味则有限。未来的工作包括添加线程上下文、改进意图保持的重写,以及在不同平台上验证鲁棒性。

英文摘要:

Context: Code reviews are essential for maintaining software quality, yet many human review comments suffer from issues such as redundancy, vagueness, or lack of constructiveness. These types of comments may slow down feedback and obscure important insights. Prior work on code review comments mostly explore the detection and categorization of useful comments, while fine-grained categorization of comment issues remains underexplored. Objective: This work aims to design and evaluate an automated system for classifying code review comments according to specific categories of issues. Methodology: We introduced a nine-label taxonomy for code review comments, covering six review comment smells and three common useful intents, and manually labeled 448 comments from a publicly available dataset. We benchmarked zero-shot and one-shot single-label classification over each comment and its associated unified diff hunk, comparing GPT-5-mini, LLaMA-3.3, and DeepSeek-R1. We reported macro-F1 as the primary metric. Results: Zero-shot performance was moderate under class imbalance (macro-F1 0.360 to 0.374). One-shot exemplar conditioning had model-dependent effects: GPT-5-mini and DeepSeek-R1 macro-F1 scores improved, however LLaMA-3.3 suffered a slight decrease. Exemplars most consistently helped intent-boundary labels, whereas classification of evidence-sensitive labels remain challenging. Conclusion: Our results indicate that comment--diff evidence is sufficient for some labels but limited for evidence-sensitive smells. Future work includes adding thread context, improving intent-preserving rewrites, and validating robustness across platforms.

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

↑