一句话:提出基于变更传播的半自动方法,利用元模型演化知识与解析来协同演化生成 API 及工具代码。
元模型驱动核心 API 代码生成,开发者还会在生成 API 和语言工具中添加高级功能代码。当软件语言演化、元模型随之演化并重新生成 API 时,这些手工添加的代码可能被破坏,但现有工作多支持其他工件协同演化,缺少对代码的协同演化支持。本文提出一种基于变更传播的半自动协同演化方法,将元模型演化变更知识通过 resolutions 传播到代码,并利用同一元模型元素在代码中的不同用法支持满足不同需求的替代协同演化方案。作者在 Eclipse 的 OCL、Modisco、Papyrus 三个语言实现上,针对 5 个演化元模型、18 个项目协同演化了 976 个影响;与版本化代码对比,加权平均 precision 达 87.4%、recall 达 88.9%,并能支持开发者手工执行的有用替代协同演化。
Metamodels play a significant role to describe and analyze the relations between domain concepts. They are also cornerstone to build a software language (SL) for a domain and its associated tooling. Metamodel definition generally drives code generation of a core API. The latter is further enriched by developers with additional code implementing advanced functionalities, e.g., checkers, recommenders, etc. When a SL is evolved to the next version, the metamodels are evolved as well before to re-generate the core API code. As a result, the developers added code both in the core API and the SL toolings may be impacted and thus may need to be co-evolved accordingly. Many approaches support the co-evolution of various artifacts when metamodels evolve. However, not the co-evolution of code. This paper fills this gap. We propose a semi-automatic co-evolution approach based on change propagation. The premise is that knowledge of the metamodel evolution changes can be propagated by means of resolutions to drive the code co-evolution. Our approach leverages on the abstraction level of metamodels where a given metamodel element has often different usages in the code. It supports alternative co-evaluations to meet different developers needs. Our work is evaluated on three Eclipse SL implementations, namely OCL, Modisco, and Papyrus over several evolved versions of metamodels and code. In response to five different evolved metamodels, we co-evolved 976 impacts over 18 projects.A comparison of our co-evolved code with the versioned ones shows the usefulness of our approach. Our approach was able to reach a weighted average of 87.4% and 88.9% respectively of precision and recall while supporting useful alternative co-evolution that developers have manually performed.
DOI 原文 ·
@inproceedings{paperbot5581,
title = {Co-evolving code with evolving metamodels},
author = {Djamel Eddine Khelladi and Benoit Combemale and Mathieu Acher and Olivier Barais and Jean-Marc Jézéquel},
booktitle = {ICSE},
year = {2020},
doi = {10.1145/3377811.3380324}
}