How to Refactor this Code? An Exploratory Study on Developer-ChatGPT Refactoring Conversations
Eman Abdullah AlOmar, Anushkrishna Venkatakrishnan, Mohamed Wiem, Mkaouer, Christian D. Newman, Ali Ouni

TL;DR
This study analyzes nearly 18,000 developer-ChatGPT conversations to understand how developers communicate refactoring needs and how ChatGPT responds, revealing common patterns and prompting strategies in AI-assisted code improvement.
Contribution
It provides the first large-scale analysis of developer-ChatGPT refactoring conversations, highlighting communication patterns and implications for tool development and best practices.
Findings
Developers use both generic and specific refactoring terms.
ChatGPT responses often include explicit refactoring intentions.
Various prompting strategies influence ChatGPT's assistance in refactoring.
Abstract
Large Language Models (LLMs), like ChatGPT, have gained widespread popularity and usage in various software engineering tasks, including refactoring, testing, code review, and program comprehension. Despite recent studies delving into refactoring documentation in commit messages, issues, and code review, little is known about how developers articulate their refactoring needs when interacting with ChatGPT. In this paper, our goal is to explore conversations between developers and ChatGPT related to refactoring to better understand how developers identify areas for improvement in code and how ChatGPT addresses developers' needs. Our approach relies on text mining refactoring-related conversations from 17,913 ChatGPT prompts and responses, and investigating developers' explicit refactoring intention. Our results reveal that (1) developer-ChatGPT conversations commonly involve generic and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsArtificial Intelligence in Healthcare and Education · AI in Service Interactions · Online Learning and Analytics
