Copilot-in-the-Loop: Fixing Code Smells in Copilot-Generated Python Code using Copilot
As one of the most popular dynamic languages, Python experiences a decrease in readability and maintainability when code smells are present. Recent advancements in Large Language Models have sparked growing interest in AI-enabled tools for both code generation and refactoring. GitHub Copilot is one such tool that has gained widespread usage. Copilot Chat, released in September 2023, functions as an interactive tool aimed at facilitating natural language-powered coding. However, limited attention has been given to understanding code smells in Copilot-generated Python code and Copilot Chat’s ability to fix the code smells. To this end, we built a dataset comprising 102 code smells in Copilot-generated Python code. Our aim is to first explore the occurrence of code smells in Copilot-generated Python code and then evaluate the effectiveness of Copilot Chat in fixing these code smells employing different prompts. The results show that 8 out of 10 types of code smells can be detected in Copilot-generated Python code, among which Multiply-Nested Container is the most common one. For these code smells, Copilot Chat achieves a highest fixing rate of 87.1%, showing promise in fixing Python code smells generated by Copilot itself. In addition, the effectiveness of Copilot Chat in fixing these smells can be improved by providing more detailed prompts.
Thu 31 OctDisplayed time zone: Pacific Time (US & Canada) change
15:30 - 16:30 | |||
15:30 15mTalk | iSMELL: Assembling LLMs with Expert Toolsets for Code Smell Detection and Refactoring Research Papers Di Wu , Fangwen Mu Institute of Software, Chinese Academy of Sciences, Lin Shi Beihang University, Zhaoqiang Guo Software Engineering Application Technology Lab, Huawei, China, Kui Liu Huawei, Weiguang Zhuang Beihang University, Yuqi Zhong Beihang University, Li Zhang Beihang University | ||
15:45 15mTalk | A Position-Aware Approach to Decomposing God Classes Research Papers Tianyi Chen Beijing Institute of Technology, Yanjie Jiang Peking University, Fu Fan Beijing Institute of Technology, Bo Liu Beijing Institute of Technology, Hui Liu Beijing Institute of Technology | ||
16:00 15mTalk | Three Heads Are Better Than One: Suggesting Move Method Refactoring Opportunities with Inter-class Code Entity Dependency Enhanced Hybrid Hypergraph Neural Network Research Papers Di Cui Xidian University, Jiaqi Wang Xidian University, Qiangqiang Wang Xidian University, Peng Ji Xidian University, Minglang Qiao Xidian University, Yutong Zhao University of Central Missouri, Jingzhao Hu Xidian University, Luqiao Wang Xidian University, Qingshan Li Xidian University | ||
16:15 10mTalk | Copilot-in-the-Loop: Fixing Code Smells in Copilot-Generated Python Code using Copilot NIER Track Beiqi Zhang Wuhan University, Peng Liang Wuhan University, China, Qiong Feng Nanjing University of Science and Technology, Yujia Fu Wuhan University, Zengyang Li Central China Normal University DOI Pre-print |