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 条
  • [21] Automatic structuring of radiology reports with on-premise open-source large language models
    Woznicki, Piotr
    Laqua, Caroline
    Fiku, Ina
    Hekalo, Amar
    Truhn, Daniel
    Engelhardt, Sandy
    Kather, Jakob
    Foersch, Sebastian
    D'Antonoli, Tugba Akinci
    dos Santos, Daniel Pinto
    Baessler, Bettina
    Laqua, Fabian Christopher
    EUROPEAN RADIOLOGY, 2025, 35 (04) : 2018 - 2029
  • [22] Enhancing Code Security Through Open-Source Large Language Models: A Comparative Study
    Ridley, Norah
    Branca, Enrico
    Kimber, Jadyn
    Stakhanova, Natalia
    FOUNDATIONS AND PRACTICE OF SECURITY, PT I, FPS 2023, 2024, 14551 : 233 - 249
  • [23] Evaluation of Open-Source Large Language Models for Metal-Organic Frameworks Research
    Bai, Xuefeng
    Xie, Yabo
    Zhang, Xin
    Han, Honggui
    Li, Jian-Rong
    JOURNAL OF CHEMICAL INFORMATION AND MODELING, 2024, 64 (13) : 4958 - 4965
  • [24] Fine-Tuning and Evaluating Open-Source Large Language Models for the Army Domain
    Ruiz, Maj Daniel C.
    Sell, John
    arXiv,
  • [25] Comparing Commercial and Open-Source Large Language Models for Labeling Chest Radiograph Reports
    Dorfner, Felix J.
    Juergensen, Liv
    Donle, Leonhard
    Al Mohamad, Fares
    Bodenmann, Tobias R.
    Cleveland, Mason C.
    Busch, Felix
    Adams, Lisa C.
    Sato, James
    Schultz, Thomas
    Kim, Albert E.
    Merkow, Jameson
    Bressem, Keno K.
    Bridge, Christopher P.
    RADIOLOGY, 2024, 313 (01)
  • [26] Comparing ICP variants on real-world data sets: Open-source library and experimental protocol
    Pomerleau F.
    Colas F.
    Siegwart R.
    Magnenat S.
    Autonomous Robots, 2013, 34 (3) : 133 - 148
  • [27] Demonstrating COLIBRI VR, an Open-Source Toolkit to Render Real-World Scenes in Virtual Reality
    de Dinechin, Gregoire Dupont
    Paljic, Alexis
    2020 IEEE CONFERENCE ON VIRTUAL REALITY AND 3D USER INTERFACES WORKSHOPS (VRW 2020), 2020, : 845 - 846
  • [28] A Path to Real-World Evidence in Critical Care Using Open-Source Data Harmonization Tools
    Heavner, Smith F.
    Anderson, Wesley
    Kashyap, Rahul
    Dasher, Pamela
    Mathe, Ewy A.
    Merson, Laura
    Guerin, Philippe J.
    Weaver, Jeff
    Robinson, Matthew
    Schito, Marco
    Kumar, Vishakha K.
    Nagy, Paul
    CRITICAL CARE EXPLORATIONS, 2023, 5 (04) : E0893
  • [29] Illustrating COLIBRI VR, an Open-Source Toolkit to Render Real-World Scenes in Virtual Reality
    de Dinechin, Gregoire Dupont
    Paljic, Alexis
    2020 IEEE CONFERENCE ON VIRTUAL REALITY AND 3D USER INTERFACES WORKSHOPS (VRW 2020), 2020, : 857 - 857
  • [30] Presenting COLIBRI VR, an Open-Source Toolkit to Render Real-World Scenes in Virtual Reality
    de Dinechin, Gregoire Dupont
    Paljic, Alexis
    2020 IEEE CONFERENCE ON VIRTUAL REALITY AND 3D USER INTERFACES WORKSHOPS (VRW 2020), 2020, : 801 - 802