arrow
Return

Refactoring Object-Oriented Software With ChatGPT: An Empirical Study

delete2026-01-01
delete0
delete
OA
AI
A
Abdulsalam, Hanady M. *
A
Alawadhi, Ranya
A
Ali, Bader A.
A
Alkandari, Aisha A.
A
Al Dallal, Jehad
DOI:10.1049/sfw2/3348017delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Generative AI (GenAI) is currently being utilized in many tasks to improve their quality. Because GenAI tools are highly qualified in text-based applications, they have the potential to automate tasks across the software engineering lifecycle. In this study, we empirically investigate ChatGPT's ability to perform code refactoring tasks. Considering five widely employed refactoring scenarios, we propose testing scenarios upon which we derive 200 test cases for five Java open-source applications. These test cases are applied using ChatGPT and NetBeans, and the results are compared and evaluated. To enable ChatGPT to perform refactoring, we follow prompt engineering approaches to design effective prompts. The results show that ChatGPT has generated refactored pieces of code, which have been successfully compiled for 88% of the test cases. However, it has correctly performed the intended refactoring for only 29% of the cases, compared to NetBeans, which has achieved a 67% correctness rate. These findings indicate that although ChatGPT has some potential to contribute to code refactoring tasks, it is not yet ready to be used as a fully automated refactoring tool for large-scale real-world applications. Its outputs still require human oversight to improve the refactored code's correctness.
Keywords:
ChatGPT
generative AI
object oriented
prompt engineering
refactoring
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

I
IET Software
IF:
1.3
Papers:
21
Citations:
654

Organization

G
gulf university for science & technology (gust)
Scholars:
400
Papers: 501
Citations: 0
K
Kuwait University
Scholars:
4.2K
Papers: 3.8K
Citations: 2.7K
Cited Papers

Cited Papers

Generative AI for Software Development: A Family of Studies on Code Generation
err2024-01-01
err0
PREAI
errDakhel,Arghavan Moradi; Nikanjam,Amin; Khomh,Foutse; Desmarais,Michel C.; Washizaki,Hironori
errShare
errSave
The Effectiveness of Supervised Machine Learning Algorithms in Predicting Software Refactoring
err2022-04-01
err40
errOAAI
errAniche, Mauricio; Maziero, Erick; Durelli, Rafael; Durelli, Vinicius H. S.
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
Program Code Generation with Generative AIs
err2024-01-31
err0
errOAAI
errBaskhad Idrisov; Tim Schlippe
errShare
errSave
Generative Artificial Intelligence for Software Engineering—A Research Agenda
err2025-07-29
err0
PREAI
errAnh Nguyen-Duc; Beatriz Cabrero-Daniel; Adam Przybylek; Chetan Arora; Dron Khanna; Tomas Herda; Usman Rafiq; Jorge Melegati; Eduardo Guerra; Kai-Kristian Kemell; Mika Saari; Zheying Zhang; Huy Le; Tho Quan; Pekka Abrahamsson
errShare
errSave
A machine learning approach to software model refactoring
err2020-01-08
err0
PREAI
errBrahmaleen Kaur Sidhu; Kawaljeet Singh; Neeraj Sharma
errShare
errSave
Toward Understanding the Impact of Refactoring on Program Comprehension
err2022-03-01
err0
errOAAI
errGiulia Sellitto; Emanuele Iannone; Zadia Codabux; Valentina Lenarduzzi; Andrea De Lucia; Fabio Palomba; Filomena Ferrucci
errShare
errSave
researcher View more