Code review is an important practice in software development, yet it is time-consuming and requires substantial effort. While open-source datasets have been used to train neural models for automating code review tasks, including review comment generation, these datasets contain a significant amount of noisy comments (e.g., vague or non-actionable feedback) that persist despite cleaning methods using heuristics and machine learning approaches. Such remaining noise may lead models to generate low-quality review comments, yet removing them requires a complex semantic understanding of both code changes and natural language comments. In this paper, we investigate the impact of such noise on review comment generation and propose a novel approach using large language models (LLMs) to further clean these datasets. Based on an empirical study on a large-scale code review dataset, our LLM-based approach achieves 66-85% precision in detecting valid comments. Using the predicted valid comments to fine-tune the state-of-the-art code review models (cleaned models) can generate review comments that are 13.0% - 12.4% more similar to valid human-written comments than the original models. We also find that the cleaned models can generate more informative and relevant comments than the original models. Our findings underscore the critical impact of dataset quality on the performance of review comment generation. We advocate for further research into cleaning training data to enhance the practical utility and quality of automated code review.
Does AI Code Review Lead to Code Changes? A Case Study of GitHub Actions
State Key Lab for Novel Software Technology, Nanjing University(南京大学 novel software technology 国家重点实验室);University of Heidelberg(海德堡大学);School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算与信息学院)
CupCleaner: A Hybrid Data Cleaning Approach for Comment Updating
Key Laboratory of High Confidence Software Technologies (Peking University), Ministry of Education(教育部高可信软件技术重点实验室);School of Computer Science, Peking University(北京大学计算机学院);National Key Laboratory of Space Integrated Information System, Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所空间信息系统国家重点实验室)
Department of Computer Science and Engineering, University of Notre Dame(计算机科学与工程系,诺丁汉大学);Division of Computer Science and Engineering, Louisiana State University(计算机科学与工程分校,路易斯安那州立大学);Department of Computer Science, Vanderbilt University(计算机科学系,范德比大学)