Benchmarking LLMs for Fine-Grained Code Review with Enriched Context in Practice

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Hu, Ruida, Wang, Xinchen, Wen, Xin-Cheng, Zhang, Zhao, Jiang, Bo, Gao, Pengfei, Peng, Chao, Gao, Cuiyun
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866918265972850688
author Hu, Ruida
Wang, Xinchen
Wen, Xin-Cheng
Zhang, Zhao
Jiang, Bo
Gao, Pengfei
Peng, Chao
Gao, Cuiyun
author_facet Hu, Ruida
Wang, Xinchen
Wen, Xin-Cheng
Zhang, Zhao
Jiang, Bo
Gao, Pengfei
Peng, Chao
Gao, Cuiyun
contents Code review is a cornerstone of software quality assurance, and recent advances in Large Language Models (LLMs) have shown promise in its automation. However, existing benchmarks for LLM-based code review face three major limitations. Lack of semantic context: most benchmarks provide only code diffs without textual information such as issue descriptions, which are crucial for understanding developer intent. Data quality issues: without rigorous validation, many samples are noisy-e.g., reviews on outdated or irrelevant code-reducing evaluation reliability. Coarse granularity: most benchmarks operate at the file or commit level, overlooking the fine-grained, line-level reasoning essential for precise review. We introduce ContextCRBench, a high-quality, context-rich benchmark for fine-grained LLM evaluation in code review. Our construction pipeline comprises: Raw Data Crawling, collecting 153.7K issues and pull requests from top-tier repositories; Comprehensive Context Extraction, linking issue-PR pairs for textual context and extracting the full surrounding function or class for code context; and Multi-stage Data Filtering, combining rule-based and LLM-based validation to remove outdated, malformed, or low-value samples, resulting in 67,910 context-enriched entries. ContextCRBench supports three evaluation scenarios aligned with the review workflow: hunk-level quality assessment, line-level defect localization, and line-level comment generation. Evaluating eight leading LLMs (four closed-source and four open-source) reveals that textual context yields greater performance gains than code context alone, while current LLMs remain far from human-level review ability. Deployed at ByteDance, ContextCRBench drives a self-evolving code review system, improving performance by 61.98% and demonstrating its robustness and industrial utility. https://github.com/kinesiatricssxilm14/ContextCRBench.
format Preprint
id arxiv_https___arxiv_org_abs_2511_07017
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Benchmarking LLMs for Fine-Grained Code Review with Enriched Context in Practice
Hu, Ruida
Wang, Xinchen
Wen, Xin-Cheng
Zhang, Zhao
Jiang, Bo
Gao, Pengfei
Peng, Chao
Gao, Cuiyun
Software Engineering
Artificial Intelligence
Code review is a cornerstone of software quality assurance, and recent advances in Large Language Models (LLMs) have shown promise in its automation. However, existing benchmarks for LLM-based code review face three major limitations. Lack of semantic context: most benchmarks provide only code diffs without textual information such as issue descriptions, which are crucial for understanding developer intent. Data quality issues: without rigorous validation, many samples are noisy-e.g., reviews on outdated or irrelevant code-reducing evaluation reliability. Coarse granularity: most benchmarks operate at the file or commit level, overlooking the fine-grained, line-level reasoning essential for precise review. We introduce ContextCRBench, a high-quality, context-rich benchmark for fine-grained LLM evaluation in code review. Our construction pipeline comprises: Raw Data Crawling, collecting 153.7K issues and pull requests from top-tier repositories; Comprehensive Context Extraction, linking issue-PR pairs for textual context and extracting the full surrounding function or class for code context; and Multi-stage Data Filtering, combining rule-based and LLM-based validation to remove outdated, malformed, or low-value samples, resulting in 67,910 context-enriched entries. ContextCRBench supports three evaluation scenarios aligned with the review workflow: hunk-level quality assessment, line-level defect localization, and line-level comment generation. Evaluating eight leading LLMs (four closed-source and four open-source) reveals that textual context yields greater performance gains than code context alone, while current LLMs remain far from human-level review ability. Deployed at ByteDance, ContextCRBench drives a self-evolving code review system, improving performance by 61.98% and demonstrating its robustness and industrial utility. https://github.com/kinesiatricssxilm14/ContextCRBench.
title Benchmarking LLMs for Fine-Grained Code Review with Enriched Context in Practice
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2511.07017