<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>ModifRoundtrip: A Model-Based tool to reuse legacy transformations</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Paola Vallejo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jean-Philippe Babau</string-name>
          <email>babau@univ-brest.fr</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mickael Kerboeuf</string-name>
          <email>kerboeuf@univ-brest.fr</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universidad EAFIT</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universite de Bretagne Occidentale, Lab-STICC</institution>
          ,
          <addr-line>CNRS, UMR6285</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>The legacy transformations dealing with domain speci c data gathers important expertise. Nevertheless, in many cases, have to be rewritten in order to make them apply to semantically equivalent but structurally incompatible data. According to the complexity of the transformation, rewriting them can quickly become a di cult and error-prone task. We propose a coevolution approach to enable the reuse of legacy transformations instead of their rewriting. In this approach, the data conforming to the reuse context coevolve into data conforming to the legacy transformation context. Legacy transformation is applied and the result is migrated back to the reuse context. In this paper, we introduce ModifRoundtrip, a plug-in for the Eclipse development environment. It promotes the reuse of legacy transformations, providing guidance for the user during reuse process. Reuse process is done automatically, but ModifRoundtrip provides interaction points to the user to indicate custom reuse scenarios. A tool demonstration video is available at: https://youtu.be/iAPul2httyE.</p>
      </abstract>
      <kwd-group>
        <kwd>Coevolution</kwd>
        <kwd>DSML</kwd>
        <kwd>Legacy transformation</kwd>
        <kwd>Reuse</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Domain Speci c Modeling Languages (DSML) support high-level abstractions
and require few low-level details to specify a given domain. They are usually
instrumented with dedicated transformations. Some of them are generic, some
others are domain speci c. In both cases, there are variants of the
transformations that have already been implemented in other domains which are structural
variants sharing common concepts. Based on those observations, when a
transformation for a DSML is needed, instead of writing it, the reuse of a legacy
transformation represents a promising way to build safely and quickly the equipment
of a DSML [1]. However, even if legacy transformations are available, reusing
them within the scope of a given DSML raises two problems: the adaptation of
DSML data structures (user oriented) into legacy transformation data structures
(computation oriented); and the extraction of a subset of relevant concepts for
the targeted transformation, from the large set of concepts de ning the DSML.
As data handled by the transformation to be reused and data handled by the
DSML are structurally di erent, the reuse of the transformation implies to adapt
DSML models in order to put them under the scope of the transformation. And,
more important, to adapt the resulting models to put them under the DSML
scope. Making tools facilitating transformations in both directions is essential.</p>
      <p>In this paper we present ModifRoundtrip [2], an Eclipse plug-in that
promotes the reuse of legacy transformations, reducing manipulation of models.
The remainder is structured as follows: Section 2 presents related work
concerning model coevolution as a way to adapt models. Highlights of the tool are
presented in section 3. Section 4 brie y describes the architecture of the tool.
Finally, section 5 presents the conclusions and the ongoing work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>In this paper, we assume that all the data that are required by the targeted
transformation are available in the DSML even if they are structured di
erently. Considering this condition, we use the principles of metamodel evolution
and model coevolution to automate the navigation between semantically close
DSMLs by means of model migrations. ModifRoundtrip operation relies on these
principles [3] ( g. 1). Refactoring and Migration keep and update a subset of the
concepts of the DSML. ModifRoundtrip produces a migrated model (mm) from
the initial model (im); then the transformation produces the result (pm). Finally,
Reverse Migration migrates back it into the DSML context (rm). The elements
that had been removed during Migration are automatically and as much as
possible recovered without undoing the transformation's action. Elements created
by the transformation are also integrated with initial elements.</p>
      <p>DSML/Reuse context
DMM
rm
im</p>
      <p>Transformation</p>
      <p>Co-evolution
Refactoring</p>
      <p>Migration</p>
      <p>Reverse Migration
metamodels models
DMM: DSML im : initial pm: processed
TMM : transformation mm: migrated rm : reversed</p>
      <p>Legacy transformation context
TMM
pm
mm</p>
      <p>Transformation
Transformation
Conformance
Workflow</p>
      <p>With ModifRoundtrip, the user indicates the coevolution operators (remove,
rename, hide, etc.) to be applied to the DSML in order to make it match the
transformation metamodel. Using this operators does not require speci c
knowledge about model transformations. The migration in Epsilon Flock [4] integrates
a conservative copying algorithm and user-de ned migration rules. EMFMigrate
concentrates on metamodel evolution and coevolution, however it is used by [5]
in the frame of metamodel evolution and transformations coevolution. Bento [6]
supports the development and the execution of reusable transformations, based
on the use of generic templates. Genericity [7] increases the level of abstraction by
de ning metamodels containing the minimal requirements for applying a
transformation. transML [8] allows the development of model transformations
following a MDE approach (transformations are viewed as models). MTBE [9] and
MTBD [10] propose solutions for simplifying the implementation of model
transformations by using a visual support. Edapt3 coevolve models after metamodel
transformations by means of customizable migration code. ModifRoundtrip aims
at reusing existing transformations, adapting the models but the
transformations. The distinguished feature of ModifRoundtrip is that, unlike the methods
described above, our tool produces editable migration speci cations, avoiding
the migration code completion by the user. This become an usable solution for
non-experts in model migration or programming languages. As the SyVOLT tool
[11], ModifRoundtrip hides formal details from the user and place essential user
interactions at the beginning of the reuse roundtrip.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Highlights</title>
      <p>ModifRoundtrip is released as an open source software. It relies on the Eclipse
Modeling Framework (EMF) and Xtext4 for de ning the modif models and for
realizing refactoring speci cation editors. Git5 is used as version control
system. The plug-in and source code of ModifRoundtrip can be found at http:
//pagesperso.univ-brest.fr/~vallejoco/Modif/pages/indexModif.html.
Integration with Eclipse. ModifRoundtrip takes advantage of the EMF
ecosystem to specify and validate models. Users can stay within the Eclipse
environment, when they develop the tooling for a speci c domain. ModifRoundtrip
provides an Eclipse Perspective, containing three views and two buttons ( g. 2).
Views allow to edit speci cations and visualize the current state of the reuse
process. Buttons allow to create projects and to start the reuse process.
Formalization. The ModifRoundtrip's reuse process formal details are hidden
from the user. The tool behavior is formally de ned in [12]. Once the di erences
between the DSML and the transformation metamodel are speci ed by the user,
the roundtrip reuse process is started. It automatically creates all required
artifacts and provides the result to the user within the Eclipse environment.
Input metamodels independence. The metamodels are designed by using
Ecore (EMF). ModifRoundtrip operation is not dependent on speci c input
metamodels. Nevertheles, at now, the legacy transformation to be reused must
be written with the Java language respecting the generated EMF interface.
Customizable reuse. Obtaining processed models according to speci c user
needs, depends on the input model given to the legacy transformation.
ModifRoundtrip provides editable migration speci cations. Allowing users to produce
di erent input models for the reused transformation, from the same migration
speci cation. User can also apply the tool to portions of the model.
3 https://www.eclipse.org/edapt/
4 https://eclipse.org/modeling/emf/ and https://eclipse.org/Xtext/
5 https://github.com/
1
4
2
3
1 Project explorer
2 Model Editor
3 Console
4 Buttons
Traceability. ModifRoundtrip identi es model instances by means of
Universally Unique IDenti ers (UUID), it allows to trace instances evolution through
the reuse process. Furthermore, instances created by the reused transformation
can be associated with initial model instances.</p>
      <p>Scalability. ModifRoundtrip has been used to reuse transformations in the real
and complex Orcc context, a compiler for data ow applications de ned by 70
classes, 100 references and 50 attributes. It underlined how the development of
the transformations for a given DSML can be improved by using our tool [3]. It
can be tested on other domains regardless of the complexity of the metamodel.
GUI or API. ModifRoundtrip can used by means of a Graphical User Interface
(GUI) or by calling the functions de ned in the provided ModifRoundtripAPI.
ModifRoundtrip can be used to perform separately: Refactoring, Migration or
Coevolution. The ModifRoundtripAPI provides also functions to create, load
and save models and refactoring speci cations.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Architecture</title>
      <p>
        The ModifRoundtrip Eclipse plug-in is divided into three components: 1) The
User Interface, primary based on the Rich Client Platform (RCP) provided by
Eclipse. 2) The modif speci cation editor, de ned by means of Xtext. 3) The
reuse process behavior, implemented by using Java and the EMF facilities. The
reuse process comprises the modules (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) to (
        <xref ref-type="bibr" rid="ref10">10</xref>
        ) in gure 3. Squares annotated
with numbers represent computation, squares annotated with letters represent
produced and consumed data and squares with dotted lines represent user
interactions. ModifRoundtrip's modules are orchestrated by a Java program. This
program makes sure all components communicate and execute in the right order,
and allows roundtrip to run fully automatically at the push of a button. We have
used available model-driven development technologies as much as possible, both
to develop and as a part of ModifRoundtrip itself. In what follows, we brie y
visit each ModifRoundtrip computational component to describe its function.
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) Input de nition. The GUI is started by clicking the Run button of the
ModifRoundtrip's plug-in. It allows user to specify the elements needed to reuse
a legacy transformation. a points the metamodel describing the transformation
      </p>
      <sec id="sec-4-1">
        <title>Input (1) TMM a</title>
        <p>definition</p>
        <p>
          Modif
Specification
edition
(
          <xref ref-type="bibr" rid="ref3">3</xref>
          )
        </p>
        <p>DMM-to-TMM</p>
        <p>e</p>
        <p>
          DMM b
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) Modif Specification
        </p>
        <p>
          Generation
(
          <xref ref-type="bibr" rid="ref4">4</xref>
          ) Refactor
(
          <xref ref-type="bibr" rid="ref5">5</xref>
          )
        </p>
        <p>TMM’ f
metamodels
AMM: DSML im : initial
TMM : transformation mm : migrated
TMM’: refactored</p>
        <p>Compare
models specifications
pm: processed DMM-to-TMM : refactoring
rm : reversed itmm--ttoo--mpmm::dmeipgerantdioenncy</p>
      </sec>
      <sec id="sec-4-2">
        <title>Migration (7)</title>
        <p>
          Specification
edition
(
          <xref ref-type="bibr" rid="ref8">8</xref>
          )
im c
        </p>
        <p>
          Legacy transformation d
(
          <xref ref-type="bibr" rid="ref6">6</xref>
          ) Migration Specification
        </p>
        <p>
          Generation
j
to be reused, b represents the metamodel describing the reuse context (DSML
in which transformation will be reused). c is the input models and d is the
transformation to be reused. Figure 4 illustrates the GUI. Figure 5 illustrates
an example of the use of ModifRoundtrip by means of the API.
modifRoundtrip =
new ModifRoundtrip&lt;DMM, TMM&gt;();
EObject rm =
modifRoundtrip.reuseTransfo(
im, DMM, TMM, DMM_to_TMM,
TMM_, className, transfo,
autoMigration,
...
serialize);
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) Modif Speci cation Generation. We have developed a language for
specifying the di erences between the two metamodels of the input. A basis
Modif speci cation template e is automatically generated, then the user
indicates how to refactor the DSML in order to make it match the transformation.
It is done by using the proposed refactoring operators.
(
          <xref ref-type="bibr" rid="ref3">3</xref>
          ) Modif Speci cation Edition. In the modif speci cation, the user
indicates only the operators needed to transform the DSML into the transformation
metamodel. As we consider transformation metamodel has only dedicated
concepts, and adding elements is not needed, the used operators are basically:
remove, rename, hide and atten. Modif speci cation editor facilitates the edition
of modif speci cations by highlighting key words, checking syntax and suggesting
the operators to applied. Figure 6 depicts an example of the modif syntax.
(
          <xref ref-type="bibr" rid="ref4">4</xref>
          ) Refactor and (
          <xref ref-type="bibr" rid="ref5">5</xref>
          ) Compare. Refactor takes the modif speci cation e
and apply it to the DSML b . It produces a refactored metamodel f . Then
Compare, veri es that f fully match with a , if that's the case, the reuse process
will start. If they do not entirely match, ModifRoundtrip noti es the user about
where the matching's violation occurs (at now, in terms of deletion and rename).
Then, the user edits the modif speci cation and Refactor is executed.
(
          <xref ref-type="bibr" rid="ref6">6</xref>
          ) Migration speci cation Generation and (
          <xref ref-type="bibr" rid="ref7">7</xref>
          ) edition. Migration
specication g is automatically generated from the modif speci cation and the initial
model. Technical details of the translation from modif speci cation to migration
speci cation can be found in [13]. By keeping in mind the goal of reducing the
skills required to de ne custom model migrations, we developed a user interface
(Fig. 7) allowing the user to indicate speci c modi cations. If not customization
is de ned, the migrations is applied automatically. The user may act over its
elements to indicate additional deletion.
(
          <xref ref-type="bibr" rid="ref8">8</xref>
          ) Migrate. It migrates the input model c into a model h in the context of
the legacy transformation. Migration depends on the migration speci cation and
it is performed by a model independent engine implemented in Java. This engine
handles migrations in which one element of the migrated model is produced from
one and only one element of the initial model.
(
          <xref ref-type="bibr" rid="ref9">9</xref>
          ) Reuse. The transformation is reused without user intervention, it takes the
migrated model h as input and it produces a processed model i along with
a dependencies graph j . The dependencies graph keeps a trace about how the
elements are modi ed or created by the transformation.
(
          <xref ref-type="bibr" rid="ref10">10</xref>
          ) Reverse Migrate. It applies the reverse operators of the migration
speci cation operators. Reverse of rename is applied on the processed model i in
order to produce the reversed model k . Then, reverse of complex operators as
remove and hide are applied on k , in order to extended it with the elements
of the initial model c that have been removed. It is based on the natural join
concept of data bases. Then, each recovered element is related to its associated
elements (as in the initial model). If the associated elements are not in c , then,
the recovered element is related to the elements that were created or modi ed
from the associated elements. This information is provided by the
dependencies graph. At the end, the model k is validated in order to respect the type
constraints imposed by the metamodel a . This activity is automatic and
transparent for the user if the migration does not involve creation, merge or instances
division. The result model k keeps the modi cations provided by the reused
transformation, integrating initially removed elements and respecting the
structural constraints of the DSML b in which the transformation is reused. The
user is noti ed by means of a log le l about those elements that could not be
included into the nal result, so it can evaluate its pertinence and to add them
in order to produce di erent results.
5
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion and future work</title>
      <p>This article presents a MDE-based tool for reusing legacy transformations. It
provides a user interface that allows the user to deal with context-related
concepts hiding all the intermediate models and transformations involved. The main
motivation of this tool is to provide a methodology and a tooling set to assist
users to reusing legacy transformations. Accordingly, we provide a modeling
language that allow to express the modi cations (to be applied) at a convenient level
of abstraction and to interface with modeling environments. This tool allows to
separate concerns of representation from core data semantics. In future work we
aim at providing more operators and facilities to reuse legacy transformations
de ned in other languages.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Frakes</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          et al.:
          <source>Software Reuse: Metrics and Models. ACM Comput. Surv</source>
          . (
          <year>1996</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>2. Modif, http://pagesperso.univ-brest.fr/~vallejoco/Modif/pages/indexModif.html</mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Vallejo</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          et al.:
          <article-title>Improving Reuse by means of Asymmetrical Model Migrations: An Application to the Orcc Case Study</article-title>
          .
          <source>In: MODELS</source>
          <year>2015</year>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Rose</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          et al.:
          <article-title>Epsilon Flock: a model migration language</article-title>
          .
          <source>In: Software and System Modeling</source>
          <volume>13</volume>
          (
          <issue>2</issue>
          ) (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Di</given-names>
            <surname>Ruscio</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.</surname>
          </string-name>
          et al.:
          <article-title>A methodological approach for the coupled evolution of metamodels and ATL transformations</article-title>
          .
          <source>In: ICMT2013</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Cuadrado</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          et al.:
          <article-title>Reusable Model Transformation Components with bento~</article-title>
          .
          <source>In: ICMT2015</source>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Rose</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          et al.:
          <article-title>Genericity for model management operations</article-title>
          .
          <source>In: Software and System Modeling</source>
          <volume>12</volume>
          (
          <issue>1</issue>
          ) (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Guerra</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          et al.:
          <article-title>Engineering model transformations with transML</article-title>
          .
          <source>In: Software and System Modeling</source>
          <volume>12</volume>
          (
          <issue>3</issue>
          ) (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Varro</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Model Transformation by Example</article-title>
          .
          <source>In: MODELS</source>
          <year>2006</year>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Sun</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          et al.:
          <article-title>Model Transformation by Demonstration</article-title>
          .
          <source>In: MODELS</source>
          <year>2009</year>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Lucio L</surname>
          </string-name>
          . et al.:
          <article-title>SyVOLT: Full Model Transformation Veri cation Using Contracts</article-title>
          . In: CEUR Workshop Proceedings, P&amp;
          <string-name>
            <surname>D@MoDELS</surname>
          </string-name>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Kerboeuf</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          et al.:
          <article-title>Formal framework of recontextualization by means of dependency graphs</article-title>
          .
          <source>Tech. report (2015)</source>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Vallejo</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Reuse of legacy code for DSML tools in the context of MPSoC</article-title>
          .
          <source>PhD thesis</source>
          , Universite de Bretagne Occidentale (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>