arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2509.08090cs.SE
收藏

ChatGPT 用于代码重构:分析主题、交互与有效提示

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

AI总结:

本文通过文本挖掘 29,778 条 ChatGPT 交互中的 715 条重构相关对话,分析开发者表达重构需求的方式及 ChatGPT 的回应,以理解重构交互并提升提示有效性。

摘要:

大型语言模型(LLMs),如 ChatGPT,已在各种软件工程任务中广泛流行并被广泛使用,例如重构、测试、代码审查和程序理解。尽管近期研究考察了 LLMs 在推荐和提出重构建议方面的有效性,但对开发者在与 ChatGPT 交互时如何表达其重构需求的理解仍然有限。在本文中,我们的目标是探索开发者与 ChatGPT 之间与重构相关的交互,以更好地理解开发者如何识别代码中需要改进的领域,以及 ChatGPT 如何满足开发者的需求。我们的方法包括从 29,778 条 ChatGPT 提示和响应中文本挖掘 715 条与重构相关的交互,并分析开发者的显式重构意图。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑