OpenAlex · Aktualisierung stündlich · Letzte Aktualisierung: 27.03.2026, 08:51

Dies ist eine Übersichtsseite mit Metadaten zu dieser wissenschaftlichen Arbeit. Der vollständige Artikel ist beim Verlag verfügbar.

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

2025·0 Zitationen
Volltext beim Verlag öffnen

0

Zitationen

7

Autoren

2025

Jahr

Abstract

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.

Ähnliche Arbeiten