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 条
  • [21] 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
  • [22] 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
  • [23] 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
  • [24] 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
  • [25] Large language models can help to translate science into real-world impact
    Sandeep Dhakal
    Hazel Parry
    Nature, 2024, 636 (8042) : 299 - 299
  • [26] 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
  • [27] 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,
  • [28] Need of Fine-Tuned Radiology Aware Open-Source Large Language Models for Neuroradiology
    Ray, Partha Pratim
    CLINICAL NEURORADIOLOGY, 2024,
  • [29] 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
  • [30] 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,