A Bridge over Troubled Water:                              Synergies between                          Model Transformation...
Song writing methods of Simon and Garfunkel
Paul Simon’s technique #1                                 Bridge Over Troubled Water                                 When ...
Paul Simon’s technique #2The BoxerI am just a poor boyThough my storys seldom toldI have squandered my resistanceFor a poc...
A Combined Technique…Scarborough Fair (Folk Song)                     The Side of a Hill (P. Simon)Tell her to find me an ...
Naming These Techniques…                            Bridge Over Troubled Water                            When youre weary...
Applying the Principle to Software Systems   Model                                               Code                     ...
Some Well-known Transformations              Code generation   Generative programming Model                               ...
A Classification of Transformations                      M2T: Model-to-Text  Model                                        ...
Model-Driven Software Development                      M2T: Model-to-Text  Model                                          ...
Software Maintenance and Re-engineering   Model                             Code                  T2M:                 Tex...
Objectives: Build More Bridges for Roundtrips                       M2T: Model-to-Text   Model                            ...
Talk Overview                Overview &                Applications of MT                •Basics                •Applicati...
Model Transformations inModel Driven Software Development
Development Process for Critical SystemsUnique Development Process  (Traditional V-Model)                                 ...
Model-Driven Engineering of Critical Systems               Traditional V-Model                                        Mode...
Models and Transformations in Critical Systems                                                        Horizontal Model Tra...
Modeling Languages andModel Transformations
Overview: Foundations of Model Transformations                                                               Horizontal Mo...
Domain Specific Modeling Languages      Concrete syntax           Abstract syntax            Well-formedness    (Graphical...
Domain Specific Modeling Languages      Concrete syntax                Abstract syntax     Well-formedness    (Graphical/T...
Domain Specific Modeling Languages      Concrete syntax            Abstract syntax     Well-formedness    (Graphical/Textu...
Domain Specific Modeling Languages      Concrete syntax            Abstract syntax     Well-formedness    (Graphical/Textu...
Domain Specific Modeling Languages      Concrete syntax             Abstract syntax     Well-formedness    (Graphical/Text...
Model Transformation Overview: MetamodelsMetamodel: Precise spec ofa modeling language                             Modelin...
Model Transformation Overview: ModelsEclipse Modeling Framework (EMF):• De facto modeling standard for  Eclipse based mode...
Model Transformation Overview: Rules                                 Model Transformation:                                ...
Model Transformation Overview: Rule Execution                               Eclipse Framework                          Mod...
Model Transformation by Graph Transfromation                           Eclipse Framework                        Model Tran...
Overview of Model Transformations                       Eclipse Framework                   Model Transformation Tool     ...
Standalone Model Transformations Plugins                                                 Eclipse Framework                ...
Incremental Model Queries       By EMF-IncQuery
Overview: Early Validation of Design Rules                                                                 Horizontal Mode...
Challenge: Early validation of design rulesSystemSignalGroup design rule (from AUTOSAR)   o A SystemSignal and its group m...
Capturing design rules as model queriesExample: SystemSignalGroup design rule (from AUTOSAR) A SystemSignal and its signa...
Graph Patterns as Query Language Graph patterns as                     pattern mappedSignal(S,M,P) = {  declarative query...
Incremental Evaluation of Graph Queries Graph patterns as                                             pattern mappedSigna...
Scalability of EMF-IncQueryEMF-IncQuery: available from                                                 Context of experim...
Cross technology benchmarking for    on-the-fly model validation                          39
What technology to use for a model validation tool?                                             Triple stores /       Ecli...
Evaluation Results     Batch validation              On-the-fly re-validation    (Read + 1st query)               (Update ...
EMF-IncQuery for Software Maintenance Existing program query           Ongoing application of           tools             ...
Incremental Model Transformations
Overview: Incremental Model Synchronization                                                                Horizontal Mode...
Incremental Forward Transformation    MSRC                              TRACE                                MTRG         ...
Incremental Backward Transformation  MSRC                         TRACE                                  MTRG             ...
Incremental Deployment of Business Processes                         Goal:                         • Avoid full redeployme...
Change Driven Model Transformations    MSRC                                             TRACE                             ...
Design Space ExplorationHegedüs et al.: Quick fix generation for DSMLs. VL/HCC 2011Hegedüs et al.: A Model Driven Framewor...
Model-Driven Guided Design Space Exploration                                                                Horizontal Mod...
Fixing errors in modern IDEsVisual Studio Smart Compile Auto CorrectionNetbeans Editor HintsEclipse Quick Fix             ...
Our Context: Validation of BPMN processesStandard                 How to fix theseEclipse BPMN tool        inconsistencies...
Quick fix generation for BPMN editors                  53
Design Space Exploration   Goals                                                   Design                                 ...
Model Driven Guided Design Space ExplorationModel queries                                                    Seq of Transf...
Result: Quick fix generation for BPMN editors                Sequence ofList of fixes                          Context    ...
Back-annotation ofExecution Traces for Model Analysis
Overview: Back-Annotation of Execution Traces                                                                Horizontal Mo...
Model Analysis: Motivation for BPEL                Receive request                                                        ...
Motivating scenario (cont.)               Receive request                                                       Event: Can...
Motivating scenario (cont.)               Receive request                                                 Returns with a w...
Model Based Analysis                 System design                                         Mathematical analysis          ...
Counter-example / Execution traces
Back-Annotation of Counter Example Traces                                                                 Model High-level...
Replay Traces in BPEL Simulator                                                              Model    High-level          ...
Software Maintenance Techniques    for Model Transformations
Reengineering and Model TransformationsGraph eXchange Language               TTC 2011: Transformation         (GXL)       ...
Design Patterns and Metrics vs. MT   Design Patterns          Design patterns                                             ...
Refactoring vs. Model Transformations                                    MT for refactoring              MT              ...
Migration / Evolution            change                     Model migrationMetamodel            Metamodel          o Meta...
Slicing of Model Transformations Problem:                                                        Idea     o Erroneous M...
Conclusions
Foundations of Model Transformations                                                               Horizontal Model Transf...
Incremental Validation of Design Rules by Model Queries                                                                 Ho...
Incremental Model Synchronization by Change Driven MT                                                                Horiz...
Model-Driven Guided Design Space Exploration                                                                Horizontal Mod...
Back-Annotation of Execution Traces                                                                Horizontal Model Transf...
Future Research Challenges                                                      Many thanks to                    Metrics ...
Upcoming SlideShare
Loading in …5
×

A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques

760 views

Published on

Invited talk at CSMR 2012, 16th European Conference on Software Maintenance and Reengineering

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
760
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques

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

×