An Empirical Study on Leveraging LLMs for Metamodels and Code Co-evolution

被引:0
|
作者
Kebaili, Zohra Kaouter [1 ]
Khelladi, Djamel Eddine [1 ]
Acher, Mathieu [2 ]
Barais, Olivier [3 ]
机构
[1] Univ Rennes, CNRS, IRISA, INRIA, Rennes, France
[2] INSA Rennes, IUF, IRISA, INRIA, Rennes, France
[3] Univ Rennes, INRIA, IRISA, Rennes, France
来源
JOURNAL OF OBJECT TECHNOLOGY | 2024年 / 23卷 / 03期
关键词
Metemodel evolution; code evolution; LLM; chatgpt; coevolution; prompt engineering; DETECTING COMPLEX CHANGES;
D O I
10.5381/jot.2024.23.3.a6
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Metamodels play an important role in MDE and in specifying a software language. They are cornerstone to generate other artifacts of lower abstraction level, such as code. Developers then enrich the generated code to build their language services and tooling, e.g., editors, and checkers. When a metamodel evolves, part of the code is regenerated and all the additional developers' code can be impacted. Thus, requiring erroneous code to be co-evolved accordingly. In this paper, we explore a novel approach to mitigate the challenge of metamodel evolution impacts on the code using LLMs. In fact LLMs stand as promising tools for tackling increasingly complex problems and support developers in various tasks of writing, correcting and documenting source code, models, and other artifacts. However, while there is an extensive empirical assessment of the LLMs capabilities in generating models, code and tests, there is a lack of work on their ability to support their maintenance. In this paper, we focus on the particular problem of metamodels and code co-evolution. We first designed a prompt template structure that contains contextual information about metamodel changes, the abstraction gap between the metamodel and the code, and the erroneous code to co-evolve. To investigate the usefulness of this template, we generated three more variations of the prompts. The generated prompts are then given to the LLM to co-evolve the impacted code. We evaluated our generated prompts and other three of their variations with ChatGPT version 3.5 on seven Eclipse projects from OCL and Modisco evolved metamodels. Results show that ChatGPT can co-evolve correctly 88.7 % of the errors due to metamodel evolution, varying from 75% to 100% of correctness rate. When varying the prompts, we observed increased correctness in two variants and decreased correctness in another variant. We also observed that varying the temperature hyperparameter yields better results with lower temperatures. Our results are observed on a total of 5320 generated prompts. Finally, when compared to the quick fixes of the IDE, the generated prompts co-evolutions completely outperform the quick fixes.
引用
收藏
页码:1 / 14
页数:14
相关论文
共 50 条
  • [1] Co-evolution of Infrastructure and Source Code - An Empirical Study
    Jiang, Yujuan
    Adams, Bram
    [J]. 12TH WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR 2015), 2015, : 45 - 55
  • [2] On the Co-evolution of ML Pipelines and Source Code - Empirical Study of DVC Projects
    Barrak, Amine
    Eghan, Ellis E.
    Adams, Bram
    [J]. 2021 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2021), 2021, : 422 - 433
  • [3] Approaches to Co-Evolution of Metamodels and Models: A Survey
    Hebig, Regina
    Khelladi, Djamel Eddine
    Bendraou, Reda
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2017, 43 (05) : 396 - 414
  • [4] Towards Models and Metamodels Co-Evolution Approach
    Anguel, Fouzia
    Amirat, Abdelkrim
    Bounour, Nora
    [J]. 2013 11TH INTERNATIONAL SYMPOSIUM ON PROGRAMMING AND SYSTEMS (ISPS), 2013, : 163 - 167
  • [5] Towards Leveraging Tests to Identify Impacts of Metamodel and Code Co-evolution
    Kebaili, Zohra Kaouter
    Khelladi, Djamel Eddine
    Acher, Mathieu
    Barais, Olivier
    [J]. INTELLIGENT INFORMATION SYSTEMS, CAISE FORUM 2023, 2023, 477 : 129 - 137
  • [6] Leveraging Code-Test Co-evolution Patterns for Automated Test Case Recommendation
    Shimmi, Samiha
    Rahimi, Mona
    [J]. 3RD ACM/IEEE INTERNATIONAL CONFERENCE ON AUTOMATION OF SOFTWARE TEST (AST 2022), 2022, : 65 - 76
  • [7] Co-evolution of metamodels and models through consistent change propagation
    Demuth, Andreas
    Riedl-Ehrenleitner, Markus
    Lopez-Herrejon, Roberto E.
    Egyed, Alexander
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2016, 111 : 281 - 297
  • [8] An Empirical Study of the Co-Evolution of Utility and Predictive Ability
    Korb, Kevin B.
    Brumley, Lachlan
    Kopp, Carlo
    [J]. 2016 IEEE CONGRESS ON EVOLUTIONARY COMPUTATION (CEC), 2016, : 703 - 710
  • [9] CO-EVOLUTION THEORY OF GENETIC CODE
    WONG, JTF
    [J]. PROCEEDINGS OF THE NATIONAL ACADEMY OF SCIENCES OF THE UNITED STATES OF AMERICA, 1975, 72 (05) : 1909 - 1912
  • [10] Supporting the Co-evolution of Metamodels and Constraints through Incremental Constraint Management
    Demuth, Andreas
    Lopez-Herrejon, Roberto E.
    Egyed, Alexander
    [J]. MODEL-DRIVEN ENGINEERING LANGUAGES AND SYSTEMS, 2013, 8107 : 287 - 303