Excessively long methods, loaded with multiple responsibilities, are challenging to understand, debug, reuse, and maintain. The solution lies in the widely recognized Extract Method refactoring. While the application of this refactoring is supported in modern IDEs, recommending which code fragments to extract has been the topic of many research tools. However, they often struggle to replicate real-world developer practices, resulting in recommendations that do not align with what a human developer would do in real life. To address this issue, we introduce EM-Assist, an IntelliJ IDEA plugin that uses LLMs to generate refactoring suggestions and subsequently validates, enhances, and ranks them. Finally, EM-Assist uses the IntelliJ IDE to apply the user-selected recommendation. In our extensive evaluation, when using a synthetic corpus used by other researchers, EM-Assist consistently suggests the correct refactoring among its top-5 recommendations, achieving a 60.6% recall rate, surpassing existing tools with a 52.2% recall rate. When replicating 1,615 real-world refactorings that actually took place in open-source projects, EM-Assist’s recall rate was 48.9%, compared to 23.4% for the previous best-in-class tool that relies solely on static analysis. Moreover, we conducted a usability survey with 18 industrial developers and 94.4% gave a positive rating.
The source code, datasets, and distribution of the plugin are available on GitHub (https://github.com/llm-refactoring/llm-refactoring-plugin). The plugin is available to install on JetBrains Marketplace (https://plugins.jetbrains.com/plugin/23403-llm-powered-extract-method). A demonstration video and screencast is on YouTube (https://www.youtube.com/watch?v=3E6KsHAg3js).
Thu 18 JulDisplayed time zone: Brasilia, Distrito Federal, Brazil change
16:00 - 18:00 | AI4SE 3Industry Papers / Demonstrations / Journal First at Pitomba Chair(s): Maliheh Izadi Delft University of Technology | ||
16:00 18mTalk | Rethinking Software Engineering in the Era of Foundation Models Industry Papers Ahmed E. Hassan Queen’s University, Dayi Lin Centre for Software Excellence, Huawei Canada, Gopi Krishnan Rajbahadur Centre for Software Excellence, Huawei, Canada, Keheliya Gallaba Centre for Software Excellence, Huawei Canada, Filipe Cogo Centre for Software Excellence, Huawei Canada, Boyuan Chen Centre for Software Excellence, Huawei Canada, Haoxiang Zhang Huawei, Kishanthan Thangarajah Centre for Software Excellence, Huawei Canada, Gustavo Oliva Centre for Software Excellence, Huawei Canada, Jiahuei (Justina) Lin Centre for Software Excellence, Huawei Canada, Wali Mohammad Abdullah Centre for Software Excellence, Huawei Canada, Zhen Ming (Jack) Jiang York University | ||
16:18 18mTalk | LM-PACE: Confidence Estimation by Large Language Models for Effective Root Causing of Cloud Incidents Industry Papers Shizhuo Zhang University of Illinois Urbana-Champaign, Xuchao Zhang Microsoft, Chetan Bansal Microsoft Research, Pedro Las-Casas Microsoft, Rodrigo Fonseca Microsoft Research, Saravan Rajmohan Microsoft | ||
16:36 18mTalk | Application of Quantum Extreme Learning Machines for QoS Prediction of Elevators' Software in an Industrial Context Industry Papers Xinyi Wang Simula Research Laboratory and University of Oslo, Shaukat Ali Simula Research Laboratory and Oslo Metropolitan University, Aitor Arrieta Mondragon University, Paolo Arcaini National Institute of Informatics
, Maite Arratibel Orona | ||
16:54 18mTalk | X-lifecycle Learning for Cloud Incident Management using LLMs Industry Papers Drishti Goel Microsoft, Fiza Husain Microsoft, Aditya Kumar Singh Microsoft, Supriyo Ghosh Microsoft, Anjaly Parayil Microsoft, Chetan Bansal Microsoft Research, Xuchao Zhang Microsoft, Saravan Rajmohan Microsoft Media Attached | ||
17:12 18mTalk | Neat: Mobile App Layout Similarity Comparison based on Graph Convolutional Networks Industry Papers Zhu Tao ByteDance, Yongqiang Gao ByteDance, Jiayi Qi ByteDance, Chao Peng ByteDance, China, Qinyun Wu Bytedance Ltd., Xiang Chen ByteDance, Ping Yang Bytedance Network Technology | ||
17:30 18mTalk | Transformers and Meta-Tokenization in Sentiment Analysis for Software Engineering Journal First Nathan Cassee Eindhoven University of Technology, Andrei Agaronian Eindhoven University of Technology, Eleni Constantinou University of Cyprus, Nicole Novielli University of Bari, Alexander Serebrenik Eindhoven University of Technology | ||
17:48 9mTalk | EM-Assist: Safe automated ExtractMethod refactoring with LLMs Demonstrations Dorin Pomian University of Colorado Boulder, Abhiram Bellur University of Colorado Boulder, Malinda Dilhara University of Colorado Boulder, Zarina Kurbatova JetBrains Research, Egor Bogomolov JetBrains Research, Andrey Sokolov JetBrains Research, Timofey Bryksin JetBrains Research, Danny Dig University of Colorado Boulder, JetBrains Research Pre-print |