Passer à la navigation principale Passer à la recherche Passer au contenu principal

ChatGPT for Code Refactoring: Analyzing Topics, Interaction, and Effective Prompts

  • Eman Abdullah Alomar
  • , Luo Xu
  • , Sofia Martinez
  • , Anthony Peruma
  • , Mohamed Wiem Mkaouer
  • , Christian D. Newman
  • , Ali Ouni

Résultats de recherche: Chapitre dans un livre, rapport, actes de conférenceParticipation à un ouvrage collectif lié à un colloque ou une conférenceRevue par des pairs

1 Citation (Scopus)

Résumé

Large Language Models (LLMs), such as ChatGPT, have become widely popular and widely used in various software engineering tasks such as refactoring, testing, code review, and program comprehension. Although recent studies have examined the effectiveness of LLMs in recommending and suggesting refactoring, there is a limited understanding of how developers express their refactoring needs when interacting with ChatGPT. In this paper, our goal is to explore interactions related to refactoring between developers and ChatGPT to better understand how developers identify areas for improvement in code, and how ChatGPT addresses developers' needs. Our approach involves text mining 715 refactoring-related interactions from 29,778 ChatGPT prompts and responses, as well as the analysis of developers' explicit refactoring intentions. Our results reveal that (1) refactoring interactions between developers and ChatGPT encompass 25 themes including 'Quality', 'Objective', 'Testing', and 'Design', (2) ChatGPT's use of affirmation phrases such as 'certainly' regarding refactoring decisions, and apology phrases such as 'apologize' when resolving refactoring challenges, and (3) our refactoring prompt template enables developers to obtain concise, accurate, and satisfactory responses with minimal interactions. We envision our results enhancing researchers and practitioners understanding of how developers interact with LLMs during code refactoring.

langue originaleAnglais
titreProceedings - 2025 IEEE International Conference on Collaborative Advances in Software and Computing, CASCON 2025
rédacteurs en chefHausi A. Muller, Ying Zou, Jeremy Bradbury, Eleni Stroulia
EditeurInstitute of Electrical and Electronics Engineers Inc.
Pages389-398
Nombre de pages10
ISBN (Electronique)9798331599485
Les DOIs
étatPublié - 2025
Modification externeOui
Evénement35th IEEE International Conference on Collaborative Advances in Software and Computing, CASCON 2025 - Toronto, Canada
Durée: 10 nov. 202513 nov. 2025

Série de publications

NomProceedings - 2025 IEEE International Conference on Collaborative Advances in Software and Computing, CASCON 2025

Conférence

Conférence35th IEEE International Conference on Collaborative Advances in Software and Computing, CASCON 2025
Pays/TerritoireCanada
La villeToronto
période10/11/2513/11/25

Empreinte digitale

Voici les principaux termes ou expressions associés à « ChatGPT for Code Refactoring: Analyzing Topics, Interaction, and Effective Prompts ». Ces libellés thématiques sont générés à partir du titre et du résumé de la publication. Ensemble, ils forment une empreinte digitale unique.

Contient cette citation