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 条
  • [31] Refactoring Programs Using Large Language Models with Few-Shot Examples
    Shirafuji, Atsushi
    Oda, Yusuke
    Suzuki, Jun
    Morishita, Makoto
    Watanobe, Yutaka
    PROCEEDINGS OF THE 2023 30TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, APSEC 2023, 2023, : 151 - 160
  • [32] Large language models can help to translate science into real-world impact
    Dhakal, Sandeep
    Parry, Hazel
    NATURE, 2024, 636 (8042) : 299 - 299
  • [33] EAI-SIM: An Open-source Embodied AI Simulation Framework with Large Language Models
    Liu, Guocai
    Sun, Tao
    Li, Weihua
    Li, Xiaohui
    Liu, Xin
    Cui, Jinqiang
    2024 IEEE 18TH INTERNATIONAL CONFERENCE ON CONTROL & AUTOMATION, ICCA 2024, 2024, : 994 - 999
  • [34] Staged Multi-Strategy Framework With Open-Source Large Language Models for Natural Language to SQL Generation
    Liu, Chuanlong
    Liao, Wei
    Xu, Zhen
    IEEJ TRANSACTIONS ON ELECTRICAL AND ELECTRONIC ENGINEERING, 2025,
  • [35] Benchmarking open-source large language models on Portuguese Revalida multiple-choice questions
    Severino, Joao Victor Bruneti
    de Paula, Pedro Angelo Basei
    Berger, Matheus Nespolo
    Loures, Filipe Silveira
    Todeschini, Solano Amadori
    Roeder, Eduardo Augusto
    Veiga, Maria Han
    Guedes, Murilo
    Marques, Gustavo Lenci
    BMJ HEALTH & CARE INFORMATICS, 2025, 32 (01)
  • [36] ArcheType: A Novel Framework for Open-Source Column Type Annotation using Large Language Models
    Feuer, Benjamin
    Liu, Yurong
    Hegde, Chinmay
    Freire, Juliana
    PROCEEDINGS OF THE VLDB ENDOWMENT, 2024, 17 (09): : 2279 - 2292
  • [37] Analyzing Women's Contributions to Open-Source Software Projects based on Large Language Models
    Zhuang, Yuqian
    Zhang, Mingya
    Yang, Yiyuan
    Wang, Liang
    PROCEEDINGS OF THE 2024 27 TH INTERNATIONAL CONFERENCE ON COMPUTER SUPPORTED COOPERATIVE WORK IN DESIGN, CSCWD 2024, 2024, : 2363 - 2368
  • [38] Need of Fine-Tuned Radiology Aware Open-Source Large Language Models for Neuroradiology
    Ray, Partha Pratim
    CLINICAL NEURORADIOLOGY, 2024,
  • [39] Toponym resolution leveraging lightweight and open-source large language models and geo-knowledge
    Hu, Xuke
    Kersten, Jens
    Klan, Friederike
    Farzana, Sheikh Mastura
    INTERNATIONAL JOURNAL OF GEOGRAPHICAL INFORMATION SCIENCE, 2024,
  • [40] Viability of Open Large Language Models for Clinical Documentation in German Health Care: Real-World Model Evaluation Study
    Heilmeyer, Felix
    Boehringer, Daniel
    Reinhard, Thomas
    Arens, Sebastian
    Lyssenko, Lisa
    Haverkamp, Christian
    JMIR MEDICAL INFORMATICS, 2024, 12