A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance...
-
Upload
daniel-varro -
Category
Education
-
view
401 -
download
0
description
Transcript of A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance...
![Page 1: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/1.jpg)
Budapest University of Technology and Economics Department of Measurement and Information Systems
A Bridge over Troubled Water: Synergies between
Model Transformation and Software Maintenance Techniques
Dániel Varró
Budapest University of Technology and Economics
CSMR 2012 Szeged, Hungary, March 29th, 2012
![Page 2: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/2.jpg)
Song writing methods of Simon and Garfunkel
![Page 3: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/3.jpg)
Paul Simon’s technique #1
3
1. Create music first
Bridge Over Troubled Water When you're weary Feeling small When tears are in your eyes I will dry them all I'm on your side When times get rough And friends just can't be found Like a bridge over troubled water I will lay me down Like a bridge over troubled water I will lay me down
2. Write lyrics accordingly
![Page 4: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/4.jpg)
Paul Simon’s technique #2
4
2. Compose music accordingly
The Boxer I am just a poor boy Though my story's seldom told I have squandered my resistance For a pocket full of mumbles such are promises All lies and jests Still a man hears what he wants to hear And disregards the rest When I left my home and my family I was no more than a boy In the company of strangers In the quiet of the railway station running scared Laying low, seeking out the poorer quarters Where the ragged people go Looking for the places only they would know
1. Write lyrics first
![Page 5: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/5.jpg)
A Combined Technique…
5
The Side of a Hill (P. Simon) On the side of a hill, a little cloud weeps And waters the grave with its silent tears While a soldier cleans and polishes a gun
Canticle (rearranged by A. Garfunkel) On the side of a hill a sprinkling of leaves Washes the grave with silvery tears A soldier cleans and polishes a gun
Scarborough Fair (Folk Song) Tell her to find me an acre of land, Parsley, sage, rosemary and thyme; Between the salt water and the sea strand, Then she'll be a true love of mine.
![Page 6: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/6.jpg)
Naming These Techniques…
6 2. Compose music accordingly
The BoxerI am just a poor boy Though my story's seldom told I have squandered my resistance For a pocket full of mumbles such are promises All lies and jests Still a man hears what he wants to hear And disregards the rest When I left my home and my family I was no more than a boy In the company of strangers In the quiet of the railway station running scared Laying low, seeking out the poorer quarters Where the ragged people go Looking for the places only they would know
1. Write lyrics first
Music Driven Song Development (MDSD)
Lyrics Driven Song Development
1. Create music first
Bridge Over Troubled Water
When you're weary Feeling small When tears are in your eyes I will dry them all
I'm on your side When times get rough And friends just can't be found Like a bridge over troubled water I will lay me down Like a bridge over troubled water I will lay me down
2. Write lyrics accordingly
![Page 7: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/7.jpg)
Applying the Principle to Software Systems
7
Music
Bridge Over Troubled Water When you're weary Feeling small When tears are in your eyes I will dry them all I'm on your side When times get rough And friends just can't be found Like a bridge over troubled water I will lay me down Like a bridge over troubled water I will lay me down
Lyrics
Model Code
![Page 8: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/8.jpg)
Some Well-known Transformations
8
Model Code
Code generation
Refactoring Model
Refactoring
Re-engineering
Program comprehension Query
Model Query
Generative programming
![Page 9: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/9.jpg)
A Classification of Transformations
9
Model Code M2T: Model-to-Text
T2M: Text-to-Model
M2M: Model-to-Model T2T: Text-to-Text
Model Transformations: Topic of this talk
![Page 10: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/10.jpg)
Model-Driven Software Development
10
Model Code M2T: Model-to-Text
M2M: Model-to-Model
Conferences: MODELS, ECMFA, ICMT
![Page 11: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/11.jpg)
Software Maintenance and Re-engineering
11
Model Code
T2M: Text-to-Model
T2T: Text-to-Text
Conferences: CSMR, ICSM …
![Page 12: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/12.jpg)
Objectives: Build More Bridges for Roundtrips
12
Model Code M2T: Model-to-Text
T2M: Text-to-Model
M2M: Model-to-Model T2T: Text-to-Text
![Page 13: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/13.jpg)
Talk Overview
13
Overview & Applications of MT •Basics •Applications from own practice
A tool (MTSMR) • to build your SMR tool • increm. model queries
Targets (SMRMT)
• future research • collaboration
![Page 14: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/14.jpg)
Model Transformations in Model Driven Software Development
![Page 15: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/15.jpg)
Development Process for Critical Systems Unique Development Process
(Traditional V-Model)
Critical Systems Design
requires a certification process
to develop justified evidence
that the system is free of flaws
Software Tool Qualification
obtain certification credit
for a software tool
used in critical system design
Qualified Tool Certified Output
DO-178B IEC 61508
Innovative Tool Better System
![Page 16: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/16.jpg)
Model-Driven Engineering of Critical Systems
Traditional V-Model Model-Driven Engineering
Main ideas of MDE • early validation of system models • automatic source code generation quality++ tools ++ development cost--
• DO-178B/C: Software Considerations in Airborne Systems and Equipment Certification (RTCA, EUROCAE) • Steven P. Miller: Certification Issues in Model Based Development (Rockwell Collins)
![Page 17: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/17.jpg)
Models and Transformations in Critical Systems
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Model Transformations • systematic foundation of knowledge transfer: theoretical resultstools • bridge / integrate existing languages&tools
Design + V&V Artifacts (Source code, Glue code, Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Test Generation
Ve
rtical Mo
de
l Transfo
rmatio
ns
Component V&V Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Related projects • CESAR, SAVI, … • HIDE, DECOS, DIANA, MOGENTES, CERTIMOT, GENESYS, SENSORIA
![Page 18: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/18.jpg)
Modeling Languages and Model Transformations
![Page 19: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/19.jpg)
Overview: Foundations of Model Transformations
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Test Generation
Ve
rtical Mo
de
l Transfo
rmatio
ns
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Foundations of model transformations
![Page 20: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/20.jpg)
Domain Specific Modeling Languages Concrete syntax
(Graphical/Textual)
Code generation
View
Well-formedness constraints
Behavioural semantics, Simulation
Abstract syntax (Metamodel)
Mapping
Source Code (Documentation,
Configuration file)
Concrete syntax: • How the designer sees it • Graphical/textual/both
Domain-Specific Modeling Languages (DSML): • Foundations of many modern tool (design, analysis, V&V) • Domains: avionics, automotive, business modeling
![Page 21: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/21.jpg)
Domain Specific Modeling Languages Concrete syntax
(Graphical/Textual)
Code generation
View
Well-formedness constraints
Behavioural semantics, Simulation
Abstract syntax (Metamodel)
Mapping
Source Code (Documentation,
Configuration file)
Abstract syntax: • Internal graph representation • Defined by a metamodel
![Page 22: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/22.jpg)
Domain Specific Modeling Languages Concrete syntax
(Graphical/Textual)
Code generation
View
Well-formedness constraints
Behavioural semantics, Simulation
Abstract syntax (Metamodel)
Mapping
Source Code (Documentation,
Configuration file)
Well-formedness constraints: • REQs for valid static models • Captured declaratively (OCL)
![Page 23: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/23.jpg)
Domain Specific Modeling Languages Concrete syntax
(Graphical/Textual)
Code generation
View
Well-formedness constraints
Behavioural semantics, Simulation
Abstract syntax (Metamodel)
Mapping
Source Code (Documentation,
Configuration file)
Behavioural Semantics: • For dynamic MLs only (statecharts, business processes) • Enables model simulation/execution
![Page 24: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/24.jpg)
Domain Specific Modeling Languages Concrete syntax
(Graphical/Textual)
Code generation
View
Well-formedness constraints
Behavioural semantics, Simulation
Abstract syntax (Metamodel)
Mapping
Source Code (Documentation,
Configuration file)
View/Compile/Map: • View / code generation • Model transformation exercise
![Page 25: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/25.jpg)
Model Transformation Overview: Metamodels
Modeling tool
Source model
Source metamodel
Target model
Target metamodel
MT rule
Metamodel: Precise spec of a modeling language
![Page 26: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/26.jpg)
Modeling tool
Model Transformation Overview: Models
Source model
Source metamodel
Target model
Target metamodel
MT rule
Model: Description of a concrete system
t1:Transition
t2:Transition
p1:Place p2:Place
a1:PTArc a2:TPArc
a4:TPArc a3:PTArc
tk:Token
Eclipse Modeling Framework (EMF): • De facto modeling standard for Eclipse based modeling tools • Design metamodel auto-generate
interface, implementation, tree editor… • Examples: UML, AADL, SysML, BPMN, AUTOSAR >30 in a single IBM tool
![Page 27: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/27.jpg)
Modeling tool
Model Transformation Overview: Rules
Source model
Source metamodel
Target model
Target metamodel
MT rule
Model Transformation: How to generate a target equivalent of an arbitrary source model
LHS RHS
Place
Token
Tran. Place
a1:inarc a2:outarc
Place
Token
Tran. Plan
a1:inarc a2:outarc
ttn1:tokens tkn2:tokens
![Page 28: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/28.jpg)
Model Transformation Overview: Rule Execution
Eclipse Framework
Model Transformation Tool
Modeling tool
Source model
Source metamodel
Target model
Target metamodel
MT rule
MT engine
Transformation engine: Support for querying and manipulating large models
VIATRA2: http://www.eclipse.org/gmt/VIATRA2/
ATL
QVT
![Page 29: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/29.jpg)
Model Transformation by Graph Transfromation
Eclipse Framework
Model Transformation Tool
Modeling tool
Source model
Source metamodel
Target model
Target metamodel
MT rule
MT engine
query/match update
LHS RHS
Place
Token
Tran. Place
a1:inarc a2:outarc
Place
Token
Tran. Plan
a1:inarc a2:outarc
ttn1:tokens tkn2:tokens
![Page 30: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/30.jpg)
3rd Party Tool
Native source model
Native target model
Overview of Model Transformations Eclipse Framework
Model Transformation Tool
Modeling tool
Source model
Source metamodel
Target model
Target metamodel
MT rule
MT engine
Native source models: • EMF • XML documents • Databases • Domain-specific models • UML
Native target models: • EMF • App source code • XML deployment descript. • Databases • Analysis tools
![Page 31: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/31.jpg)
3rd Party Tool
Native source model
Native target model
Standalone Model Transformations Plugins Eclipse Framework
Model Transformation Tool
Modeling tool
Source model
Source metamodel
Target model
Target metamodel
MT rule
MT engine
Native MT plugin
Code generator Standalone transformation: Independent of transformation development environment
D. Varró, A. Pataricza: Generic and Meta-Transformations for Model Transformation Engineering . UML 2004
![Page 32: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/32.jpg)
Incremental Model Queries
By EMF-IncQuery
![Page 33: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/33.jpg)
Overview: Early Validation of Design Rules
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Test Generation
Vertical M
od
el Transfo
rmatio
ns
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Validation of design rules by incremental model queries
![Page 34: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/34.jpg)
Challenge: Early validation of design rules
SystemSignalGroup design rule (from AUTOSAR)
o A SystemSignal and its group must be in the same IPdu
o Challenge: find violations quickly in large models
o New difficulties
• reverse navigation
• complex manual solution
AUTOSAR: • standardized SW architecture of the automotive industry • now supported by modern modeling tools Design Rule/Well-formedness constraint: • each valid car architecture needs to respect • designers are immediately notified if violated Challenge: • >500 design rules in AUTOSAR tools • >1 million elements in AUTOSAR models • models constantly evolve by designers
![Page 35: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/35.jpg)
Example: SystemSignalGroup design rule (from AUTOSAR)
A SystemSignal and its signal group must be in the same IPDU (Protocol Data Unit)
Our approach
Capture design rules as model queries
Incremental re-validation Others approaches: X. Blanc,
A. Egyed, T. Mens,OCL, …
Capturing design rules as model queries
ModelQuery(A,B): • tuples of model elements A, B • satisfying the query condition • enumerate 1 / all instances • A,B can be input or output
![Page 36: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/36.jpg)
Graph Patterns as Query Language Graph patterns as
declarative query language o Attribute constraints
o Local + global queries
o Compositionality + Reusabilility
o „Arbitrary” Recursion, Negation, Transitive Closure
o Syntax: DATALOG style
pattern mappedSignal(S,M,P) = {
SignalIPdu(P); signalToPduMapping(R3,P,M);
ISignalToIPduMapping(M); signal(R1,M,S); ISignal(S);
}
pattern systemSignal(S,SS) = { ISignal(S); systemSignal(R2,S,SS); SystemSignal(SS);
}
pattern systemSignalGroup(P) = { find mappedSignal(S_Child,M_Child,P);
find systemSignal(S_Child,SS_Child); systemSignal(R7,SS_Parent,SS_Child); find systemSignal(S_Parent,SS_Parent); neg find mappedSignal(S_Child,M_Child,P);
}
![Page 37: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/37.jpg)
Incremental Evaluation of Graph Queries Graph patterns as
declarative query language o Attribute constraints
o Local + global queries
o Compositionality + Reusabilility
o „Arbitrary” Recursion, Negation, Transitive Closure
o Syntax: DATALOG style
pattern mappedSignal(S,M,P) = {
SignalIPdu(P); signalToPduMapping(R3,P,M);
ISignalToIPduMapping(M); signal(R1,M,S); ISignal(S);
}
pattern systemSignal(S,SS) = { ISignal(S); systemSignal(R2,S,SS); SystemSignal(SS);
}
pattern systemSignalGroup(P) = { find mappedSignal(S_Child,M_Child,P);
find systemSignal(S_Child,SS_Child); systemSignal(R7,SS_Parent,SS_Child); find systemSignal(S_Parent,SS_Parent); neg find mappedSignal(S_Child,M_Child,P);
}
Evaluation: incremental cache of matches (RETE) • Cheap maintenance of cache (only memory overhead) • Notify about relevant changes • Enable reactions to complex structural events
G. Bergmann et al.: Incremental evaluation of model queries over EMF models. MODELS 2010.
![Page 38: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/38.jpg)
Scalability of EMF-IncQuery
Memory consumption: • < 50 MB for model size
below 50 000 elements • < 1GB for largest models (grows linearly)
Context of experiments: • Generated AUTOSAR models • > 1,5 million model elements • #violations << model size
G. Bergmann et al.: Incremental evaluation of model queries over EMF models. MODELS 2010.
EMF-IncQuery: available from http://viatra.inf.mit.bme.hu/incquery
Time of incremental revalidation: • < 10 ms • Depends on size of the change • Depends on number of violations but • Independent from model sizes
Measured scenarios: • Read and first check • Change and revalidate
![Page 39: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/39.jpg)
Cross technology benchmarking for on-the-fly model validation
39
![Page 40: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/40.jpg)
What technology to use for a model validation tool?
Eclipse Modeling
• EMF (&variants, CDO, …)
• Proven EMF tools: Plain Java queries, OCL (&variants), EMF Query (1-2)
• New/experimental technologies: EMF-IncQuery, JBoss Drools, …
Triple stores / graph databases
• OWL/RDF, SPARQL
• RacerPro, Pellet, Sesame, Jena, OpenVirtuoso, Allegro, StarDog
• But…
• Huge, distributed knowledge bases
• Frequently based upon Relational DB
• Optimized SPARQL engines
• Expensive commercial tools
Future plans (not covered yet) • Non-EMF modeling frameworks • Plain XML/Xpath • OO DB • K-V (NoSQL), …
![Page 41: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/41.jpg)
Evaluation Results
Batch validation (Read + 1st query)
• Top: Eclipse OCL,followed by EMF-IncQuery
• Dominating: Read time
• SPARQL tools: 1-2 orders of magniture slower than top EMF tools
On-the-fly re-validation (Update + query)
• Top: Incremental EMF engines
• 5-10x faster than OCL
• EMF-IncQuery frequently outperforms JBoss Drools
• Response time: below 100ms for up to 1.5M elements
• Memory: ~1 GB
41
![Page 42: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/42.jpg)
EMF-IncQuery for Software Maintenance
Existing program query tools
• JQuery, CodeQuest, PQL, SOUL, JQL, ASTLog
• Incremental solutions: Willis et al. (JQL), Rothamel&Liu08, …
• coding conventions, metrics, refactoring opportunities, design patterns, run-time errors
Ongoing application of EMF-IncQuery
• Interconnection of software module
• 4 million model elements (classes + packages)
• Much larger than Eclipse JDT could handle
42
![Page 43: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/43.jpg)
Incremental Model Transformations
![Page 44: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/44.jpg)
Overview: Incremental Model Synchronization
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Vertical M
od
el Transfo
rmatio
ns
Code Generation
Test Generation
Component V&V
Model
Architecture V&V Model
System V&V Model
Back-Annotation
Back-Annotation
Back-Annotation
Use
Use
Horizontal Model Transformations
Model generation
Model generation
Model generation
Formal methods
Formal methods
Design rules
Design rules
Design rules
Incremental model synchronization by change-driven transformations
![Page 45: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/45.jpg)
Incremental Forward Transformation
MSRC MTRG TRACE
M’SRC M’TRG TRACE’
1. First transformation
2. Source model changes
3. Apply changes to target model
Practical application scenarios: • Incremental model synchronization • Tool integration
Solutions: • Bidirectional transformations • Change-driven transformations
![Page 46: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/46.jpg)
Incremental Backward Transformation
MSRC MTRG TRACE
M’SRC TRACE’ M’TRG
1. First transformation
2. Target model changes
3. Apply changes to source model
Challenge: SRCTRG specified TRGSRC inferred
Recent Approaches: A. Schürr, P. Stevens, N. Foster, T. Hettel, Cicchetti&Pierantonio, Czarnecki&Diskin
![Page 47: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/47.jpg)
Incremental Deployment of Business Processes
47
Executing business process • XML document (jPDL / JBoss) • Deployed on a remote server
Business Process Model • EMF model (BPMN) • Available in Eclipse IDE
Goal: • Avoid full redeployment of XML upon changes in BPMN model • Apply model changes asynchronously (any time later) • Send changes via a XML-DOM API
NewAct <action name="NewAct">
![Page 48: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/48.jpg)
Ráth, Varró, Varró : Change Driven Transformations- MODELS 2009
Change Driven Model Transformations
Change ModelTRG
Change Driven Model Transformations
MSRC MTRG TRACE
M’SRC M’TRG TRACE’
Change Driven Transformation • Input: consumes change model • Output: produces change model
Apply Target Change Model • via an API with little trace info • target model is not materialized!
Change ModelSRC
![Page 49: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/49.jpg)
Design Space Exploration
Hegedüs et al.: A Model Driven Framework for Guided Design Space Exploration ASE 2011
Hegedüs et al.: Quick fix generation for DSMLs. VL/HCC 2011
![Page 50: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/50.jpg)
Model-Driven Guided Design Space Exploration
Test Generation
Vertical M
od
el Transfo
rmatio
ns
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Model-driven guided design space exploration • Quick fixes for DSMLs • Design of ARINC653 configs
![Page 51: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/51.jpg)
Fixing errors in modern IDEs
51
Visual Studio Smart Compile Auto Correction
Netbeans Editor Hints Eclipse Quick Fix
![Page 52: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/52.jpg)
Our Context: Validation of BPMN processes
52
How to fix these inconsistencies?
Standard Eclipse BPMN tool
![Page 53: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/53.jpg)
Quick fix generation for BPMN editors
53
![Page 54: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/54.jpg)
Design Space Exploration
54
Design Space Exploration
Design Alternative 1
Design Alternative 2
Design Alternative 3
Design Alternative 4
Goals
Global Constraints
Operations
Initial Design
Special state space exploration • potentially infinite state space • „dense” solution space
![Page 55: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/55.jpg)
Model Driven Guided Design Space Exploration
55
Design Space Exploration
Seq of Transf. Rules 1
Seq of Transf. Rules 2
Seq of Transf. Rules 3
Seq of Transf. Rules 4
Model queries as Goals
Model queries as Constraints
Transf. Rules as Operations
Initial Model
Guidance for exploration: Hints • designer / end user • formal analysis
Modified model
Operation
Initial model
Solution model
Constraints violated
Goals satisfied
![Page 56: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/56.jpg)
Result: Quick fix generation for BPMN editors
56
List of fixes Sequence of edit operations
Context
![Page 57: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/57.jpg)
Back-annotation of Execution Traces for Model Analysis
![Page 58: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/58.jpg)
Overview: Back-Annotation of Execution Traces
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Test Generation
Vertical M
od
el Transfo
rmatio
ns
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Back-annotation of execution traces
![Page 59: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/59.jpg)
Model Analysis: Motivation for BPEL
Requirement: Every received request must result in a reply! Will the business process assure this?
Receive request
Calculate Rating
Send offer
Accept?
Receive answer
Send reply
Send rejection
Receive update request
Update?
Rollback changes
Throw Error
Event: Cancel
Yes No
Yes No
![Page 60: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/60.jpg)
Motivating scenario (cont.)
Requirement: Every received request must result in a reply!
Receive request
Calculate Rating
Send offer
Accept?
Receive answer
Send reply
Send rejection
Receive update request
Update?
Rollback changes
Throw Error
Event: Cancel
Yes No
Yes No
![Page 61: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/61.jpg)
Motivating scenario (cont.)
Requirement: Every received request must result in a reply!
Receive request
Calculate Rating
Send offer
Accept?
Receive answer
Send reply
Send rejection
Receive update request
Update?
Rollback changes
Throw Error
Event: Cancel
Yes No
Yes No
Returns with a web-service error
Not executed = No reply
![Page 62: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/62.jpg)
High-level
System Model
Model Based Analysis System design
Mathematical
model
Model
generation
Mathematical analysis
List of
inconsistencies Analysis (e.g model checker)
Fix problem Receive request
Calculate Rating
Send offer
Accept?
Receive answer
Send reply
Send rejection
Receiveupdate request
Update?YesNo
Yes No
![Page 63: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/63.jpg)
Counter-example / Execution traces
![Page 64: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/64.jpg)
Back-Annotation of Counter Example Traces
High-level
System Model Mathematical
model
Model
generation
Back-annotation
of target trace Analysis
(e.g model checker)
Replay of
source trace
Receive request
Calculate Rating
Send offer
Accept?
Receive answer
Send reply
Send rejection
Receiveupdate request
Update?YesNo
Yes No
Fire Transition
Select Transition
Fire Transition
Select Transition
Add Tokens
Delete Tokens
BPEL Activity Executed
BPEL Activity Runs
BPEL Activity Startable
MPN MBPEL
MPN’
CHMPN
MBPEL’
CHMBPEL
IF
map
TR
TR
![Page 65: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/65.jpg)
Replay Traces in BPEL Simulator
High-level
System Model Mathematical
model
Model
generation
Replay of
source trace
Analysis (e.g model checker)
Back-annotation
of target trace
Receive request
Calculate Rating
Send offer
Accept?
Receive answer
Send reply
Send rejection
Receiveupdate request
Update?YesNo
Yes No
Extended BPEL Simulator: • Current state: coloured • Intuitive navigation along the trace
![Page 66: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/66.jpg)
Software Maintenance Techniques for Model Transformations
![Page 67: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/67.jpg)
Reengineering and Model Transformations
Graph eXchange Language (GXL)
• R. Holt, A. Schürr, S.E. Sim, A. Winter (2000)
• Used by >30 tools (from both communities)
TTC 2011: Transformation Tool Contest
• Case for program understanding / reengineering (T. Horn)
• Solved by 7 MT tools
67
Source code
parse
Model query
![Page 68: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/68.jpg)
Design Patterns and Metrics vs. MT
Design Patterns by MT
• Design pattern / smell captured as a query
• Modifications as MT rules
• Extensive literature
Design patterns for MTs
• Good design practices for MT
• Karsai et al, Iacob et. al, Lano et al.,
Metrics for MT
• Quality assessment for MT
• van Amstel et al., Vignana, Saeki, Kapova et al.,
• Only since 2009/2010
68
Model
Design Pattern
query
Model
Metrics Definition
query
MT
measure
![Page 69: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/69.jpg)
Refactoring vs. Model Transformations
MT for refactoring
o T. Mens, G. Taentzer,
o L. Vidács, R. Ferenc, M. Gogolla
o Van Eetvelde, Janssens
o J. Grey, …
o EMF-Refactor
Refactoring of MT
o Ehrig et al. 2009
69
Source Code 1
Model 1
MT
Model 2
Source Code 2
MT1
as model
MT2
as model refactor
![Page 70: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/70.jpg)
Migration / Evolution
Model migration o Metamodel
changes to new version Migrate model instances
o Tools: COPE/Edapt, EPSILON FLOCK, (Herrmannsdörfer, Kolovos, Paige, Levendovszky et al.)
MT migration o Mendez et al. o Roser&Bauer
70
Model
Metamodel v1
change Metamodel
v2
Model
update
MT
Metamodel v1
change Metamodel
v2
MT
update
![Page 71: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/71.jpg)
Slicing of Model Transformations
Problem:
o Erroneous MT invalidates formal analysis results
Motivation:
o Debugging of MTs
o Focus on specific executions
Idea Apply program slicing
o Identify parts of a MT program
o Causally dependent on a selected statement
71
Transformation Slice
Model Slice
Model Transformation Slicing
Transformation Program
Models
Z. Ujhelyi, A. Horvath, D. Varró: Dynamic backward Slicing of MT programs. ICST 2012
![Page 72: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/72.jpg)
Conclusions
![Page 73: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/73.jpg)
Foundations of Model Transformations
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Test Generation
Ve
rtical Mo
de
l Transfo
rmatio
ns
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Foundations: • MDSD= early validation + auto-generation of sources • DSMLs drive modern tools • MTs drive bridges (integration) • MT rule = Query + Manipulate
![Page 74: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/74.jpg)
Incremental Validation of Design Rules by Model Queries
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Test Generation
Vertical M
od
el Transfo
rmatio
ns
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
EMF-IncQuery • Declarative graph query language • Incremental caches of result set • Scalable performance:>1 M elems
![Page 75: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/75.jpg)
Incremental Model Synchronization by Change Driven MT
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Vertical M
od
el Transfo
rmatio
ns
Code Generation
Test Generation
Component V&V
Model
Architecture V&V Model
System V&V Model
Back-Annotation
Back-Annotation
Back-Annotation
Use
Use
Horizontal Model Transformations
Model generation
Model generation
Model generation
Formal methods
Formal methods
Design rules
Design rules
Design rules
Change driven transfomations (CDT) • Changes stored as change models • CDT: Source change Target change • Non-materialized target models (API)
![Page 76: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/76.jpg)
Model-Driven Guided Design Space Exploration
Test Generation
Vertical M
od
el Transfo
rmatio
ns
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Guided DSE (є Search Based SE) • Potentially infinite search space • Frequent solutions • Hints to guide exploration
![Page 77: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/77.jpg)
Back-Annotation of Execution Traces
System Design Model
Architecture Design Model
Component Design Model
Refine
Refine
Design + V&V Artifacts (Source code, Glue code,
Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
Code Generation
Test Generation
Vertical M
od
el Transfo
rmatio
ns
Component V&V
Model
Architecture V&V Model
System V&V Model
Model generation
Back-Annotation
Model generation
Back-Annotation
Model generation
Back-Annotation
Use
Use
Horizontal Model Transformations
Formal methods
Formal methods
Design rules
Design rules
Design rules
Back-annotation • Goal: Hidden formal methods • TRG execution traces SRC execution traces • Demonstrate / Replay problem in SRC (engineering) model
![Page 78: A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques](https://reader033.fdocuments.in/reader033/viewer/2022052522/554a05f3b4c905e56c8b5613/html5/thumbnails/78.jpg)
Future Research Challenges
Metrics for MT
Slicing of MT
Migration of MT
Design patterns for MT
Refactoring of MT
Many thanks to
Contributors: G. Bergmann, L. Gönczy Á. Hegedüs, Á. Horváth, B. Izsó, A. Pataricza, I. Ráth, Z. Ujhelyi, G. Varró and many more
Thanks for your kind attention!
78