a survey on incremental model transformation...
TRANSCRIPT
1 Funding: BRIDGE 832160
www.model-evolution.net
Dept. of Cooperative Information Systems Johannes Kepler University Linz
http://www.cis.jku.at
Business Informatics Group Vienna University of Technology
http://www.big.tuwien.ac.at
LieberLieber Software GmbH http://www.lieberlieber.com
A Survey on Incremental Model Transformation Approaches
Models and Evolution Workshop, Miami, Florida, Sept. 30th 2013
A. Kusel, Jürgen Etzlstorfer, E. Kapsammer, P. Langer, W. Retschitzegger, J. Schönböck,
W. Schwinger, M. Wimmer
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
2 www.model-evolution.net
• Model transformations allow to generate models out of other models
• Evolution entails re-execution of model transformations • Batch transformations generate complete target models
each time the transformation is (re-)executed • In contrast, incremental model transformations propagate
changes in the source model to the target model, only – Rather depend on size of changes than on size of the source model – Especially useful for frequent changes in large source models
Need for Incremental Model Transformations
Source Metamodel Target Metamodel Transformation Definition
Source Model Target Model Transformation Engine
refers to
reads
refers to
writes conforms to conforms to executes
Batch Transformation Incremental Transformation
Recent approaches for incremental model transformations
differ substantially
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
3 www.model-evolution.net
Execution Engine
Motivating Example
NamedElement name : String
Classifier
DataType
Class persistent:boolean
Attribute multivalued:boolean
Named name : String
Table
Column
Type type
col
type
attr
c1: Class name="Person" persistent=true
a1 : Attribute name="Name"
multivalued=false
a2 : Attribute name="Address" multivalued=false
d1 : DataType name="String"
t1: Table name="Person"
c1 : Column name="Name"
c2 : Column name="Address"
d1 : Type name="String"
Source Model
Target Model
Target Metamodel
Source Metamodel
conforms to conforms to
abstract rule NamedEl2Named { from n : ClassD!NamedElement to t : Relational!Named ( name <- n.name )
} rule Class2Table extends NamedEl2Named {
from c : ClassD!Class (c.persistent) to t: Relational!Table ( col <- c.attr->select(e | not e.multiValued) ->subSequence(1,2) )
} rule Attribute2Column extends NamedEl2Named {
from a : ClassD!Attribute (not a.multivalued) to t: Relational!Column ( type <- a.type )
}
TraceLink
TraceLink
TraceLink
TraceLink
"Fullname"
"Fullname"
How is incrementality achieved?
executes
Model2Model Trace
Change in the source model
Change is propagated to target model
Transformation Specification
(ATL Code) Which language parts are supported for incremental
transformation?
How much overhead is imposed by incrementality?
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
4 www.model-evolution.net
Evaluation Framework Overview
Evaluation Framework
Language Coverage
Execution Phases Overhead
• Declarative Language Parts • Imperative Language Parts
• Change Detection • Impact Analysis • Change Propagation
• Specification • Run-time • Memory
8 approaches have been examined
8 approaches have been examined
8 approaches have been examined
Approach Giese et al., 2008
Lauder et al., 2012
Hearnden et al., 2006
Jouault and Tisi, 2010
Rath et al., 2008
Bergmann et al., 2012a
Bergmann et al., 2012b
Razavi et al., 2009
Language TGG TGG Te*at ATL Viatra2 Viatra2 Viatra2 Arbitrary
How is incrementality achieved?
Which language parts are supported for incremental
transformation?
How much overhead is imposed by incrementality?
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
5 www.model-evolution.net
rule Attribute2Column extends NamedEl2Named { from a : ClassD!Attribute (not a.multiValued) to t: Relational!Column ( type <- a.type )
}
Execution Engine
Language Coverage
c1: Class name=Person persistent=true
a1 : Attribute name=Fullname
multivalued=false
a2 : Attribute name=Address
multivalued=false a3 : Attribute name=Age
multivalued=false
t1: Table name=Person
c1 : Column name=Fullname
c2 : Column name=Address
c3 : Column name=Age
true
TraceLink
TraceLink
TraceLink
TraceLink
helper def : id : Integer = 0; abstract rule NamedEl2Named {
from n : ClassD!NamedElement to t : Relational!Named ( name <- n.name )
} rule Class2Table extends NamedEl2Named {
from c : ClassD!Class (c.persistent) to t: Relational!Table ( col <- c.attr->select(e | not e.multiValued) ->subSequence(1,2) ) do { thisModule.id <- thisModule.id + 1; }
} ATL Code
Source Model Target Model Trace Model
DeclaraFve Language Parts • Number of Input Elements • Number of Output Elements • Assignments • Rule Inheritance • CondiBons ImperaFve Language Parts
Giese, 2008
Lauder, 2012
Hearnden, 2006
Jouault, 2010
Rath, 2008
Bergmann, 2012a
Bergmann, 2012b
Razavi, 2009
TGG TGG Te*at ATL Viatra2 Viatra2 Viatra2 Arbitrary
1..* 1..* 1..* 1 1..* 1..* 1..* 1
1..* 1..* 1..* 1..* 1..* 1..* 1..* 1 ü ü ü ü ü ü ü ü -‐ -‐ -‐ -‐ n.a. n.a. n.a. ü ü ü ü ü ü ü ü -‐
n.a. n.a. n.a. -‐ ü ü ü ~
Insufficient Support for Imperative
Language Parts
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
6 www.model-evolution.net
Evaluation Framework
Evaluation Framework
Language Coverage
Execution Phases Overhead
• Declarative Language Parts • Imperative Language Parts
• Change Detection • Impact Analysis • Change Propagation
• Specification • Run-time • Memory
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
7 www.model-evolution.net
Change Detection
Change DetecFon • Source Minimality • Type & Number of Changes
• Insert • Delete • Update • Move
• Granularity • Object • Value • Link
• Change Log OpBmizaBon
c1: Class name="Person" persistent=true
a1 : Attribute name="Fullname" multivalued=false
a2 : Attribute name="Address" multivalued=false
a3 : Attribute name="Age"
multivalued=false
Giese, 2008
Lauder, 2012
Hearnden, 2006
Jouault, 2010
Rath, 2008
Bergmann, 2012a
Bergmann, 2012b
Razavi, 2009
TGG TGG Te*at ATL Viatra2 Viatra2 Viatra2 Arbitrary ü ü ü ü ü ü ü ü
1..* 1..* 1 1 1..* 1..* 1 1 1..* 1..* 1 1 1..* 1..* 1 1 1..* -‐ -‐ 1 1..* 1..* 1 1 -‐ -‐ -‐ -‐ -‐ 1..* -‐ -‐
ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü ü -‐ n.a. n.a. ü -‐ n.a. n.a.
Execution Engine
t1: Table name="Person"
c1 : Column name="Fullname"
c2 : Column name="Address"
d1 : Type name=String
Target Model
(i) Detect single changes (ii) Detect mul8ple changes
(i) Detect on course-‐grained level (ii) Detect on fine-‐grained level
Source Model
(i) Compare to previous version of model to detect changes (ii) Listen for changes
Focus on Basic Change Opera8ons
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
8 www.model-evolution.net
abstract rule NamedEl2Named { from n : ClassD!NamedElement to t : Relational!Named ( name <- n.name )
} rule Class2Table extends NamedEl2Named {
from c : ClassD!Class (c.persistent) to t: Relational!Table ( col <- c.attr->select(e | not e.multiValued) ->subSequence(1,2) )
} rule Attribute2Column extends NamedEl2Named {
from a : ClassD!Attribute (not a.multivalued) to t: Relational!Column ( type <- a.type )
}
Execution Engine
Impact Analysis
c1: Class name="Person" persistent=true
a1 : Attribute name="Fullname" multivalued=false
a2 : Attribute name="Address" multivalued=false
d1 : DataType name="String"
t1: Table name="Person"
c1 : Column name="Fullname"
c2 : Column name="Address"
d1 : Type name="String"
Source Model Target Model
TraceLink TraceLink TraceLink TraceLink
Impact Analysis • Required Knowledge of TransformaBon SpecificaBon • Black Box • White Box
• Trace • Model2Model • Model2TransformaBon
• Compile-‐Time • Run-‐Time
• Auxiliary InformaBon
TraceLink TraceLink TraceLink
-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐
Auxiliary Information
Model2Model Trace
Model2Transformation Trace
(i) Black Box (ii) White Box
ATL Code
e.g. o) Compiler-‐generated rules o) Database tables
compiler generated rule: Relation!Column. set_Attribute2Column_t_name(a1)
Giese, 2008
Lauder, 2012
Hearnden, 2006
Jouault, 2010
Rath, 2008
Bergmann, 2012a
Bergmann, 2012b
Razavi, 2009
TGG TGG Te*at ATL Viatra2 Viatra2 Viatra2 Arbitrary
-‐ -‐ -‐ -‐ -‐ -‐ -‐ ü ü ü ü ü ü ü ü -‐
ü ü ü ü ü ü ü ü
-‐ -‐ -‐ ü -‐ -‐ ü -‐ ü ü ü ü ü ü ü -‐ -‐ -‐ SLDNF
tree Compiler Generated Rules
-‐ Change History Models
Database Tables
Concept Pool
Trace Informa8on is Mandatory
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
9 www.model-evolution.net
t1: Table name="Person"
c1 : Column name="Fullname"
c2 : Column name="Address"
d1 : Type name="String"
Change Propagation
Change PropagaFon • Time
• Eager (Synchron) • Lazy (Asynchron)
• Coverage • ParBal • Complete
• Granularity • Coarse (Rule) • Fine (Binding)
• DirecBon • UnidirecBonal • BidirecBonal
• Strategy
Execution Engine
c1: Class name="Person" persistent=true
a1 : Attribute name="Fullname" multivalued=false
a2 : Attribute name="Address" multivalued=false
d1 : DataType name="String"
Source Model Target Model
abstract rule NamedEl2Named { // ...
} rule Class2Table extends NamedEl2Named {
// ... } rule Attribute2Column
extends NamedEl2Named { from a : ClassD!Attribute (not a.multivalued) to t: Relational!Column ( name <- a.name )
}
(i) Propagate changes when they occur (ii) Propagate changes when affected model elements are accessed
(i) Propagate parts of the changes (ii) Propagate all changes
(i) Propagate from source to target (ii) Propagate in both direc8ons (i) Support different strategies
(ii) Automa8cally select strategies
ATL Code
Giese, 2008
Lauder, 2012
Hearnden, 2006
Jouault, 2010
Rath, 2008
Bergmann, 2012a
Bergmann, 2012b
Razavi, 2009
TGG TGG Te*at ATL Viatra2 Viatra2 Viatra2 Arbitrary
ü ü ü ü ü -‐ ü ü -‐ -‐ -‐ -‐ -‐ ü -‐ -‐
-‐ -‐ -‐ -‐ -‐ -‐ ü ü ü ü ü ü ü ü ü
ü ü -‐ -‐ ü ü ü n.a. -‐ -‐ ü ü -‐ -‐ -‐ n.a.
-‐ -‐ ü ü ü ü ü -‐ ü ü -‐ -‐ -‐ -‐ -‐ ü 1 1 1 1 2 (manual) 1 1 1
Lack of Appropriate Propaga8on Strategies
(i) Re-‐execute complete rule (ii) Re-‐execute bindings only
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
10 www.model-evolution.net
Evaluation Framework
Evaluation Framework
Language Coverage
Execution Phases Overhead
• Declarative Language Parts • Imperative Language Parts
• Change Detection • Impact Analysis • Change Propagation
• Specification • Run-time • Memory
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
11 www.model-evolution.net
cdrule propagateUpdate (A) = { guard change pattern (); postcondition pattern newAttr () = { // ... }
} Viatra2 Code t1: Table
name="Person"
c1 : Column name="Fullname"
c2 : Column name="Address"
d1 : Type name="String"
c1: Class name="Person" persistent=true
a1 : Attribute name="Fullname" multivalued=false
a2 : Attribute name="Address" multivalued=false
d1 : DataType name="String"
Model2 Transformation
Trace
-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐
Auxiliary Information
Overhead
Overhead • No SpecificaBon Overhead • No Run-‐Bme Overhead • No Memory Overhead
rule Class2Table { // ...
} rule Attribute2Column {
// ... } rule DataType2Type {
// ... } @Trigger(priority=’10’, mode=’always’, sensitivity=’rise ’) gtrule Attribute2Column() = { // ... }
ATL Code
Viatra2 Code
Execution Engine
Source Model Target Model
Model2 Model Trace
(i) Genera8on of trace informa8on (ii) Maintaining trace informa8on
Giese, 2008
Lauder, 2012
Hearnden, 2006
Jouault, 2010
Rath, 2008
Bergmann, 2012a
Bergmann, 2012b
Razavi, 2009
TGG TGG Te*at ATL Viatra2 Viatra2 Viatra2 Arbitrary ü ü ü ü ü -‐ -‐ ü ü ü unknown unknown unknown ü unknown unknown -‐ -‐ -‐ -‐ -‐ -‐ -‐ -‐
(i) Model2Model Trace (ii) Model2Transforma8on Trace (iii) Auxiliary Informa8on
(i) Model2Model Trace (ii) Model2Transforma8on Trace (iii) Auxiliary Informa8on
(i) Model2Model Trace (ii) Model2Transforma8on Trace (iii) Auxiliary Informa8on
(i) No Specifica8on Overhead (ii) Annota8ons (iii) New Specifica8on
(i) No Specifica8on Overhead (ii) Annota8ons (iii) New Specifica8on
(i) No Specifica8on Overhead (ii) Annota8ons (iii) New Specifica8on
Trade-‐off between space and 8me
Motivation n Language Coverage n Execution Phases n Overhead n Lessons Learned
12 www.model-evolution.net
Lessons Learned
Evaluation Framework
Language Coverage
Execution Phases Overhead
• Declarative Language Parts • Imperative Language Parts
• Change Detection • Impact Analysis • Change Propagation
• Specification • Run-time • Memory
Insufficient Support for Impera8ve Parts
Focus on Basic Change Opera8ons
Trace Informa8on is Mandatory
Lack of Appropriate Propaga8on Strategies
Lack of Proof of Correctness
13 Funding: BRIDGE 832160
www.model-evolution.net
Dept. of Cooperative Information Systems Johannes Kepler University Linz
http://www.cis.jku.at
Business Informatics Group Vienna University of Technology
http://www.big.tuwien.ac.at
LieberLieber Software GmbH http://www.lieberlieber.com
Thank you!
Jürgen Etzlstorfer [email protected]
14 www.model-evolution.net
• [Giese2008] Giese, H., Hildebrandt, S.: Incremental Model Synchronization for Multiple Updates. In: 3rd Int. Workshop on Graph and Model Transformations. ACM (2008)
• [Lauder2012] Lauder, M., Anjorin, A., Varró, G., Schürr, A.: Efficient Model Synchronization with Precedence Triple Graph Grammars. In: 6th Int. Conf. on Graph Transformations. Springer (2012)
• [Hearnden2006] Hearnden, D., Lawley, M., Raymond, K.: Incremental Model Transformation for the Evolution of Model-Driven Systems. In: 9th Int. Conf. on Model Driven Engineering Languages and Systems. Springer (2006)
• [Jouault2010] Jouault, F., Tisi, M.: Towards Incremental Execution of ATL Transformations. In: 3rd Int. Conf. on Theory and Practice of Model Transformations. Springer (2010)
• [Rath2008] Rath, I., Bergmann, G., Okrös, A., Varr´ o, D.: Live Model Transformations Driven by Incremental Pattern Matching. In: 1st Int. Conf. on Theory and Practice of Model Transformations. Springer (2008)
• [Bergmann2012a] Bergmann, G., Ráth, I., Varró, G., Varró, D.: Change-driven model transformations. SoSym 11(3) (Jul 2012)
• [Bergmann2012b] Bergmann, G., Horváth, D., Horv´ ath, A.: Applying Incremental Graph Transformation to Existing Models in Relational Databases. In: 6th Int. Conf. on Graph Transformations. Springer (2012)
• [Razavi2009] Razavi, A., Kontogiannis, K., Brealey, C., Nigul, L.: Incremental Model Synchronization in Model Driven Development Environments. In: Conf. of the Center f. Adv. Studies on Collab. Research. IBM (2009)
References