PreprintCited by 140Software Engineering ResearchSoftware Engineering Techniques and PracticesSoftware Testing and Debugging Techniques

The DOI matches its DataCite record.

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

Open access

Abstract

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.

Overview

Integrity signals

Registry

DataCite · 10.48550/arxiv.2309.08221

Cites

Statistics

Recomputing p-values needs the paper’s full text.

Verification

Claims the paper makes

We couldn’t retrieve this paper’s full text, so its claims and self-check weren’t run. The registry and citation checks still apply.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • The study uses the taxonomy of code changes proposed in prior studies as a starting point and refines it based on observation.

    “We use the taxonomy of code changes proposed in prior studies [21, 74] as a starting point and refine the taxonomy based on our observation.”
  • ChatGPT is the most widely adopted LLM in code generation in the literature.

    “ChatGPT is the most widely adopted LLM in code generation in the literature [15, 16, 23, 40, 42, 63, 70]”

Citations

Cited by

Sorted by citations

Metadata

Authors
Guo, Q., Cao, J., Xie, X., Liu, S., Li, X., Chen, B., & Peng, X.
Affiliations
  • Tianjin University (CN)
  • Fudan University (CN)
  • Singapore Management University (SG)
  • Nanyang Technological University (SG)
Venue
arXiv
Publisher
arXiv
Published
2023
Pages
1-13
ISSN
0270-5257 (ISSN-L)
OpenAlex
W4391558404
Cited by
140
References
0
Citations by year
2026: 33 · 2025: 66 · 2024: 40 · 2023: 1
FWCI
52.81
Type
conference paper
Language
en
Open access
Locations
  • ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) (publishedVersion)
  • arXiv (Cornell University) (submittedVersion, cc-by)
  • Singapore Management University Institutional Knowledge (InK) (Singapore Management University) (submittedVersion, cc-by-nc-nd)
  • arXiv (Cornell University) (cc-by)
Funders
  • National Research Foundation
  • National Research Foundation Singapore (NCRP25- P04-TAICeN)
  • National Natural Science Foundation of China (61872262)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Techniques and Practices
  • Physical Sciences › Computer Science › Software › Software Testing and Debugging Techniques
Keywords
ChatGPT, automated code review, program refinement, large language models, software maintainability, code quality

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review