<!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>Bidirectional Model Transformations (Short Paper)</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Thomas Buchmann</string-name>
          <email>Thomas.Buchmann@uni-bayreuth.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bernhard Westfechtel</string-name>
          <email>Bernhard.Westfechtel@uni-bayreuth.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Applied Computer Science I, University of Bayreuth</institution>
          ,
          <addr-line>D-95440 Bayreuth</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Bidirectional transformations have been studied in a wide range of application domains. In model-driven software engineering, they are required for roundtrip engineering processes. We present a pragmatic approach to engineering bidirectional model transformations that assists transformation developers by domain-specific languages, frameworks, and code generators and provides for conciseness, expressiveness, and scalability. We also discuss diferent variants of transformation development processes as well as their advantages and drawbacks.</p>
      </abstract>
      <kwd-group>
        <kwd>Model-driven software engineering</kwd>
        <kwd>roundtrip engineering</kwd>
        <kwd>bidirectional transformation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Background</title>
      <p>Transformation
code (BXtendDSL) </p>
      <p>Generated code
(BXtend) </p>
      <p>+
Transformation code</p>
      <p>(BXtend)
Correspondence
model</p>
      <p>Framework code
(BXtend) 
Transformation</p>
      <p>developer
Handwritten code</p>
      <p>(BXtend) 
Variants:
1. Hand written code + framework code (BXtend)
2. Transformation code + handwritten code</p>
      <p>+ generated code + framework code (BXtendDSL)
3. Transformation code + generated code
+ framework code (BXDSL)</p>
      <p>Source model
Target model
to provide for short solutions with respect to size metrics — and scalability — the ability to
perform transformations eficiently on large data sets.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Contribution</title>
      <p>Based on our experience gained from empirical evaluations, we have been developing frameworks
for engineering bidirectional model transformations [12]. Our goal is to support
transformation developers in the specification and implementation of bidirectional transformations in
the context of model-driven software engineering [13]. Thus, the artifacts that are subject to
transformations are models of software systems; the Eclipse Modeling Framework [ 14] serves as
the underlying technological ecosystem. In particular, we focus on roundtrip engineering (e.g.,
between model and code), where the source model and the target model are considered as peers
and updates may be propagated in both directions. While roundtrip properties are guaranteed
to a certain extent, we have addressed primarily conciseness, expressiveness, and scalability.</p>
      <p>
        In our work, bidirectional transformations share the following features: (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) Bidirectional
transformations are symmetric inasmuch as source and target model are considered as peers
(rather than asymmetric transformations, working on sources and views). (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) Each
transformation execution is directed, i.e., it reads the source model and updates the target model (or vice
versa). (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) Each transformation is executed on demand only (no live propagation of changes).
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) Transformations are correspondence-based, a correspondence model is stored persistently to
allow for precise change propagations. (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ) Finally, transformations are state-based, i.e., they rely
on model states only rather than on operational deltas.
      </p>
      <p>As illustrated in Figure 1, we provide a layered approach to developing bidirectional model
transformations. This approach, which is called BXTendDSL, combines declarative with
imperative programming and is labeled as number · in Figure 1. Before, we briefly present its
precursor BXtend [15], which entirely relies on imperative programming (number ¶). Finally,
we discuss a potential purely declarative approach (BXDSL), which is subject to current and
future work (number ¸).</p>
      <sec id="sec-2-1">
        <title>2.1. BXtend</title>
        <p>The acronym BXtend is composed from BX (bidirectional transformations) and Xtend, an
object-oriented programming language that is based on Java [16]. The BXtend framework
[15] provides an internal domain-specific language (DSL) for bidirectional transformations. An
internal DSL ofers an application programming interface in a host language; it is easier to
implement than an external DSL and does not require the transformation developer to learn a
new language. Xtend was selected as a host language because it ofers high-level support for
object-oriented, procedural, and functional programming.</p>
        <p>Programming bidirectional transformations from scratch is laborious. BXtend reduces this
efort considerably by providing a generic framework on top of which specific code for
implementing transformation rules has to be written. The framework includes an implementation of
a correspondence model as well as algorithms for incremental model transformations in both
directions. The evaluations which we conducted so far confirm conciseness, expressiveness, and
scalability. In the Families to Persons benchmark published in [8], the BXtend solution is the
only one that passes all test cases. Furthermore, BXtend proves to be scalable. Even conciseness
is reasonable although both transformation directions have to be programmed manually.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. BXtendDSL</title>
        <p>The BXtend framework shows two shortcomings: First, a transformation definition written
in the BXtend internal DSL contains redundant code, i.e., similar code fragments in forward
and backward direction. Second, roundtrip properties may be ensured by testing only. In
response to these problems, we developed BXtendDSL [12, 17] that adds a declarative layer on
top of the imperative layer. At the declarative layer, the transformation developer specifies the
transformation in a purely declarative language (reflected in the sufix of the acronym); here, we
decided to provide an external DSL with a short and intuitive syntax. After code generation, the
transformation developer employs the internal DSL to complete the transformation definition.</p>
        <p>The external DSL is a small and light-weight relational language that is based on rules
describing relations between corresponding source and target patterns. Intentionally, the DSL
is computationally incomplete: In all of the transformation cases that we have studied so far,
the declarative code needs to be supplemented with imperative code that ofers the required
lfexibility to solve the transformation case at hand. In this way, the external DSL can be kept
small, avoiding the reimplementation of functionality that is available in the BXtend internal
DSL anyway. Accordingly, code generation is partial, as e.g. in the EMF code generator [14],
which generates incomplete code from a structural metamodel.</p>
        <p>In the external DSL, a transformation is defined by a sequence of rules that may depend on
each other. The DSL allows to declare  ∶  dependencies between source and target objects,
as well as  ∶  dependencies at the level of structural features (attributes and references).
Furthermore, the transformation developer may define extension points that have to be filled
with imperative code if the mapping cannot be handled by generated code alone.</p>
        <p>Furthermore, the external DSL guarantees roundtrip properties under certain restrictions.
Roughly following [18], correctness means that a transformation restores consistency among the
participating models, and hippocraticness implies that models that are already mutually
consistent are not updated. Correctness and hippocraticness are guaranteed under well-behavedness
conditions that are defined by means of OCL [ 19] constraints on transformation definitions in
the declarative DSL.</p>
        <p>Our benchmark evaluations [12] reconfirm conciseness, expressiveness, and scalability.
Compared to BXtend, both expressiveness and scalability are not afected adversely. Furthermore,
solutions in the layered framework (comprising the manual code written on both layers) are
considerably more concise than the corresponding BXtend solutions (and solutions in other
tools/languages).
2.3. BXDSL
BXtendDSL ofers two main advantages over BXtend: conciseness and guarantee of roundtrip
properties (under well-behavedness conditions). However, it exhibits two shortcomings: First,
the transformation developer has to switch between diferent levels of abstraction. Second, the
well-behavedness conditions are restrictive; each of the transformation cases we have studied
so far violates at least one of these conditions, implying the need for imperative programming.
Thus, the question arises whether it is possible to design a declarative language (with the
ifctitious name BXDSL) that is computationally complete (and thus does not require imperative
code as a supplement) and relaxes the well-behavedness conditions such that a wider range of
transformations can be specified that are provably correct.</p>
        <p>So far, we have not achieved these goals. Currently, we are working on an extension of
BXtendDSL so that more work can get done at the declarative layer [20]. However, the new
language version is not powerful enough to solve bx transformations completely, and still
requires complementary imperative code, thus retaining the layered approach described above.
Based on the experiences we have gained so far in bidirectional transformations, we consider
it unlikely that a single bx language may be designed that guarantees round-trip properties
without restrictions on the use of the language. Furthermore, the fictitious language would
have to include unidirectional language constructs, as they are already present in BXtendDSL
and were proposed e.g. in [21] as extensions to the relational bx language QVT-R [5].</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Conclusion</title>
      <p>In this paper, we summarized our research in the bx domain. Our approach aims at engineering
bidirectional model transformations by ofering domain-specific languages, frameworks, and
code generators. In this way, we intend to reduce the amount of work that transformation
developers have to invest. Our main focus lies on the quality attributes conciseness,
expressiveness, and scalability. We also discussed diferent variants of transformation development
processes. So far, we consider the layered approach of BXtendDSL the best choice in terms of
concisensess, expressiveness, and scalability. Altogether, our research complements other bx
research that primarily focuses on roundtrip properties and provably correct transformations.
These issues have been addressed to a limited extent in BXtendDSL, as well, but have not been
the major driving force of our research, which rather follows the modest goal of making the life
of bx transformation developers easier.
trip engineering, IET Software 10 (2016) 173–181. URL: http://digital-library.theiet.org/
content/journals/10.1049/iet-sen.2015.0125.
[11] B. Westfechtel, Case-based exploration of bidirectional transformations in QVT relations,</p>
      <p>Software and Systems Modeling 17 (2018) 989–1029. doi: 1 0 . 1 0 0 7 / s 1 0 2 7 0 - 0 1 6 - 0 5 2 7 - z .
[12] T. Buchmann, M. Bank, B. Westfechtel, BXtendDSL: A layered framework for bidirectional
model transformations combining a declarative and an imperative language, J. Syst. Softw.
189 (2022) 111288. URL: https://doi.org/10.1016/j.jss.2022.111288. doi:1 0 . 1 0 1 6 / j . j s s . 2 0 2 2 .
1 1 1 2 8 8 .
[13] M. Völter, T. Stahl, J. Bettin, A. Haase, S. Helsen, Model-Driven Software Development:</p>
      <p>Technology, Engineering, Management, John Wiley &amp; Sons, Chichester, UK, 2006.
[14] D. Steinberg, F. Budinsky, M. Paternostro, E. Merks, EMF Eclipse Modeling Framework,</p>
      <p>The Eclipse Series, 2nd ed., Addison-Wesley, Boston, MA, 2009.
[15] T. Buchmann, Bxtend - A framework for (bidirectional) incremental model transformations,
in: S. Hammoudi, L. F. Pires, B. Selic (Eds.), Proceedings of the 6th International Conference
on Model-Driven Engineering and Software Development, MODELSWARD 2018, Funchal,
Madeira - Portugal, January 22-24, 2018., SciTePress, 2018, pp. 336–345. URL: https://doi.
org/10.5220/0006563503360345. doi:1 0 . 5 2 2 0 / 0 0 0 6 5 6 3 5 0 3 3 6 0 3 4 5 .
[16] L. Bettini, Implementing Domain-Specific Languages with Xtext and Xtend, Packt
Publishing, Birmingham, UK, 2016.
[17] M. Bank, T. Buchmann, B. Westfechtel, Combining a declarative language and an imperative
language for bidirectional incremental model transformations, in: S. Hammoudi, L. F.
Pires, E. Seidewitz, R. Soley (Eds.), Proceedings of the 9th International Conference on
Model-Driven Engineering and Software Development, MODELSWARD 2021, Online
Streaming, February 8-10, 2021, SCITEPRESS, 2021, pp. 15–27. URL: https://doi.org/10.
5220/0010188200150027. doi:1 0 . 5 2 2 0 / 0 0 1 0 1 8 8 2 0 0 1 5 0 0 2 7 .
[18] P. Stevens, Bidirectional model transformations in QVT: Semantic issues and open
questions, Software and Systems Modeling 9 (2010) 7–20.
[19] OMG, Object Constraint Language, formal/2014-02-03 ed., OMG, Needham, MA, 2014.
[20] O. Hacker, BXtendDSL 2: Weiterentwicklung einer hybriden Sprache für bidirektionale
Modell-zu-Modell Transformationen, 2022. Master thesis (in German), University of
Bayreuth, Germany.
[21] B. Westfechtel, A case study for evaluating bidirectional transformations in QVT Relations,
in: J. Filipe, L. Maciaszek (Eds.), Proceedings of the 10th International Conference on the
Evaluation of Novel Approaches to Software Engineering (ENASE 2015), SCITEPRESS,
Barcelona, Spain, 2015, pp. 141–155.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>K.</given-names>
            <surname>Czarnecki</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. N.</given-names>
            <surname>Foster</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Lämmel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Schürr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Terwilliger</surname>
          </string-name>
          ,
          <article-title>Bidirectional transformations: A cross-discipline perspective</article-title>
          , in: R. F. Paige (Ed.),
          <source>Proceedings of the Second International Conference on Theory and Practice of Model Transformations (ICMT</source>
          <year>2009</year>
          ), volume
          <volume>5563</volume>
          of Lecture Notes in Computer Science, Springer-Verlag, Zurich, Switzerland,
          <year>2009</year>
          , pp.
          <fpage>260</fpage>
          -
          <lpage>283</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Hidaka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Tisi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Cabot</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <article-title>Feature-based classification of bidirectional transformation approaches</article-title>
          ,
          <source>Software and Systems Modeling</source>
          <volume>15</volume>
          (
          <year>2016</year>
          )
          <fpage>907</fpage>
          -
          <lpage>928</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J. N.</given-names>
            <surname>Foster</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. B.</given-names>
            <surname>Greenwald</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. T.</given-names>
            <surname>Moore</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. C.</given-names>
            <surname>Pierce</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Schmitt</surname>
          </string-name>
          ,
          <article-title>Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem</article-title>
          ,
          <source>ACM Transactions on Programming Languages and Systems</source>
          <volume>29</volume>
          (
          <year>2007</year>
          )
          <volume>17</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>17</lpage>
          :
          <fpage>65</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>H.</given-names>
            <surname>Ko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Zan</surname>
          </string-name>
          ,
          <string-name>
            <surname>Z. Hu,</surname>
          </string-name>
          <article-title>BiGUL: a formally verified core language for putback-based bidirectional programming</article-title>
          , in: M.
          <string-name>
            <surname>Erwig</surname>
          </string-name>
          , T. Rompf (Eds.),
          <source>Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation</source>
          ,
          <string-name>
            <surname>PEPM</surname>
          </string-name>
          <year>2016</year>
          ,
          <article-title>St</article-title>
          . Petersburg, FL, USA, January
          <volume>20</volume>
          -
          <issue>22</issue>
          ,
          <year>2016</year>
          , ACM,
          <year>2016</year>
          , pp.
          <fpage>61</fpage>
          -
          <lpage>72</lpage>
          . URL: https://doi.org/10.1145/2847538.2847544.
          <source>doi:1 0 . 1 1</source>
          <volume>4 5 / 2 8 4 7 5 3 8 . 2 8 4 7 5 4 4 .</volume>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>OMG</surname>
          </string-name>
          ,
          <source>Meta Object Facility (MOF) 2</source>
          .0 Query/View/Transformation Specification, formal/2015-02-01 ed., Needham, MA,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Cicchetti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. Di</given-names>
            <surname>Ruscio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Eramo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pierantonio</surname>
          </string-name>
          ,
          <article-title>JTL: A bidirectional and change propagating transformation language</article-title>
          , in: B.
          <string-name>
            <surname>Malloy</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Staab</surname>
          </string-name>
          , M. van den Brand (Eds.),
          <source>Proceedings of the Third International Conference on Software Language Engineering (SLE</source>
          <year>2010</year>
          ), volume
          <volume>6563</volume>
          of Lecture Notes in Computer Science, Springer-Verlag, Eindhoven, The Netherlands,
          <year>2010</year>
          , pp.
          <fpage>183</fpage>
          -
          <lpage>202</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Schürr</surname>
          </string-name>
          ,
          <article-title>Specification of Graph Translators with Triple Graph Grammars</article-title>
          , in: G. Tinhofer (Ed.),
          <source>Proceedings of the 20th International Workshop on Graph-Theoretic Concepts in Computer Science (WG</source>
          <year>1994</year>
          ), volume
          <volume>903</volume>
          <source>of LNCS</source>
          , Springer-Verlag, Herrsching, Germany,
          <year>1994</year>
          , pp.
          <fpage>151</fpage>
          -
          <lpage>163</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Anjorin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Buchmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Westfechtel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Diskin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Ko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Eramo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Hinkel</surname>
          </string-name>
          , L. SamimiDehkordi, A. Zündorf,
          <article-title>Benchmarking bidirectional transformations: theory, implementation, application, and assessment</article-title>
          ,
          <source>Software and Systems Modeling</source>
          <volume>19</volume>
          (
          <year>2020</year>
          )
          <fpage>647</fpage>
          -
          <lpage>691</lpage>
          . URL: https://doi.org/10.1007/s10270-019-00752-x.
          <source>doi:1 0 . 1 0 0 7 / s 1 0</source>
          <volume>2 7 0 - 0 1 9 - 0 0 7 5</volume>
          <fpage>2</fpage>
          -
          <lpage>x</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>F.</given-names>
            <surname>Abou-Saleh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Cheney</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Gibbons</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. McKinna</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Stevens</surname>
          </string-name>
          , Introduction to bidirectional transformations, in: J.
          <string-name>
            <surname>Gibbons</surname>
          </string-name>
          , P. Stevens (Eds.), Bidirectional Transformations - International
          <source>Summer School</source>
          , Oxford, UK,
          <source>July 25-29</source>
          ,
          <year>2016</year>
          , Tutorial Lectures, volume
          <volume>9715</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2016</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>28</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -79108-
          <issue>1</issue>
          _1.
          <source>doi:1 0 . 1 0</source>
          <volume>0 7 / 9 7 8 - 3 - 3 1 9 - 7 9 1 0 8 - 1</volume>
          \ _ 1 .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>T.</given-names>
            <surname>Buchmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Westfechtel</surname>
          </string-name>
          ,
          <article-title>Using triple graph grammars to realize incremental round-</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>