Yayın:
Context-Aware Code Review Automation: A Retrieval-Augmented Approach

dc.contributor.authorIcoz, Busra
dc.contributor.authorBiricik, Goksel
dc.date.accessioned2026-06-27T15:30:39Z
dc.date.issued2026
dc.description.abstractManual code review is essential for software quality, but often slows down development cycles due to the high time demands on developers. In this study, we propose an automated solution for Python (version 3.13) projects that generates code review comments by combining Large Language Models (LLMs) with Retrieval-Augmented Generation (RAG). To achieve this, we first curated a dataset from GitHub pull requests (PRs) using the GitHub REST Application Programming Interface (API) (version 2022-11-28) and classified comments into semantic categories using a semi-supervised Support Vector Machine (SVM) model. During the review process, our system uses a vector database to retrieve the top-k most relevant historical comments, providing context for a diverse spectrum of open-weights LLMs, including DeepSeek-Coder-33B, Qwen2.5-Coder-32B, Codestral-22B, CodeLlama-13B, Mistral-Instruct-7B, and Phi-3-Mini. We evaluated the system using a multi-step validation that combined standard metrics (BLEU-4, ROUGE-L, cosine similarity) with an LLM-as-a-Judge approach, and verified the results through targeted human review to ensure consistency with expert standards. The findings show that retrieval augmentation improves feedback relevance for larger models, with DeepSeek-Coder's alignment score increasing by 17.9% at a retrieval depth of k = 3. In contrast, smaller models such as Phi-3-Mini suffered from context collapse, where too much context reduced accuracy. To manage this trade-off, we built a hybrid expert system that routes each task to the most suitable model. Our results indicate that the proposed approach improved performance by 13.2% compared to the zero-shot baseline (k = 0). In addition, our proposed system reduces hallucinations and generates comments that closely align with the standards expected from the experts.en
dc.description.urihttps://doi.org/10.3390/app16041875
dc.identifier.doi10.3390/app16041875
dc.identifier.eissn2076-3417
dc.identifier.issue4
dc.identifier.urihttps://hdl.handle.net/20.500.14981/71355
dc.identifier.volume16
dc.identifier.wos001699831000001
dc.language.isoeng
dc.publisherMDPI
dc.relation.ispartofAPPLIED SCIENCES-BASEL
dc.rightsopenAccess
dc.subjectcode review
dc.subjectcode review automation
dc.subjectLarge Language Models (LLMs)
dc.subjectRetrieval-Augmented Generation (RAG)
dc.subjectsoftware automation
dc.subjectsemi-supervised learning
dc.subjectAGREEMENT
dc.subjectChemistry
dc.subjectEngineering
dc.subjectMaterials Science
dc.subjectPhysics
dc.titleContext-Aware Code Review Automation: A Retrieval-Augmented Approach
dc.typeArticle
dspace.entity.typePublication
local.import.sourceWOS

Dosyalar

Koleksiyonlar