Adaptable Model Versioning using Model Transformation By Demonstration
-
Upload
philip-langer -
Category
Technology
-
view
566 -
download
1
description
Transcript of Adaptable Model Versioning using Model Transformation By Demonstration
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna, Austria phone: +43 (1) 58801-18804 (secretary), fax: +43 (1) 58801-18896 [email protected], www.big.tuwien.ac.at
Adaptable Model Versioning using Model Transformation By Demonstration
PhD Defense
Vienna, 21st of December 2011
Philip Langer
Introduction
2
Context Adaptable Model Versioning
Introduction
3
Adaptable Model Versioning
Developer 1
Developer 2 Vo
Vo
t1
Vr1
Vr2
t2 t3
Check Out
Check Out
Check In
Check In
Repository
t0
Merge Process
Vm
Managing the evolution of software artifacts performed by a distributed team.
Introduction
4
Developer 1
Developer 2 Vo
Vo
t1
Vr1
Vr2
t2 t3
Check Out
Check Out
Check In
Check In
Repository
t0
Merge Process
Vm
Adaptable Model Versioning Software models in the context of model-driven engineering.
Introduction
5
Impedance Mismatch
Adaptable Model Versioning
Introduction
6
Deficiencies of existing model versioning systems Modeling editor/language-specific vs. imprecise versioning
Tightly bound to a specific modeling editor or modeling language Generic and unaware of the specifics of modeling languages
Specification of composite operations (e.g., refactorings)
Currently very challenging task Requires specific knowledge which untrained users don’t have
Absence of information on applied composite operations
Operation recording inherently puts restrictions on the modeling editor Model differencing no support for detecting composite operations
Insufficient conflict detection
Composite operations are not considered Important types of conflicts and warnings are neglected
Adaptable Model Versioning
P. Brosch, G. Kappel, P. Langer, M. Seidl, K. Wieland, and M. Wimmer. “The Past, Present, and Future of Model Versioning”, in Emerging Technologies for the Evolution and Maintenance of Software Models. IGI Global, 2011.
Introduction
7
Generic but adaptable model versioning Supporting all EMF*-based modeling languages Adaptation points to incorporate language specifics Advantages of generic and language-specific versioning systems
AMOR project
Funded by FFG FIT-IT Semantic Systems Gerti Kappel, Martina Seidl, Manuel Wimmer,
Petra Brosch, Horst Kargl, Philip Langer, Werner Retschitzegger, Wieland Schwinger, and Konrad Wieland
Adaptable Model Versioning
* Eclipse Modeling Framework (EMF)
Introduction
8
AMOR merge process
Res
olut
ion
Ope
ratio
n D
etec
tion
Ope
ratio
n-ba
sed
C
onfli
ct D
etec
tion
Con
flict
-tole
rant
M
erge
Stat
e-ba
sed
Con
flict
Det
ectio
n
Vo
Vr1
Vr2
Vm
Adaptable Model Versioning
P. Brosch, G. Kappel, M. Seidl, K. Wieland, M. Wimmer, H. Kargl, and P. Langer. “Adaptable Model Versioning in Action”. In Modellierung’2010, volume 161 of LNI, pages 221–236. GI, 2010.
Introduction
9
Focus of this dissertation
Res
olut
ion
Ope
ratio
n D
etec
tion
Ope
ratio
n-ba
sed
C
onfli
ct D
etec
tion
Con
flict
-tole
rant
M
erge
Stat
e-ba
sed
Con
flict
Det
ectio
n
Vo
Vr1
Vr2
Vm
Adaptable Model Versioning
Motivating Examples
10
Violated Preconditions of Composite Operations
Introduce Composite
State
Rename “hangup”
Add state “Active”, Move states
into “Active”, fold transition
“hangup”
Rename “hangup”
dial
Motivating Examples
11
Violated Preconditions of Composite Operations
Introduce Composite
State
Rename “hangup”
The preconditions of the refactoring “Introduce Composite State” are violated!
dial
Contributions at a Glance
12
Adaptable Model Versioning using Model Transformation By Demonstration
Operation Specifications
Match Rules
Signifier Specifications
Res
olut
ion
Ope
ratio
n D
etec
tion
Ope
ratio
n-ba
sed
C
onfli
ct D
etec
tion
Con
flict
-tole
rant
M
erge
Stat
e-ba
sed
Con
flict
Det
ectio
n
Adaptation Artifacts
C3 C4 C4
C4 C2
Validation Rules
Adaptable Model Versioning Framework
Vo
Vr1
Vr2
Vm
C1
C1
C2
C3
C4
Adaptable Model Versioning Framework Composite Operation Specification “Model Transformation By Demonstration”
Operation Detection
Conflict and Warning Detection
Existing technology has been reused.
Model Transformation By Demonstration
13
Composite operation specification
Initialmodel
Working modelCreate initial model Copy initial model
Perform updates
State-basedcomparison
Diffmodel
Imply conditions
Edit conditions
Conditions[implied]
Generate Operation Specification
Operation Specification
Revisedmodel
Conditions[revised]
Mod
elin
gCo
nfig
urat
ion
& G
ener
atio
n
1 2
3
5 4
6
7
automatic
manual
Legend
P. Brosch, P. Langer, M. Seidl, K. Wieland, M. Wimmer, G. Kappel, W. Retschitzegger, and W. Schwinger. “An Example Is Worth a Thousand Words: Composite Operation Modeling By-Example”. In Proceedings of the International Conference on Model Driven Engineering Languages and Systems (MoDELS’09), LNCS. Springer, 2009.
C2
Model Transformation By Demonstration
14
Composite operation specification
Initialmodel
Working modelCreate initial model Copy initial model
Perform updates
State-basedcomparison
Diffmodel
Imply conditions
Edit conditions
Conditions[implied]
Generate Operation Specification
Operation Specification
Revisedmodel
Conditions[revised]
Mod
elin
gCo
nfig
urat
ion
& G
ener
atio
n
1 2
3
5 4
6
7
automatic
manual
Legend
C2
Model Transformation By Demonstration
15
Composite operation specification
Initialmodel
Working modelCreate initial model Copy initial model
Perform updates
State-basedcomparison
Diffmodel
Imply conditions
Edit conditions
Conditions[implied]
Generate Operation Specification
Operation Specification
Revisedmodel
Conditions[revised]
Mod
elin
gCo
nfig
urat
ion
& G
ener
atio
n
1 2
3
5 4
6
7
automatic
manual
Legend
C2
Model Transformation By Demonstration
16
Composite operation specification
Initialmodel
Working modelCreate initial model Copy initial model
Perform updates
State-basedcomparison
Diffmodel
Imply conditions
Edit conditions
Conditions[implied]
Generate Operation Specification
Operation Specification
Revisedmodel
Conditions[revised]
Mod
elin
gCo
nfig
urat
ion
& G
ener
atio
n
1 2
3
5 4
6
7
automatic
manual
Legend
C2
Model Transformation By Demonstration
17
Composite operation specification
Initialmodel
Working modelCreate initial model Copy initial model
Perform updates
State-basedcomparison
Diffmodel
Imply conditions
Edit conditions
Conditions[implied]
Generate Operation Specification
Operation Specification
Revisedmodel
Conditions[revised]
Mod
elin
gCo
nfig
urat
ion
& G
ener
atio
n
1 2
3
5 4
6
7
automatic
manual
Legend
C2
Model Transformation By Demonstration
18
Composite operation specification
Initialmodel
Working modelCreate initial model Copy initial model
Perform updates
State-basedcomparison
Diffmodel
Imply conditions
Edit conditions
Conditions[implied]
Generate Operation Specification
Operation Specification
Revisedmodel
Conditions[revised]
Mod
elin
gCo
nfig
urat
ion
& G
ener
atio
n
1 2
3
5 4
6
7
automatic
manual
Legend
C2
Model Transformation By Demonstration
19
Composite operation specification
Initialmodel
Working modelCreate initial model Copy initial model
Perform updates
State-basedcomparison
Diffmodel
Imply conditions
Edit conditions
Conditions[implied]
Generate Operation Specification
Operation Specification
Revisedmodel
Conditions[revised]
Mod
elin
gCo
nfig
urat
ion
& G
ener
atio
n
1 2
3
5 4
6
7
automatic
manual
Legend
C2
Model Transformation By Demonstration
20
Besides being executable…
Operation Specifications
Match Rules
Signifier Specifications
Res
olut
ion
Ope
ratio
n D
etec
tion
Ope
ratio
n-ba
sed
C
onfli
ct D
etec
tion
Con
flict
-tole
rant
M
erge
Stat
e-ba
sed
Con
flict
Det
ectio
n
Adaptation Artifacts
C3 C4 C4
C4 C2
Validation Rules
Adaptable Model Versioning Framework
Vo
Vr1
Vr2
Vm
C2
Operation Detection
21
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Operation Detection
22
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
Operation Detection
23
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
Operation Detection
24
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
Operation Detection
25
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
No difference
Diff Model
Operation Detection
26
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
Transition target changed!
Diff Model !
!
Operation Detection
27
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
Diff Model ! !
Transition source changed! !
Operation Detection
28
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
State Active has been added!
Diff Model ! + !
+
Operation Detection
29
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
Diff Model ! + + + !
Operation Detection
30
Operation detection process 1. UUID-based matching 2. Rule-based matching 3. Atomic operation detection 4. Composite operation detection
C3
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Idle
DialTone
Dialing
hangup
lift
dial
Active
Vr1
Transition hangup has been deleted!
Diff Model ! + + + !
-
-
Operation Specification
Operation Specification
Operation Specification
InputDiff Model
Operation Specification
Operation Specification
Operation Signature
Input Signature
Preselection
Operation Specification
Operation Specification
Potential Operation
Occurrence
[diff matches][no diff match]
Derive PreconditionBinding
PreconditionBinding
Evaluate Binding
Operation Specification
Operation Specification
ValidPrecondition
Binding
[invalid]
Derive PostconditionBinding
PostconditionBinding
[invalid] [valid][valid]
RefactoringOccurrenceRefactoringOccurrence
Operation Occurrence
«foreach» «foreach»
Operation Occurrence
Evaluate Binding
Diff Model Preprocessing
1 2 3
Operation Detection
31
Composite operation detection process
C3
P. Langer, K. Wieland, and P. Brosch. Specification, Execution, and Detection of Refactorings for Software Models. In Proceedings of the WiP Session @ PPPJ’10, 2010.
Operation Specifications
DiffModel! +++! -
DiffModel! +++! -
Conflict Detection
32
C4
Operation Specifications
Match Rules
Signifier Specifications
Res
olut
ion
Ope
ratio
n D
etec
tion
Ope
ratio
n-ba
sed
C
onfli
ct D
etec
tion
Con
flict
-tole
rant
M
erge
Stat
e-ba
sed
Con
flict
Det
ectio
n
Adaptation Artifacts
C4 C4
C4
Validation Rules
Adaptable Model Versioning Framework
Vo
Vr1
Vr2
Vm
Diff Model1 ! + + + ! -
Diff Model2 ! + +
Input
Conflict Detection
33
Operation-based conflict detection 1. Atomic operation conflict detection 2. Composite operation conflict detection 3. Signifier warning detection
C4
Conflict Detection
34
Operation-based conflict detection 1. Atomic operation conflict detection 2. Composite operation conflict detection 3. Signifier warning detection
C4
Conflict Detection
35
Atomic operation conflict detection Nine conflict patterns for EMF-based models Delete-use conflict
Update-update conflict
…
C4
do : DeleteObject o : Object object value
fo : FeatureOperation {self.oclIsTypeOf(InsertFeatureValue) or self.oclIsTypeOf(FeatureUpdate)}
du : DeleteUse
delete use
fo1 : FeatureOperation f : Feature {upperBound = 1 and fo1.value <> fo2.value}
o : Object
affected Object
affected Object
feature
feature update1
update2
fo2 : FeatureOperation
uu : UpdateUpdate
G. Taentzer, C. Ermel, P. Langer, and M. Wimmer. “A Fundamental Approach to Model Versioning Based on Graph Modifications”. Submitted to Software and System Modeling. Springer, 2011.
Conflict Detection
36
Operation-based conflict detection 1. Atomic operation conflict detection 2. Composite operation conflict detection 3. Signifier warning detection
C4
Conflict Detection
37
Composite operation conflict detection For each composite operation application, check whether it is applicable at the opposite side
C4
Vo
Vr1 Vr2
DiffModel1! +++! -
! + + + !
Conflict Detection
38
Composite operation conflict detection Revisiting the motivating example
C4
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Vr2
Idle
DialTone
Dialing
abort
lift
hangup
dial
dial
Idle
DialTone
Dialing
hangup
lift
dial
Active
dial
Vr1
Introduce Composite
State
Conflict Detection
39
Composite operation conflict detection Revisiting the motivating example
C4
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Vr2
Idle
DialTone
Dialing
abort
lift
hangup
dial
dial
Idle
DialTone
Dialing
hangup
lift
dial
Active
dial
Vr1
Introduce Composite
State SingleState_0
Transition_1
Transition_2
Transition_0
SingleState_1
SingleState_2
Original match
SingleState_0
Transition_1
Transition_2
Transition_0
SingleState_1
SingleState_2
Precondition of composite
operation is violated!
DiffModel1! +++! -
Transition_1.name = Transition_2.name
Conflict Detection
40
Composite operation warning detection For each composite operation application, check whether its match size increased at the opposite side
C4
Vo
Vr1 Vr2
DiffModel1! +++! -
! + + + !
Conflict Detection
41
Composite operation warning detection
Introduce Composite
State
Add state “Connecting”
Add state “Connecting”
C4
Add state “Active”, Move states
into “Active”, fold transition
“hangup”
dial
Conflict Detection
42
Composite operation warning detection
Introduce Composite
State
Add state “Connecting”
Introduce Composite
State
Add state “Connecting”
C4
Your composite operation should incorporate opposite operations!
dial
Conflict Detection
43
Composite operation warning detection
C4
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Vr2
Idle
DialTone
Dialing
hangup
lift
hangup
dial
dial
Idle
DialTone
Dialing
hangup
lift
dial
Active
dial
Vr1
Introduce Composite
State
Connecting hangup
end_dialing
Conflict Detection
44
Composite operation warning detection
C4
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Vr2
Idle
DialTone
Dialing
hangup
lift
hangup
dial
dial
Connecting hangup
end_dialing
Idle
DialTone
Dialing
hangup
lift
dial
Active
dial
Vr1
Introduce Composite
State SingleState_0
Transition_1
Transition_2
Transition_0
SingleState_1
SingleState_2
Original match
SingleState_0
Transition_1
Transition_2
Transition_0
SingleState_1
SingleState_2
Composite operation
is applicable!
DiffModel1! +++! -
Conflict Detection
45
Composite operation warning detection
C4
Idle
DialTone
Dialing
hangup
lift
hangup
dial
Vo
Vr2
Idle
DialTone
Dialing
hangup
lift
hangup
dial
dial
Connecting hangup
end_dialing
Idle
DialTone
Dialing
hangup
lift
dial
Active
dial
Vr1
Introduce Composite
State SingleState_0
Transition_1
Transition_2
Transition_0
SingleState_1
SingleState_2
Original match
SingleState_0
Transition_1
Transition_2
Transition_0
SingleState_1
SingleState_2
Your composite operation should include the state
“Connecting”!
DiffModel1! +++! -
Conflict Detection
46
Operation-based conflict detection 1. Atomic operation conflict detection 2. Composite operation conflict detection 3. Signifier warning detection
C4
Conflict Detection
47
Signifier warning detection
C4
Change target of r1
Change source of r1
Change target of r1
Change source of r1
Conflict Detection
48
Signifier warning detection
C4
Change target of r1
Change source of r1
Redefinition of r1
Redefinition of r1
The superior meaning of r1 has been con-currently changed!
Conflict Detection
49
Signifier warning detection Signifier Combination of properties of a model element type Convey the “superior meaning” of a model element
e.g., the meaning of a reference is mainly conveyed by its name, source, and target
Signifier specifications (using ECL*)
rule ReferenceSignifier match l : Left!EReference with r : Right!EReference { compare : l.name = r.name and l.source.isMatched(r.source) and l.target.isMatched(r.target) }
C4
* Epsilon Comparison Language (ECL), www.eclipse.org/gmt/epsilon
Conflict Detection
50
Signifier warning detection
rule ReferenceSignifier match l : Left!EReference with r : Right!EReference { compare : l.name = r.name and l.source.isMatched(r.source) and l.target.isMatched(r.target) }
C4
Vo
Vr2
Vr1
Match Trigger
Match Trigger
Conflict Detection
51
Signifier warning detection
rule ReferenceSignifier match l : Left!EReference with r : Right!EReference { compare : l.name = r.name and l.source.isMatched(r.source) and l.target.isMatched(r.target) }
C4
Vo
Vr2
Vr1
Compare signifier of r1::Vo with r1::Vr1 signifier change
Compare signifier of r1::Vo with r1::Vr2 signifier change
Concurrent signifier change of reference “r1”! You might want
to duplicate “r1”?
Match Trigger
Match Trigger
Conflict Detection
52
C4
Operation Specifications
Match Rules
Signifier Specifications
Res
olut
ion
Ope
ratio
n D
etec
tion
Ope
ratio
n-ba
sed
C
onfli
ct D
etec
tion
Con
flict
-tole
rant
M
erge
Stat
e-ba
sed
Con
flict
Det
ectio
n
Adaptation Artifacts
C4
C4
Validation Rules
Adaptable Model Versioning Framework
Vo
Vr1
Vr2
Vm
cf. PhD thesis by Konrad Wieland cf. PhD thesis by Petra Brosch
Evaluation
53
Adaptable Model Versioning Framework
Model Transformation By Demonstration
Operation Detection
Conflict Detection
C1
C2
C3
C4
Evaluation
54
Model Transformation By Demonstration (MTBD) Overall research question Is it easier to use our MTBD tool than EMF Tiger*?
Study design 57 students (who have no experience in model transformation) Specification of two composite operations with both tools Questionnaire
Results 88 % preferred using our MTBD tool 74 % indicated that our MTBD tool is easy to use Students needed nearly twice as much time using EMF Tiger However, 53 % stated that configuring the conditions is hard
C2
* EMF Tiger: EMF-based graph transformation tool, user.cs.tu-berlin.de/~emftrans
Evaluation
55
Operation Detection Overall research question How accurate is our tool for detecting applications of composite operations?
Study design Applying our tool to the evolution of GMF* 141 composite operation applications 342 atomic operation applications
Results 98 % precision
“How many detected composite operations have actually been correct?” 70 % recall
“How many applied composite operations have been correctly detected?” Recall decreases with a growing number of concurrent composite operations
Composite operation sequences
C3
* Graphical Modeling Framework (GMF), www.eclipse.org/modeling/gmf
Evaluation
56
Conflict Detection Overall research questions How accurate is our tool for detecting atomic conflicts? Can the same accuracy be achieved as operation tracking approaches?
Study design Automatically executable benchmark 23 carefully selected versioning scenarios 12 of these scenarios include conflicting atomic operations Benchmark applied to our tool, EMF Compare*, and EMFStore**
Results Our tool: 100 % precision and recall EMF Compare: 67 % precision and 17 % recall EMFStore: 100 % precision and recall
C4
* EMF Compare, http://www.eclipse.org/emf/compare ** EMFStore, www.eclipse.org/emfstore/
Limitations and Future Work
57
Adaptable Model Versioning Framework Are the provided adaptation points adequate and sufficient? Empirical case study required!
Model Transformation By Demonstration Configuring conditions still very challenging Further automation of the specification process Multiple demonstrations
Operation Detection Overlapping sequences of operations
Conflict Detection Deriving the conflicting opposite operation
that caused a (composite operation’s pre-)condition to be invalid Semantic inconsistencies
C1
C2
C3
C4
Thank you for your attention!
58
Dissertation available www.big.tuwien.ac.at/teaching/theses/70
Open source implementations EMF Modeling Operations www.modelversioning.org/emf-modeling-operations
AMOR Conflict Detection code.google.com/a/eclipselabs.org/p/amor-conflict-detection