round-trip migration of object-oriented data model instanceswhile this relieves developers from an...

9
Round-Trip Migration of Object-Oriented Data Model Instances Luca Beurer-Kellner ETH Zürich Zürich, Switzerland Jens von Pilgrim HAW Hamburg Hamburg, Germany Timo Kehrer Humboldt-Universität zu Berlin Berlin, Germany ABSTRACT The communication of web-based services is typically organized through public APIs which rely on a common data model shared among all system components. To accommodate new or changing requirements, a common approach is to plan data model changes in a backward compatible fashion. While this relieves developers from an instant migration of the system components including the data they are operating on, it causes serious maintenance prob- lems and architectural erosion in the long term. We argue that an alternative solution to this problem is to use a translation layer serving as a round-trip migration service which is responsible for the forth-and-back translation of object-oriented data model in- stances of different versions. However, the development of such a round-trip migration service is not yet properly supported by existing technologies. In this challenge, we focus on the key task of developing the required migration functions, framing this as a model transformation problem. ACM Reference Format: Luca Beurer-Kellner, Jens von Pilgrim, and Timo Kehrer. 2020. Round- Trip Migration of Object-Oriented Data Model Instances. In Proceedings of TTC@STAF. ACM, New York, NY, USA, 9 pages. https://doi.org/10.1145/ nnnnnnn.nnnnnnn 1 INTRODUCTION 1.1 Context In web development, the communication of web-based services is typically organized through public APIs which rely on a com- mon data model shared among all system components. Over time, the shared data model must be changed to accommodate new or changing requirements, and the system components (i.e., services) including the data they are operating on must be migrated. This problem, commonly known as API evolution, is a well-known chal- lenge, in particular for web APIs [28, 33, 34]. Figure 1 illustrates this problem by means of a typical example of a distributed system exposing a three-tier architecture with a client, a service and a database layer. The API and its underlying data model are evolved from version 1 (red, not striped) to version 2 (green, striped), which may lead to different architectural evolu- tion scenarios, depending on the temporal order of updating the Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. TTC@STAF, 2020, Bergen, Norway © 2020 Association for Computing Machinery. ACM ISBN 978-x-xxxx-xxxx-x/YY/MM. . . $15.00 https://doi.org/10.1145/nnnnnnn.nnnnnnn involved components. Ideally, all components are updated simul- taneously (scenario ). When performed in an online fashion, we need a translation layer (TL) to migrate the existing data using tools such as Liquibase [22]. Once the migration has been performed, components relying on version 1 of the data model are replaced by their updated successor versions. In practice, however, not all the affected components can be mi- grated instantly and at the same time [6]. A common workaround is to plan data model changes in a backward compatible fashion. However, this severely hampers flexibility when evolving the data model, and essentially comes at the cost of architectural erosion, increased maintenance efforts and technical debt [31]. A more flex- ible solution would be to operate components relying on different data model versions at the same time and to use a translation layer serving as round-trip migration service being responsible for the forth-and-back translation of object-oriented data model instances of different versions. The evolution scenarios , and use such a round-trip migration service to migrate and migrate back shared data model instances on demand. Architecturally, this allows for greater flexibility than the aforementioned solutions. It leaves open a wide variety of design decisions, regarding the use of different data model versions as well as the location of the translation layer (client-side, server-side, in the database system, in client-libraries, etc.). 1.2 Research Gap Although it seems to be an attractive solution to deal with data model evolution, the development of a round-trip migration layer which is responsible for the the forth-and-back translation of object- oriented data model instances of different versions is not yet prop- erly supported by existing technologies. 1 Service V.1 Client V.1 API V.1 Service V.2 Client V.2 Database Service V.2 API V.2 Database Service V.1 TL 1 V.1 V.2 2 Database Service V.2 Service V.1 Client V.1 API V.1 TL 2 V.1 V.2 3 TL 3 V.1 V.2 Client V.1 API V.1 Service V.2 Database Service V.2 4 Service V.2 Client V.1 Database Service V.2 API V.2 TL 4 V.1 V.2 Figure 1: An example of a distributed system. The API and its underlying data model are evolved from version 1 (red, not striped) to version 2 (green, striped). In the architectural evolution scenarios , and , data model evolution is sup- ported through round-trip migrating data translation lay- ers.

Upload: others

Post on 24-Sep-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

Round-Trip Migration of Object-Oriented Data Model InstancesLuca Beurer-Kellner

ETH ZürichZürich, Switzerland

Jens von PilgrimHAW Hamburg

Hamburg, Germany

Timo KehrerHumboldt-Universität zu Berlin

Berlin, Germany

ABSTRACTThe communication of web-based services is typically organizedthrough public APIs which rely on a common data model sharedamong all system components. To accommodate new or changingrequirements, a common approach is to plan data model changesin a backward compatible fashion. While this relieves developersfrom an instant migration of the system components including thedata they are operating on, it causes serious maintenance prob-lems and architectural erosion in the long term. We argue that analternative solution to this problem is to use a translation layerserving as a round-trip migration service which is responsible forthe forth-and-back translation of object-oriented data model in-stances of different versions. However, the development of sucha round-trip migration service is not yet properly supported byexisting technologies. In this challenge, we focus on the key taskof developing the required migration functions, framing this as amodel transformation problem.

ACM Reference Format:Luca Beurer-Kellner, Jens von Pilgrim, and Timo Kehrer. 2020. Round-Trip Migration of Object-Oriented Data Model Instances. In Proceedings ofTTC@STAF. ACM, New York, NY, USA, 9 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn

1 INTRODUCTION1.1 ContextIn web development, the communication of web-based servicesis typically organized through public APIs which rely on a com-mon data model shared among all system components. Over time,the shared data model must be changed to accommodate new orchanging requirements, and the system components (i.e., services)including the data they are operating on must be migrated. Thisproblem, commonly known as API evolution, is a well-known chal-lenge, in particular for web APIs [28, 33, 34].

Figure 1 illustrates this problem by means of a typical exampleof a distributed system exposing a three-tier architecture with aclient, a service and a database layer. The API and its underlyingdata model are evolved from version 1 (red, not striped) to version2 (green, striped), which may lead to different architectural evolu-tion scenarios, depending on the temporal order of updating the

Permission to make digital or hard copies of all or part of this work for personal orclassroom use is granted without fee provided that copies are not made or distributedfor profit or commercial advantage and that copies bear this notice and the full citationon the first page. Copyrights for components of this work owned by others than ACMmust be honored. Abstracting with credit is permitted. To copy otherwise, or republish,to post on servers or to redistribute to lists, requires prior specific permission and/or afee. Request permissions from [email protected]@STAF, 2020, Bergen, Norway© 2020 Association for Computing Machinery.ACM ISBN 978-x-xxxx-xxxx-x/YY/MM. . . $15.00https://doi.org/10.1145/nnnnnnn.nnnnnnn

involved components. Ideally, all components are updated simul-taneously (scenario ➊). When performed in an online fashion, weneed a translation layer (TL) to migrate the existing data using toolssuch as Liquibase [22]. Once the migration has been performed,components relying on version 1 of the data model are replaced bytheir updated successor versions.

In practice, however, not all the affected components can be mi-grated instantly and at the same time [6]. A common workaroundis to plan data model changes in a backward compatible fashion.However, this severely hampers flexibility when evolving the datamodel, and essentially comes at the cost of architectural erosion,increased maintenance efforts and technical debt [31]. A more flex-ible solution would be to operate components relying on differentdata model versions at the same time and to use a translation layerserving as round-trip migration service being responsible for theforth-and-back translation of object-oriented data model instancesof different versions. The evolution scenarios ➋, ➌ and ➍ use sucha round-trip migration service to migrate and migrate back shareddata model instances on demand. Architecturally, this allows forgreater flexibility than the aforementioned solutions. It leaves opena wide variety of design decisions, regarding the use of differentdata model versions as well as the location of the translation layer(client-side, server-side, in the database system, in client-libraries,etc.).

1.2 Research GapAlthough it seems to be an attractive solution to deal with datamodel evolution, the development of a round-trip migration layerwhich is responsible for the the forth-and-back translation of object-oriented data model instances of different versions is not yet prop-erly supported by existing technologies.

1

Service V.1

Client V.1

API V.1

Service V.2

Client V.2

Database Service V.2

API V.2

Database Service V.1

TL 1V.1 V.2

2

Database Service V.2

Service V.1

Client V.1

API V.1

TL 2V.1 V.2

3

TL 3V.1 V.2

Client V.1

API V.1

Service V.2

Database Service V.2

4

Service V.2

Client V.1

Database Service V.2

API V.2

TL 4V.1 V.2

Figure 1: An example of a distributed system. The API andits underlying data model are evolved from version 1 (red,not striped) to version 2 (green, striped). In the architecturalevolution scenarios ➋, ➌ and ➍, data model evolution is sup-ported through round-trip migrating data translation lay-ers.

Page 2: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

TTC@STAF, 2020, Bergen, Norway Luca Beurer-Kellner, Jens von Pilgrim, and Timo Kehrer

Frameworks such as Google’s Protocol Buffers1, Apache Thrift2or Apache Avro3 support versioning of the whole API and provideannotations in order to change an API in a backwards compatibleway. On a more fine-grained level, UpgradeJ [2] extends Java tosupport versioned type declarations. It allows for upgrading tonew versions dynamically at run-time, however, the revised classmust have at least the fields and method signatures as the originalone. Dmitriev et al. [5] discuss evolution techniques for the PJamapersistence framework. Programmers canwrite migration functionswhich are embedded by means of static methods. However, there isno dedicated support for implementing round-trip migrations.

Traditional research on data model evolution and instance mi-gration has its roots in the database systems community. Here,schema evolution generally refers to the process of facilitating themodification of a database schema without loss of existing data orcompromising data integrity [24]. The main aim, however, is tomerely update instance data in response to schema changes, whichinherently differs from round-trip migrating instances betweendifferent versions of an API.

The same limitation applies to more recent work in model-drivenengineering. Here, multiple approaches have been proposed ad-dressing the migration of instance models in response to meta-model changes, referred to as meta-model evolution and model co-evolution [10]. Their goal, however, similar to schema evolution,is to merely update instance models in response to meta-modelevolution. Nonetheless, we feel that a multitude of techniques thathave been proposed in the context of model evolution and modeltransformation may serve as a proper basis for the specification ofround-trip migrations.

1.3 Challenge in a NutshellIn this challenge, we focus on the key task of developing migrationfunctions which are needed by a round-trip migration service. Weonly consider API changes affecting the shared data model, whileother aspects of API evolution such as signature changes inmethodsor endpoints in HTTP are out of scope. Protocol changes (e.g.,change of message format, authentication, rate limit) as mentionedin Wang et al. [33] are also not considered here. Finally, we focuson a single round-trip migration at a time and do not considerconcurrent operations in any way.

We frame the development of migration functions as a transfor-mation problem that abstracts from technological details. While theshared data model is typically defined through Web API specifica-tion languages, we choose a more simple and explicit representationusing an object-oriented modeling approach. Conceptually, we con-sider object-oriented data models and instances as graphs, servingas basis for the problem definition which we present more for-mally in Section 2. Next, in Section 3, we give a set of selecteddata model evolution scenarios and the corresponding round-tripmigration tasks which are to be solved within this challenge. InSection 4, we present criteria for evaluating the submitted solutions.An evaluation framework which may be used by solution providersand which comprises a set of experimental subjects is described in

1https://developers.google.com/protocol-buffers2https://thrift.apache.org3https://avro.apache.org

Section 5. Finally, Section 6 presents a simple reference solution,serving as baseline for more sophisticated solutions based on modeltransformation concepts and technologies.

An evaluation framework as well as a reference solution for thiscase may be found at https://github.com/lbeurerkellner/ttc2020.

1.4 Relation to Previous TTC CasesAt the 2017 edition of the Transformation Tool Contest, the “Fami-lies to Persons Case” [1] has been presented. It models a well-knownbidirectional transformation problem which is closely related tothe underlying problem of our case. However, coming from a morepractical setting, we want to emphasize different aspects. As it willbecome apparent from our evolution scenarios presented in Section3, our background is mostly motivated by the features of modernweb-development languages (e.g., the use of optional fields in Sec-tion 3.3) as well as the development process of web applications ingeneral (e.g., our evaluation criterion re-usability in Section 4.4).

2 PROBLEM DEFINITIONIn this section, we introduce our conceptual, technology-independentnotion of object-oriented data models and instances, and thenpresent properties which we would ideally expect from round-tripmigrations.

2.1 Data Models and InstancesGraphs are a natural means to conceptually define object-orienteddatamodels and instances. For the sake of being compatible with themajority of available model transformation technologies, our notionof a graph can be transferred to model representations which arebased on the essential MOF (EMOF) standard being defined by theOMG4. Specifically, a graph G = (GN ,GE , srcG , tдtG ) consists oftwo disjoint setsGN andGE containing the nodes and the edges ofthe graph, respectively. Every edge represents a directed connectionbetween two nodes, which are called the source and target nodesof the edge, formally represented by source and target functionssrcG , tдtG : GE → GN . Given two graphs G and H , a pair offunctions (fN , fE ) with fN : GN → HN and fE : GE → HE formsa graph morphism f : G → H if it maps the nodes and edgesof G to those of H in a structure-preserving way, i.e., ∀e ∈ GE :fN (srcG (e)) = srcH (fE (e)) ∧ fN (tдtG (e)) = tдtH (fE (e)).

An object-oriented data model is conceptually considered as adistinguished graph referred to as type graph T , while an instanceof this data model is formally treated as an instance graph G typedoverT . Formally, a type graph T = (TN ,TE , srcT , tдtT , I ,A) is a spe-cial graphwhose nodes and edges are representing types, and whichcomprises the definition of a node type hierarchy I ⊆ TN × TN ,which must be an acyclic relation, and a set A ⊆ TN identify-ing abstract node types. The typing relation between instancesand data models may be formalized by a special graph morphismtypeG : G → T relating an instance graph G with its associatedtype graph T [3]. The way we handle attributes and attribute dec-larations follows the definition of attributed graphs given in [11].The main idea of formalizing node attributes in an instance graph isto consider them as edges of a special kind referring to data values.

4https://www.omg.org/spec/MOF

Page 3: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

Round-Trip Migration of Object-Oriented Data Model Instances TTC@STAF, 2020, Bergen, Norway

Analogously, attributes declared by node types of a type graph arerepresented as special edges referring to data type nodes.

In order to avoid going into any technical details of model trans-formation approaches yet, we will take an extensional view on datamodels. That is, speaking about a data modelM , then M refers tothe (infinite) set of data model instances which are properly typedoverM .

2.2 Round-Trip Migration FunctionsWe differentiate the migration and the modification of instances.Given two data modelsM1 andM2 withM1 , M2, a total functionf : M1 → M2 is considered a migration function from M1 to M2.Given two instancesm1 ∈ M1 andm2 ∈ M2, we say thatm1 ismigrated tom2 if f (m1) =m2. On the contrary, given a single datamodel M , a total function c : M → M is considered an instancemodification function. Given two instancesm andm′ typed overM ,we say thatm is modified to becomem′ if c(m) =m′.

To allow two components which depend on different data modelsto communicate with each other, a translation layer is responsiblefor migrating instances forth and back. Formally, a translation layeris a tuple T = (M1,M2, f ,д) where M1 and M2 denote the datamodels the layer translates from and to via migration functionsf : M1 → M2 and д : M2 → M1, respectively. Given an instancem1 ∈ M1, we refer to the consecutive application of f and д tom1, i.e., д(f (m1)), as the round-trip migration ofm1 via M2. Like-wise, since translation layers are supposed to work symmetricallyin either direction, given an instancem2 ∈ M2, f (д(m2)) denotesthe round-trip migration ofm2 viaM1. The round-trip migrationof an instancem1 via M2 (resp.m2 via M1) is called successful ifд(f (m1)) =m1 (resp. f (д(m2)) =m2). A translation layer T is con-sidered successfully round-trip-migrating if the following conditionshold:

∀m1 ∈ M1 : д(f (m1)) =m1 (1)∀m2 ∈ M2 : f (д(m2)) =m2 (2)

In practice, round-trip migrations as introduced above will barelyhappen since, more often than not, a component will not directlyreturn an instance it just received but rather apply some modifi-cation to the instance before returning it. Given two data mod-els M1 and M2, a round-trip migration with modification of an in-stancem1 ∈ M1 via M2 is a consecutive application of functionsд ◦ c2 ◦ f (m1) = д(c2(f (m1))) where, like above, f and д are mi-gration functions fromM1 toM2 andM2 toM1, respectively, andc2 : M2 → M2 is an instance modification function performingthe modification of the migrated instance f (m1) ∈ M2. Due to themodification of f (m1), the original definition of a successful round-trip migration is not suitable anymore. The result of migrating backthe modified instance c2(f (m1)) ∈ M2 is not expected to be theoriginal instancem1. Intuitively, the result is rather expected to bea modification c1(m1) of instancem1 where c1 : M1 → M1 repre-sents the corresponding co-modification of c2 on data model M1.A translation layer T = (M1,M2, f ,д) which handles round-tripmigrations between data modelsM1 andM2 is called successfullyround-trip migrating with modification if there are co-modificationsc1 : M1 → M1 and c2 : M2 → M2 such that the following

conditions hold:

∀m1 ∈ M1 : д(c2(f (m1))) = c1(m1) (3)∀m2 ∈ M2 : f (c1(д(m2))) = c2(m2) (4)

3 SELECTED EVOLUTION SCENARIOS /TASKS

In the following sections 3.2 through 3.4, we introduce a selectionof different cases of data model evolution and according round-tripmigration scenarios. Data models and instances are representedusing UML class and object diagram notations, respectively. Eachscenario comprises two versions of a data model that demonstratethe application of typical edit operations on object-oriented datamodels in a minimal context. Each scenario can be interpreted fromtwo perspectives, i.e., fromM1 toM2, or vice versa. The respectiveedit operations which can be observed in both cases are inverseto each other. We discuss round-trip migrations in both directions,using the shorthand notationsM1 7→ M2 7→ M1 andM2 7→ M1 7→M2 , respectively.

For each of these round-trip migration scenarios, the task is tospecify the required migration functions, referred to asmigrate andmigrate back in the sequel. That is, each of the four data modelevolution scenarios yields two tasks which we ask to be solved bysolution providers, summing up to a total number of eight tasks forthe entire case. Since all of these tasks are independent from eachother, participants may address a subset of them.

3.1 Create/Delete Field −→

Task_1_M1_M2_M1 and Task_1_M2_M1_M2In this scenario, a new field is added to (removed from) a class ofthe data model, as illustrated in Figure 3 (left). We assume this fieldto be functionally independent from any other field of the sameclass.

As illustrated in Figure 3 (right), in a M1 7→ M2 7→ M1 round-trip migration, the new field age should be set to some suitabledefault value since the original Person instance does not provide aconcrete value for this field. The more complicated case, however, istheM2 7→ M1 7→ M2 round-trip migration since it needs to accessa previous revision of the migrated object during a later stagein the round-trip migration. Here, the value of field age shouldbe recovered from the original Person instance. In the context oftraditional bidirectional transformation, this can be considered as astandard scenario which we use as a warm-up task of our round-tripmigration case.

3.2 Rename Field −→

Task_2_M1_M2_M1 and Task_2_M2_M1_M2In this evolution scenario, the name of a field is changed. The mostsimple reason for this kind of change is to improve the wordingin the data model to better reflect the terminology of a domain ofinterest. A more challenging change is to slightly update the mean-ing of a field, as it is the case in our evolution scenario presentedin Figure 2 (left). Here, the field age inM1 is changed to ybirth inM2, now capturing a Person’s year of birth instead of its currentage.

Page 4: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

TTC@STAF, 2020, Bergen, Norway Luca Beurer-Kellner, Jens von Pilgrim, and Timo Kehrer

:Personname = "Alice"age = -1

:Personname = "Alice"

:Personname = "Alice"

:Personname = "Alice"age = 25

:Personname = "Alice"

:Personname = "Alice"age = 25

Personname : String

Personname : Stringage : Int

Figure 2: Illustration of the datamodel evolution scenario “Create/Delete Field” (left) and the corresponding round-tripmigra-tionsM1 7→ M2 7→ M1 andM2 7→ M1 7→ M2 (right). Requested specifications for the latter are referred to as Task_1_M1_M2_M1and Task_1_M2_M1_M2, respectively.

:Personname = "Alice"age = 25

:Personname = "Alice"ybirth = 1995

:Personname = "Alice"ybirth = 1995

:Personname = "Alice"age = 25

:Personname = "Alice"ybirth = 1995

:Personname = "Alice"age = 25

Personname : Stringybirth : Int

Personname : Stringage : Int

Data model evolution migrate migrateBack

Figure 3: Illustration of the data model evolution scenario “Rename Field” (left) and the corresponding round-trip migrationsM1 7→ M2 7→ M1 and M2 7→ M1 7→ M2 (right). Requested specifications for the latter are referred to as Task_2_M1_M2_M1 andTask_2_M2_M1_M2, respectively.

:Personname = ""age = 25

:Personname = ""age = 25

:Personname = "Alice"age = 25

:Personname = "Alice"age = 25

:Personname = "Alice"age = 25

:Personname = "Alice"age = 25

:Personname = "Alice"age = 25

:Personname = ""age = 25

:Personname = "Alice"age = 25

:Personname = "Alice"age = 25

:Personage = 25

:Personname = ""age = 25

:Personage = 25

:Personage = 25

Personname : String [?]age : Int

Personname : Stringage : Int

Instance modificaion

Figure 4: Illustration of the data model evolution scenario “Declare Field Optional/Mandatory” (left) and the correspondinground-trip migrations M1 7→ M2 7→ M1 and M2 7→ M1 7→ M2 (right). Requested specifications for the latter are referred to asTask_3_M1_M2_M1 and Task_3_M2_M1_M2, respectively. The lower example round-trip migration demonstrates how to dealwith instance modifications.

Page 5: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

Round-Trip Migration of Object-Oriented Data Model Instances TTC@STAF, 2020, Bergen, Norway

:Dogname = "Bob"

:Personname = "Alice"ybirth = 1995

:Dogname = "Bob"age = -1

:Personname = "Alice"age = 25

:Dogname = "Bob"

:Personname = "Alice"ybirth = 1995

:Dogname = "Bob"age = 2

:Personname = "Alice"age = 25

:Dogname = "Bob"

:Personname = "Alice"ybirth = 1995

:Dogname = "Bob"age = 2

:Personname = "Alice"age = 25

Dogname : String

Dogname : Stringage : Int

Personname : Stringybirth : Int

Personname : Stringage : Int

owner

owner

owner

owner

owner

owner

owner1

owner1

Figure 5: Illustration of the data model evolution scenario “Multiple Edits” (left) and the corresponding round-trip migrationsM1 7→ M2 7→ M1 and M2 7→ M1 7→ M2 (right). Requested specifications for the latter are referred to as Task_4_M1_M2_M1 andTask_4_M2_M1_M2, respectively.

The migration functions which are to be developed for this sce-nario should account for this semantic change and convert betweenproper values of fields age and ybirth. As illustrated in Figure 2(right), we assume the current date as a basis for the conversions inboth directions. In this case, the change in the semantics of age andybirth requires the integration of some user-defined arithmeticoperation during transformation. Purely structural approaches of-ten lack this feature, even though in our context of Web APIs thisis an important requirement.

3.3 Declare Field Optional/Mandatory −→

Task_3_M1_M2_M1 and Task_3_M2_M1_M2In this scenario, the multiplicity of a field is generalized (specialized)from 1 to 0..1 (0..1 to 1). The former case means that the field isdeclared to be optional, as indicated by the notation [?] attachedto field name inM2 of the data model shown in Figure 4 (left). Thelatter case is represented by the default notation used for all otherfields, meaning that the field is a mandatory one.

The key issue here is to deal with potential null-values inM2and their corresponding default values inM1. This is rather straight-forward in aM1 7→ M2 7→ M1 round-trip migration, as illustratedin Figure 4. Here, null-values inM2 may occur due to a modifica-tion of the migrated instance, and they should be translated to adefault value in M1. The M2 7→ M1 7→ M2 round-trip migrationis more complicated. Here, we have to check whether a defaultvalue has been synthesized during migration or through an explicitmodification. In the former case, as illustrated by the upper rightexample shown in Figure 4, a synthesized default value is migratedback to a null-value. In the latter case, illustrated by the lowerright example shown in Figure 4, the default value is the result ofan explicit modification inM1, which should be migrated back to

a default value instead of a null-value in M2. This evolution sce-nario is of special interest to us, since optional fields are a commonpattern used in the design and evolution of Web APIs.

3.4 Multiple Edits −→Task_4_M1_M2_M1 and Task_4_M2_M1_M2

In this evolution scenario, we combine two edit operations whichwe have already considered before. As we can see in Figure 5 (left),from anM1 toM2 perspective, the field age of class Dog has beendeleted, which corresponds to the edit operation considered in theevolution scenario presented in Section 3.1. At the same time, thename and semantics of field age of the referenced class Person hasbeen changed to ybirth, as in the evolution scenario presented inSection 3.2.

The correspondingM1 7→ M2 7→ M1 andM2 7→ M1 7→ M2 round-trip migrations are illustrated in Figure 5 (right). Their specificationcan be considered as a combination of the migration functionsrequired for the evolution scenarios presented in Section 3.2 andSection 3.1. The main aim of this scenario is to call for solutionsthat support some form of re-usability (see Section 4).

4 EVALUATION CRITERIATo evaluate the quality of the proposed solutions, we give a setof quality characteristics which we consider to be relevant for thespecification of round-trip migrations. We draw inspirations fromprevious work on defining quality attributes of model transfor-mations [8, 9, 21, 30]. We refine each quality characteristic intomeasurable attributes for each of the tasks presented in Section 3.To obtain concrete measures for their solutions, participants arekindly invited to use the evaluation framework provided with the

Page 6: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

TTC@STAF, 2020, Bergen, Norway Luca Beurer-Kellner, Jens von Pilgrim, and Timo Kehrer

case resources (see Section 5). This way, some of the measures canbe obtained in a semi-automated manner.

4.1 ExpressivenessA first important and rather obvious quality characteristic is theexpressiveness of the transformation language and system beingused to specify and execute round-trip migrations. Intuitively, themore data model evolution and according round-trip migrationscenarios are supported, the more expressive is the transformationapproach.

To turn this intuition into a measurable evaluation criterion, weassess the correctness of each task by providing sets of associatedtests. A test case comprises pairs of instances serving as input andas expected output of a round-trip migration. For each of the taskspresented in Section 3, a first test case is derived from the examplepresented in that section. A second test case is added in order toprevent literal encodings of solutions (except for the taks presentedin Section 3.3, which already has two associated test cases. A taskis considered to be solved correctly if it passes all tests.

All tasks are scored by means of the provided test cases. A pointis given for each passing test case, and points are summarized overall test cases. This means that all tasks are scored evenly betweenzero and two points. Zero means the task has not been tackled at all,one point indicates a partial solution, and two points mean that thetask has been solved and the transformation has been implementedcorrectly.

4.2 ComprehensibilitySpecifications of migration functions should be comprehensiblein order to be maintainable and to allow for better manual valida-tion. We acknowledge that such a classification is highly biasedby subjective preferences. Developers being familiar with modeltransformation languages such as Henshin or ATL most likely pre-fer a declarative or declarative-imperative style, while mainstreamweb developers will most likely prefer a purely imperative style ofwriting migrations.

Nonetheless, our idea of evaluating solutions is to compare theircomprehensibility with that of the provided reference solution (seeSection 6). For each task, the comprehensibility of the referencesolution is scored by one point. Better, equal and worse compre-hensibility of a submitted solution are acknowledged by by two,one and zero points, respectively.

There are two options for rating the comprehensibility of so-lutions. In the offline variant, we will use two distinct groups ofstudents to evaluate a solution by answering a small survey (mainlyabout functionality, similar to [23]). One group of students willhave a background on model transformation languages, while theother group is supposed to have only (basic) programming skills(in Java). The second variant is to conduct a live evaluation withthe TTC participants.

4.3 BidirectionalityBidirectional transformations (BX) [12] appear to be an attractivesolution to our problem as they support to synthesize migrationfunctions in both directions from a single specification. Such singlespecifications may be symmetric as, e.g., in the case of triple graph

grammars [26], or asymmetric as, e.g., in the case of putback-basedbidirectional programming [18].

Within this challenge, we do not insist on any particular mecha-nism for specifying bidirectional transformations, and all mecha-nisms are ranked equally. All tasks and extension tasks are scoredevenly with zero (no bidirectionality) or one point (support forbidirectionality).

4.4 Re-usabilityAs with any other kind of software, re-use mechanisms are anindispensable means to increase the productivity and quality ofmodel transformations. To that end, numerous re-use mechanismsfor model transformations have been proposed in the literature, asurvey may be found in [20]. We evaluate re-usability by meansof the “Multiple Edits” evolution scenario presented in Section 3.4since it subsumes the scenarios presented in sections 3.2 and 3.1.

One possible option is to achieve re-usability by means of delega-tion. Specifically, when developing migration functions supportingthe round-trip migration of Dog instances, this could be achieved by,e.g., delegating the migration of the referenced Person instancesto migration functions which have been already defined.

Another possible re-use mechanism could be to abstract fromthe concrete data models and to specify the required migrationfunctions in a generic manner, focusing on the conceptual partsof the respective edit operations. The generic migration functionswould then be instantiated for the concrete data model used in thisscenario. This is similar to the extraction of core transformationconcepts that generalize over several meta-models [27]. In the con-text of Web APIs, we see this as a core requirement of a feasibletransformation approach. In our setting, the continuous evolutionof a data model also implies the continuous development of a cor-responding migration layer. From a software engineering point ofview, a transformation approach should therefore provide supportfor re-usability. More specifically, s single change to the data modelshould require only one corresponding change to the migrationlayer, which implies that existing migration code can be re-used.

We do not insist on any particular re-use mechanism, and allre-use mechanisms are ranked equally. Support for re-usabilityis acknowledged by four points, while no points are given if thespecification has been developed from scratch.

4.5 PerformanceFinally, we evaluate the proposed solutions with regards to runtimeperformance. While the functional correctness of round-trip migra-tions is an important step towards a valid solution, the Web APIcontext also requires efficient solutions. The implementation of amore complex translation layer would be out of the scope of thischallenge. Therefore, as a limited evaluation of the runtime charac-teristics of the proposed solutions, we repeatedly run the round-tripmigrations required to support the evaluation scenarios describedin Section 3 for a large number of iterations and measure theirexecution time. In general however, we consider runtime perfor-mance a secondary evaluation criterion. Hence, differences amongproposed solutions with regards to runtime performance shall onlyserve as a tie-breaker among solutions which score equally for theother four criteria.

Page 7: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

Round-Trip Migration of Object-Oriented Data Model Instances TTC@STAF, 2020, Bergen, Norway

PerformanceTests

testPerformance()

AllFunctionalTests

task_1_M1_M2_M1()task_1_M2_M1_M2()...task_4_M2_M1_M2()

Task_4_M2_M1_M2... Task_4_M2_M1_M2Task_1_M1_M2_M1 Task_1_M2_M1_M2

«abstract»AbstractTask

AbstractTask(EPackage M1, EPackage M2)migrate(EObject instance) : EObjectmigrateBack(EObject instance) : EObject

JavaTaskFactory

«abstract»AbstractTaskFactory

createTask(TaskInfo info, EPackage M1, EPackage M2)

«enumeration»TaskInfo

TASK_1_M1_M2_M1TASK_1_M2_M1_M2...TASK_4_M2_M1_M2

«abstract»AbstractBenchmarkTests

init()

«instantiate»

«use»«use»

Figure 6: Evaluation framework architecture (top) and integration of the Java-based reference solution (bottom).

5 EVALUATION FRAMEWORKGeneral architecture. Tests in our evaluation framework may be

run as JUnit tests. The abstract class AbstractBenchmarkTestsserves as a base class for all concrete tests (see below), doing somebasic initialization. As illustrated by the architectural overviewshown in Figure 6, the class AbstractBenchmarkTests takes theclient role of an implementation of the Abstract Factory design pat-tern [7], the classes AbstractTaskFactory and AbstractTask aresupposed to encapsulate concrete solutions. That is, for each of theeight tasks presented in Section 3, solution providers who wantto use our evaluation framework are asked to provide a concretesubclass of AbstractTask which is to be instantiated by a con-crete subclass of AbstractTaskFactory. The class AbstractTaskdefines the signatures of the two central migration functions calledmigrate and migrateBack, respectively. The idea is that migrateand migrateBack then delegate the actual transformation task tothe model transformation system used in a concrete solution.

Functional tests vs. performance tests. All test cases for assessingthe correctness of each of the eight tasks presented in Section 3 maybe run as JUnit tests which are collected in the Java class calledAllFunctionalTests. Each test method, i.e., task_1_M1_M2_M1()through task_4_M2_M1_M2(), executes a particular task and checkswhether for a given input models the obtained output model looksas expected.

A performance test is provided by the class PerformanceTests.There is only one test method, called testPerformance() whichproceeds as follows: Similarly, to the functional test cases, the testrelies on the correct implementation of the AbstractTaskFactoryand AbstractTask. During performance testing, all test cases pro-vided for the four evaluation scenarios are executed repeatedly.That is, a full round-trip migration, involving calls to migrate and

migrateBack is performed. After a certain number of warm-up it-erations, this test loop is repeated for a total of 2 million repetitions.The test method measures execution with the increasing numberof repetitions and stores the results into the file results.csv atthe root of the solution’s bundle. See the provided code reposi-tory of the evaluation framework regarding plotting scripts for theresulting data.

Registration of a concrete task factory. In order to register a con-crete subclass of AbstractTaskFactory, solution providers mayuse the Eclipse extension point mechanism. Concrete task factoriescan be registered through the extension point

de.hub.mse.ttc2020.benchmark.concretetaskfactory.

Please note that, in this case, the classes AllFunctionalTests andPerformanceTests need to be run as JUnit Plug-In Test. Alterna-tively, solution providers may subclass AllFunctionalTests andPerformanceTestswhich can be then run as a normal JUnit test. Inthis case, the initmethod of this concrete subclasses must take careof instantiating the concrete task factory. Our reference solution(see Section 6) implements both options for the sake of illustration.

Test data. Finally, since many model transformation tools avail-able in the model transformation research community are basedon the Eclipse Modeling technology stack, we provide implementa-tions of the data models used in the evolution scenarios presentedin Section 3 in EMF Ecore. Consequently, instances serving as testdata for assessing the correctness of transformation tasks are rep-resented as EMF instances (often referred to as instance models inthe EMF community). Checking the equivalence of an actual andexpected round-trip migration result is performed using the modelcomparison tool EMF Compare [4].

Page 8: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

TTC@STAF, 2020, Bergen, Norway Luca Beurer-Kellner, Jens von Pilgrim, and Timo Kehrer

Table 1: Evaluation results obtained for the Java-based reference solution. Numbers in brackets indicate the maximum scorethat can be achieved.

Expressiveness Comprehensibility Bidirectionality Re-usability

Evolution Scen. “Create/Delete Field”Task_1_M1_M2_M1 2 (2) 1 (2) 0 (1) n.a.Task_1_M2_M1_M2 2 (2) 1 (2) 0 (1) n.a.

Evolution Scen. “Rename Field”Task_2_M1_M2_M1 2 (2) 1 (2) 0 (1) n.a.Task_2_M2_M1_M2 2 (2) 1 (2) 0 (1) n.a.

Evolution Scen. “Declare Field Optional/Mandatory”Task_3_M1_M2_M1 2 (2) 1 (2) 0 (1) n.a.Task_3_M2_M1_M2 2 (2) 1 (2) 0 (1) n.a.

Evolution Scen. “Multiple Edits”Task_4_M1_M2_M1 2 (2) 1 (2) 0 (1) 0 (4)Task_4_M2_M1_M2 2 (2) 1 (2) 0 (1) 0 (4)∑

: 16 (16)∑: 8 (16)

∑: 0 (8)

∑: 0 (8)

6 REFERENCE SOLUTIONTo provide a reference solution for this case, we implemented all themigration functions which are required to support the 8 round-tripmigration tasks arising from our four data model evolution scenar-ios presented in Section 3 in Java. Its integration into the evaluationframework presented in Section 5 is illustrated in Figure 6 (bottom).Each task is realized by a concrete subclass of class AbstractTask,each of which is being instantiated by the concrete task factorycalled JavaTaskFactory. None of the migrations is delegated toa dedicated model transformation system, but the migration func-tions migrate and migrateBack are directly implemented in Java.

Qualitative evaluation results. Table 1 summarizes the qualitativeevaluation results for for our Java-based reference solution, namelyfor the criteria expressiveness, comprehensibility, bidirectionalityand re-usability. On the one hand, it is not surprising that a generalpurpose programming language like Java is expressive enoughto correctly solve all the tasks provided with this case. Thus, thereference solution achieves the maximum score in this category,i.e., two points per task summarizing to 16 points in total. On theother hand, bidirectionality and re-usability are not supported atall.

Performance results. Figure 7 illustrates the runtime character-istics of our reference solution. These results were obtained on aMid-2014 MacBook Pro with an Intel Core i5 processor running at2,6 GHz and 8 gigabytes of main memory. As expected, the timeconsumed to perform the round-trip migrations grows linearly withthe number of iterations. It takes about 40 seconds to perform allthe 2 million iterations of our performance test.

7 SUMMARY AND OUTLOOKIn this paper, we outlined our vision of a so-called translation layerwhich supports the communication of web-based services in differ-ent, incompatible versions. One of the key tasks of implementing

0 250000 500000 750000 1000000 1250000 1500000 1750000 2000000No. of Repetitions

0

5000

10000

15000

20000

25000

30000

35000

40000Ru

ntim

e (m

s)Total Transformation Runtime

Figure 7: The performance results of our provided referencesolution.

such a translation layer is to support the round-trip migration of in-stances of object-oriented data models in different versions. In thischallenge description, we phrased this as a model transformationproblemwhich, in contrast to previous TTC cases on the same topic,is driven by the needs and specifics of our application context. Weare convinced that modern model transformation technologies suchas Henshin [29], VIATRA [32] or ATL [15] are capable of solvingthe challenge in an elegant way. In particular, solutions to the TTC2017 “Families to Persons Case” [13, 14, 25, 35] may be adapted toour case with moderate effort.

One of the next steps to further extend this challenge couldbe to study more evolution scenarios than the four considered inthis paper. Moreover, we could think of a (semi-)automated specifi-cation of the required round-trip migration functions. Again, weare convinced that technologies from the field of model-drivenengineering, notably techniques for model matching [16, 19] anddifferencing [17], can serve as starting point for such automation.

Page 9: Round-Trip Migration of Object-Oriented Data Model InstancesWhile this relieves developers from an instant migration of the system components including the ... such as Liquibase [22]

Round-Trip Migration of Object-Oriented Data Model Instances TTC@STAF, 2020, Bergen, Norway

REFERENCES[1] Thomas Buchmann Anthony Anjorin and Bernhard Westfechtel. 2017. The

Families to Persons Case. In Proceedings of the 10th Transformation Tool Contest,a part of the Software Technologies: Applications and Foundations (STAF 2017)federation of conferences.

[2] Gavin Bierman, Matthew Parkinson, and James Noble. 2008. UpgradeJ: Incre-mental Typechecking for Class Upgrades. In ECOOP.

[3] Enrico Biermann, Claudia Ermel, and Gabriele Taentzer. 2012. Formal foundationof consistent EMF model transformations by algebraic graph transformation.Software & Systems Modeling 11, 2 (2012).

[4] Cédric Brun and Alfonso Pierantonio. 2008. Model differences in the eclipse mod-eling framework. UPGRADE, The European Journal for the Informatics Professional9, 2 (2008), 29–34.

[5] M. Dmitriev and M. Atkinson. 1999. Evolutionary Data Conversion in the PJamaPersistent Language. In 1st ECOOP Workshop on Object Oriented Databases.

[6] Tiago Espinha, Andy Zaidman, and Hans-Gerhard Gross. 2014. Web API growingpains: Stories from client developers and their code. In Intl. Conf. on SoftwareMaintenance, Reengineering, and Reverse Engineering.

[7] Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1993. Designpatterns: Abstraction and reuse of object-oriented design. In European Conferenceon Object-Oriented Programming. Springer, 406–431.

[8] Christine M Gerpheide, Ramon RH Schiffelers, and Alexander Serebrenik. 2014.A bottom-up quality model for QVTO. In Int. Conference on the Quality of Infor-mation and Communications Technology. IEEE, 85–94.

[9] Sinem Getir, Duc Anh Vu, Francois Peverali, Daniel Strüber, and Timo Kehrer.2017. State Elimination as Model Transformation Problem.. In TTC@ STAF.65–73.

[10] Regina Hebig, Djamel Eddine Khelladi, and Reda Bendraou. 2017. Approaches toco-evolution of metamodels and models: A survey. IEEE Transactions on SoftwareEngineering 43, 5 (2017).

[11] Reiko Heckel, Jochen Malte Küster, and Gabriele Taentzer. 2002. Confluence oftyped attributed graph transformation systems. In International Conference onGraph Transformation. Springer, 161–176.

[12] Soichiro Hidaka, Massimo Tisi, Jordi Cabot, and Zhenjiang Hu. 2016. Feature-based classification of bidirectional transformation approaches. Software &Systems Modeling 15, 3 (2016), 907–928.

[13] Georg Hinkel. 2017. An NMF Solution to the Families to Persons Case at the TTC2017. In Proceedings of the 10th Transformation Tool Contest (TTC 2017) (CEURWorkshop Proceedings), Vol. 2026. 35–39.

[14] Tassilo Horn. 2017. Solving the TTC Families to Persons Case with FunnyQT. InProceedings of the 10th Transformation Tool Contest (TTC 2017) (CEUR WorkshopProceedings), Vol. 2026. 47–51.

[15] Frédéric Jouault and Ivan Kurtev. 2005. Transforming models with ATL. InInternational Conference on Model Driven Engineering Languages and Systems.Springer, 128–138.

[16] Timo Kehrer, Udo Kelter, Pit Pietsch, and Maik Schmidt. 2012. Adaptabilityof model comparison tools. In Proceedings of the 27th IEEE/ACM InternationalConference on Automated Software Engineering. ACM, 306–309.

[17] Timo Kehrer, Udo Kelter, and Gabriele Taentzer. 2011. A rule-based approachto the semantic lifting of model differences in the context of model versioning.In 26th IEEE/ACM International Conference on Automated Software Engineering.IEEE, 163–172.

[18] Hsiang-Shang Ko, Tao Zan, and Zhenjiang Hu. 2016. BiGUL: a formally verifiedcore language for putback-based bidirectional programming. In Proceedings of the2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation.61–72.

[19] Dimitrios S Kolovos, Davide Di Ruscio, Alfonso Pierantonio, and Richard F Paige.2009. Different models for model matching: An analysis of approaches to supportmodel differencing. In ICSE Workshop on Comparison and Versioning of SoftwareModels. IEEE, 1–6.

[20] Angelika Kusel, Johannes Schönböck, Manuel Wimmer, Gerti Kappel, WernerRetschitzegger, and Wieland Schwinger. 2015. Reuse in model-to-model transfor-mation languages: are we there yet? Software & Systems Modeling 14, 2 (2015),537–572.

[21] Kevin Lano, Krikor Maroukian, and Sobhan Yassipour Tehrani. 2014. Case study:FIXML to Java, C# and C++.. In TTC@STAF. 2–6.

[22] Liquibase [n.d.]. Liquibase, Project Page. https://www.liquibase.org/.[23] Ariadi Nugroho. 2009. Level of detail in UML models and its impact on model

comprehension: A controlled experiment. Information and Software Technology51, 12 (2009), 1670 – 1685.

[24] Erhard Rahm and Philip A Bernstein. 2006. An online bibliography on schemaevolution. ACM Sigmod Record 35, 4 (2006).

[25] Leila Samimi-Dehkordi, Bahman Zamani, and Shekoufeh Kolahdouz Rahimi.2017. Solving the Families to Persons Case Using EVL+Strace. In Proceedings ofthe 10th Transformation Tool Contest (TTC 2017) (CEUR Workshop Proceedings),Vol. 2026. 54–62.

[26] Andy Schürr. 1994. Specification of graph translators with triple graph gram-mars. In International Workshop on Graph-Theoretic Concepts in Computer Science.Springer, 151–163.

[27] Sagar Sen, Naouel Moha, Vincent Mahé, Olivier Barais, Benoit Baudry, andJean-Marc Jézéquel. 2012. Reusable model transformations. Software & SystemsModeling 11, 1 (2012), 111–125.

[28] SM Sohan, Craig Anslow, and Frank Maurer. 2015. A case study of web APIevolution. In IEEE World Congress on Services.

[29] Daniel Strüber, Kristopher Born, Kanwal Daud Gill, Raffaela Groner, Timo Kehrer,Manuel Ohrndorf, and Matthias Tichy. 2017. Henshin: A usability-focused frame-work for emf model transformation development. In International Conference onGraph Transformation. Springer, 196–208.

[30] Eugene Syriani and Jeff Gray. 2012. Challenges for addressing quality factorsin model transformation. In Int. Conference on Software Testing, Verification andValidation. IEEE, 929–937.

[31] Edith Tom, AybüKeAurum, and Richard Vidgen. 2013. An exploration of technicaldebt. Journal of Systems and Software 86, 6 (2013).

[32] Dániel Varró and András Balogh. 2007. The model transformation language of theVIATRA2 framework. Science of Computer Programming 68, 3 (2007), 214–234.

[33] Shaohua Wang, Iman Keivanloo, and Ying Zou. 2014. How Do Developers Reactto RESTful API Evolution?. In Intl. Conf. on Service-Oriented Computing.

[34] Erik Wittern. 2018. Web APIs - Challenges, Design Points, and Research Oppor-tunities. In 2nd Intl. Workshop on API Usage and Evolution.

[35] Albert Zündorf and Alexander Weidt. 2017. The SDMLib Solution to the TTC2017 Families 2 Persons Case. In Proceedings of the 10th Transformation ToolContest (TTC 2017) (CEUR Workshop Proceedings), Vol. 2026. 41–45.