Evaluating the Effectiveness of ChatGPT in Improving Code Quality

  • Shanal Divyansh
  • , Pranjal Apoorva
  • , Suraj Sanjay Singh
  • , Anita Ershadi
  • , Hiral Makwana
  • , Eman Abdullah Alomar

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Code refactoring is a crucial process in software development that helps improve the quality and maintainability of code without changing its functionality. Although code refactoring is widely recognized as an essential practice, measuring its impact on code quality is challenging. This paper investigates the impact of ChatGPT, on code quality. The study focuses on four key metrics: cyclomatic complexity, cognitive complexity, code smells, and time debt, using Sonarqube to assess code quality and identify potential issues. The original dataset of Python code is compared with the refactored dataset to evaluate the effectiveness of ChatGPT in improving code quality. The results demonstrate that ChatGPT's refactoring efforts have led to improvements in the quality of the codebase. The refactored code exhibited lower complexity values, fewer code smells, and reduced time debt, highlighting ChatGPT's success in addressing significant issues that can cause system failures and performance issues. The study emphasizes the potential benefits of using ChatGPT for code refactoring, which can significantly benefit software development efforts by improving code quality and reducing development time.

Original languageEnglish
Title of host publication2025 IEEE 4th International Conference on Computing and Machine Intelligence, ICMI 2025 - Proceedings
EditorsAhmed Abdelgawad, Akhtar Jamil, Alaa Ali Hameed
ISBN (Electronic)9798331509132
DOIs
StatePublished - 2025
Event4th IEEE International Conference on Computing and Machine Intelligence, ICMI 2025 - Michigan, United States
Duration: 5 Apr 20256 Apr 2025

Publication series

Name2025 IEEE 4th International Conference on Computing and Machine Intelligence, ICMI 2025 - Proceedings

Conference

Conference4th IEEE International Conference on Computing and Machine Intelligence, ICMI 2025
Country/TerritoryUnited States
CityMichigan
Period5/04/256/04/25

Keywords

  • ChatGPT
  • LLMs
  • quality

Fingerprint

Dive into the research topics of 'Evaluating the Effectiveness of ChatGPT in Improving Code Quality'. Together they form a unique fingerprint.

Cite this