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
关键词
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 条
  • [31] 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
  • [32] 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
  • [33] 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
  • [34] 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
  • [35] 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
  • [36] OPEN-SOURCE LANGUAGE AI CHALLENGES BIG TECH'S MODELS
    Gibney, Elizabeth
    NATURE, 2022, 606 (7916) : 850 - 851
  • [37] Open-source language AI challenges big tech’s models
    Elizabeth Gibney
    Nature, 2022, 606 : 850 - 851
  • [38] Real-World Belantamab Mafodotin Use: A US Retrospective Longitudinal Pharmacy and Medical Open-Source Claims Database Assessment
    Boytsov, Natalie
    Stockl, Karen M.
    Mackay, Christine
    Wang, Peter Feng
    Sun, Kainan
    Chen, Chi-Chang
    Doherty, Allison
    CLINICAL LYMPHOMA MYELOMA & LEUKEMIA, 2022, 22 : S422 - S422
  • [39] RTLLM: An Open-Source Benchmark for Design RTL Generation with Large Language Model
    Lu, Yao
    Liu, Shang
    Zhang, Qijun
    Xie, Zhiyao
    29TH ASIA AND SOUTH PACIFIC DESIGN AUTOMATION CONFERENCE, ASP-DAC 2024, 2024, : 722 - 727
  • [40] Archetypes of open-source business models
    Estelle Duparc
    Frederik Möller
    Ilka Jussen
    Maleen Stachon
    Sükran Algac
    Boris Otto
    Electronic Markets, 2022, 32 : 727 - 745