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 条
  • [41] Archetypes of open-source business models
    Duparc, Estelle
    Moeller, Frederik
    Jussen, Ilka
    Stachon, Maleen
    Algac, Sukran
    Otto, Boris
    ELECTRONIC MARKETS, 2022, 32 (02) : 727 - 745
  • [42] PMC-LLaMA: toward building open-source language models for medicine
    Wu, Chaoyi
    Lin, Weixiong
    Zhang, Xiaoman
    Zhang, Ya
    Xie, Weidi
    Wang, Yanfeng
    JOURNAL OF THE AMERICAN MEDICAL INFORMATICS ASSOCIATION, 2024, 31 (09) : 1833 - 1843
  • [43] Comparative Analysis of Open-Source Language Models in Summarizing Medical Text Data
    Chen, Yuhao
    Wang, Zhimu
    Zulkernine, Farhana
    2024 IEEE INTERNATIONAL CONFERENCE ON DIGITAL HEALTH, ICDH 2024, 2024, : 126 - 128
  • [44] Evaluating Large Language Models for Real-World Vulnerability Repair in C/C plus plus Code
    Zhang, Lan
    Zou, Qingtian
    Singhal, Anoop
    Sun, Xiaoyan
    Liu, Peng
    PROCEEDINGS OF THE 10TH ACM INTERNATIONAL WORKSHOP ON SECURITY AND PRIVACY ANALYTICS, IWSPA 2024, 2024, : 49 - 58
  • [45] Harnessing Large Language Models for Simulink Toolchain Testing and Developing Diverse Open-Source Corpora of Simulink Models for Metric and Evolution Analysis
    Shrestha, Sohil Lal
    PROCEEDINGS OF THE 32ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2023, 2023, : 1541 - 1545
  • [46] Claude 2.0 large language model: Tackling a real-world classification problem with a new iterative prompt engineering approach
    Caruccio, Loredana
    Cirillo, Stefano
    Polese, Giuseppe
    Solimando, Giandomenico
    Sundaramurthy, Shanmugam
    Tortora, Genoveffa
    INTELLIGENT SYSTEMS WITH APPLICATIONS, 2024, 21
  • [47] Real-world belantamab mafodotin (belamaf) 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 : S164 - S164
  • [48] PΦSS: An Open-Source Experimental Setup for Real-World Implementation of Swarm Robotic Systems in Long-Term Scenarios
    Arvin, Farshad
    Krajnik, Tomas
    Turgut, Ali Emre
    MODELLING AND SIMULATION FOR AUTONOMOUS SYSTEMS (MESAS 2018), 2019, 11472 : 351 - 364
  • [49] Real Silicon Using Open-Source EDA
    Edwards, R. Timothy
    Shalan, Mohamed
    Kassem, Mohamed
    IEEE DESIGN & TEST, 2021, 38 (02) : 38 - 44
  • [50] Open-Ethical AI: Advancements in Open-Source Human-Centric Neural Language Models
    Sicari, Sabrina
    Cevallos, Jesus F.M.
    Rizzardi, Alessandra
    Coen-Porisini, Alberto
    ACM Computing Surveys, 2024, 57 (04)