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 条
  • [31] Co-Evolving Code with Evolving Metamodels
    Khelladi, Djamel Eddine
    Combemale, Benoit
    Acher, Mathieu
    Barais, Olivier
    Jezequel, Jean-Marc
    [J]. 2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2020), 2020, : 1496 - 1508
  • [32] The dynamic mechanism and empirical study on distribution and manufacturing sector co-evolution: Evidence from China
    He, Yongda
    [J]. International Journal of u- and e- Service, Science and Technology, 2014, 7 (05) : 317 - 328
  • [33] Understanding component co-evolution with a study on Linux
    Liguo Yu
    [J]. Empirical Software Engineering, 2007, 12 : 123 - 141
  • [34] The Co-evolution of Proximities - A Network Level Study
    Broekel, Tom
    [J]. REGIONAL STUDIES, 2015, 49 (06) : 921 - 935
  • [35] Co-evolution of conventions and networks: An experimental study
    Corten, Rense
    Buskens, Vincent
    [J]. SOCIAL NETWORKS, 2010, 32 (01) : 4 - 15
  • [36] Understanding component co-evolution with a study on Linux
    Yu, Liguo
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2007, 12 (02) : 123 - 141
  • [37] Sustainable co-evolution
    Cairns, John, Jr.
    [J]. INTERNATIONAL JOURNAL OF SUSTAINABLE DEVELOPMENT AND WORLD ECOLOGY, 2007, 14 (01): : 103 - 108
  • [38] Designing for co-evolution
    Angelucci, Filippo
    Di Sivo, Michele
    [J]. TECHNE-JOURNAL OF TECHNOLOGY FOR ARCHITECTURE AND ENVIRONMENT, 2019, 18 : 120 - 127
  • [39] Virus-host co-evolution under a modified nuclear genetic code
    Taylor, Derek J.
    Ballinger, Matthew J.
    Bowman, Shaun M.
    Bruenn, Jeremy A.
    [J]. PEERJ, 2013, 1
  • [40] Studying Fine-Grained Co-Evolution Patterns of Production and Test Code
    Marsavina, Cosmin
    Romano, Daniele
    Zaidman, Andy
    [J]. 2014 14TH IEEE INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2014), 2014, : 195 - 204