Iterative Refactoring of Real-World Open-Source Programs with Large Language Models

被引:0
|
作者
Choi, Jinsu [1 ]
An, Gabin [1 ]
Yoo, Shin [1 ]
机构
[1] Korea Adv Inst Sci & Technol, Daejeon, South Korea
来源
SEARCH-BASED SOFTWARE ENGINEERING, SSBSE 2024 | 2024年 / 14767卷
关键词
Code Refactoring; Large Language Model; Cyclomatic Complexity;
D O I
10.1007/978-3-031-64573-0_4
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Code refactoring is a critical task for improving software quality, but it is traditionally a manual, time-consuming process. This paper demonstrates an approach to automate project-level code refactoring using Large Language Models (LLMs). The key idea is to iteratively identify methods with high cyclomatic complexity, and then use LLMs to generate refactored implementations that reduce complexity. Our evaluation using 17 open-source projects shows that the proposed automated refactoring can reduce average cyclomatic complexity by up to 10.4% within 20 iterations. These results suggest that automated project-level code refactoring is feasible using LLMs with tailored prompts.
引用
收藏
页码:49 / 55
页数:7
相关论文
共 50 条
  • [41] Glucose Variability Analysis in Two Large-Scale and Real-World Data Sets of Open-Source Automated Insulin Delivery Systems
    Cooper, Drew
    Reinhold, Bernd
    Shahid, Arsalan
    Lewis, Dana M.
    JOURNAL OF DIABETES SCIENCE AND TECHNOLOGY, 2023,
  • [42] Open-source Large Language Models are Strong Zero-shot Query Likelihood Models for Document Ranking
    Zhuang, Shengyao
    Liu, Bing
    Koopman, Bevan
    Zuccon, Guido
    FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS (EMNLP 2023), 2023, : 8807 - 8817
  • [43] Energetic Impacts of Autonomous Vehicles in Real-World Traffic Conditions From Nine Open-Source Datasets
    Huang, Jianchang
    Song, Guohua
    He, Feng
    Tan, Zhe
    IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, 2023, 24 (09) : 9901 - 9914
  • [44] Refactoring Test Smells: A Perspective from Open-Source Developers
    Soares, Elvys
    Ribeiro, Marcio
    Amaral, Guilherme
    Gheyi, Rohit
    Fernandes, Leo
    Garcia, Alessandro
    Fonseca, Baldoino
    Santos, Andre
    PROCEEDINGS OF THE 5TH BRAZILIAN SYMPOSIUM ON SYSTEMATIC AND AUTOMATED SOFTWARE TESTING, SAST 2020, 2020, : 50 - 59
  • [45] From general to specific: Tailoring large language models for real-world medical communications
    Sun, Xinti
    Tang, Wenjun
    Huang, Zigeng
    Long, Erping
    Wan, Peixing
    CLINICAL AND TRANSLATIONAL MEDICINE, 2025, 15 (01):
  • [46] Open-Source Large Language Models in Anesthesia Perioperative Medicine: ASA-Physical Status Evaluation
    Rouholiman, Dara
    Goodell, Alex J.
    Fung, Ethan
    Chandrasoma, Janak T.
    Chu, Larry F.
    ANESTHESIA AND ANALGESIA, 2024, 139 (06): : 2779 - 2781
  • [47] Enhancing Commit Message Categorization in Open-Source Repositories Using Structured Taxonomy and Large Language Models
    Al-razgan, Muna
    Alaqil, Manal
    Almuwayshir, Ruba
    Alhijji, Zamzam
    ADVANCES IN ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING, 2024, 4 (04): : 2950 - 2968
  • [48] An Efficient Workflow for Representing Real-world Urban Environments in Game Engines using Open-source Software and Data
    Badr, Arash Shahbaz
    De Amicis, Raffaele
    GRAPP: PROCEEDINGS OF THE 17TH INTERNATIONAL JOINT CONFERENCE ON COMPUTER VISION, IMAGING AND COMPUTER GRAPHICS THEORY AND APPLICATIONS - VOL 1: GRAPP, 2022, : 103 - 114
  • [49] dacl1k: Real-world bridge damage dataset putting open-source data to the test
    Flotzinger, Johannes
    Roesch, Philipp J.
    Oswald, Norbert
    Braml, Thomas
    ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE, 2024, 137
  • [50] TeenyTinyLlama: Open-source tiny language models trained in Brazilian Portuguese
    Correa, Nicholas Kluge
    Falk, Sophia
    Fatimah, Shiza
    Sen, Aniket
    De Oliveira, Nythamar
    MACHINE LEARNING WITH APPLICATIONS, 2024, 16