Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study

09/15/2023
by   Qi Guo, et al.
0

Code review is an essential activity for ensuring the quality and maintainability of software projects. However, it is a time-consuming and often error-prone task that can significantly impact the development process. Recently, ChatGPT, a cutting-edge language model, has demonstrated impressive performance in various natural language processing tasks, suggesting its potential to automate code review processes. However, it is still unclear how well ChatGPT performs in code review tasks. To fill this gap, in this paper, we conduct the first empirical study to understand the capabilities of ChatGPT in code review tasks, specifically focusing on automated code refinement based on given code reviews. To conduct the study, we select the existing benchmark CodeReview and construct a new code review dataset with high quality. We use CodeReviewer, a state-of-the-art code review tool, as a baseline for comparison with ChatGPT. Our results show that ChatGPT outperforms CodeReviewer in code refinement tasks. Specifically, our results show that ChatGPT achieves higher EM and BLEU scores of 22.78 and 76.44 respectively, while the state-of-the-art method achieves only 15.50 and 62.88 on a high-quality code review dataset. We further identify the root causes for ChatGPT's underperformance and propose several strategies to mitigate these challenges. Our study provides insights into the potential of ChatGPT in automating the code review process, and highlights the potential research directions.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/17/2022

CodeReviewer: Pre-Training for Automating Code Review Activities

Code review is an essential part to software development lifecycle since...
research
07/24/2022

Example Driven Code Review Explanation

Background: Code reviewing is an essential part of software development ...
research
03/13/2023

Generation-based Code Review Automation: How Far Are We?

Code review is an effective software quality assurance activity; however...
research
09/06/2023

Unity is Strength: Cross-Task Knowledge Distillation to Improve Code Review Generation

Code review is a fundamental process in software development that plays ...
research
03/14/2022

The Unexplored Treasure Trove of Phabricator Code Review

Phabricator is a modern code collaboration tool used by popular projects...
research
04/11/2023

Evaluating AIGC Detectors on Code Content

Artificial Intelligence Generated Content (AIGC) has garnered considerab...
research
05/06/2023

Refining the Responses of LLMs by Themselves

In this paper, we propose a simple yet efficient approach based on promp...

Please sign up or login with your details

Forgot password? Click here to reset