SlideShare une entreprise Scribd logo
1  sur  78
Télécharger pour lire hors ligne
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
Budapest University of Technology and Economics
Department of Measurement and Information Systems
Song writing methods of
 Simon and Garfunkel
Paul Simon’s technique #1
                                 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
1. Create music first           2. Write lyrics accordingly
                            3
Paul Simon’s technique #2
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                                    2. Compose music accordingly
                                                     4
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 weeps
Parsley, sage, rosemary and thyme;               And waters the grave with its silent tears
Between the salt water and the sea strand,       While a soldier cleans and polishes a gun
Then she'll 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
Naming These Techniques…
                            Bridge Over Troubled Water

                            When you're weary
                            Feeling small                           Music Driven Song Development
                            When tears are in your eyes
                            I will dry them all                                (MDSD)
                            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
1. Create music first       2. Write lyrics 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
   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
Applying the Principle to Software Systems

   Model                                               Code
                         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

           Music                      Lyrics
                     7
Some Well-known Transformations
              Code generation   Generative programming
 Model                                                      Code




   Model                 Re-engineering
   Query                                                   Query
                     Program comprehension
  Model
Refactoring                                              Refactoring
                                8
A Classification of Transformations
                      M2T: Model-to-Text
  Model                                                Code




                           T2M:
                          Text-to-
                           Model



                      Model Transformations:
                        Topic of this talk
M2M: Model-to-Model                            T2T: Text-to-Text
                               9
Model-Driven Software Development
                      M2T: Model-to-Text
  Model                                             Code




                                    Conferences:
M2M: Model-to-Model                 MODELS, ECMFA, ICMT
                              10
Software Maintenance and Re-engineering

   Model                             Code




                  T2M:
                 Text-to-
                  Model




  Conferences:
  CSMR, ICSM …               T2T: Text-to-Text
                     11
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
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
Model Transformations in
Model Driven Software Development
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
DO-178B                            used in critical system design
IEC 61508


Innovative Tool  Better System    Qualified Tool  Certified Output
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 models
Equipment Certification (RTCA, EUROCAE)
• Steven P. Miller: Certification Issues in Model Based Development   • automatic source code generation
(Rockwell Collins)
                                                                       quality++ tools ++ development cost--
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                                Formal
Vertical 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
Modeling Languages and
Model Transformations
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         Architecture
Vertical 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.)
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
Domain Specific Modeling Languages
      Concrete syntax                Abstract syntax     Well-formedness
    (Graphical/Textual)               (Metamodel)          constraints




                                                       Behavioural semantics,
                                                            Simulation

                                  Mapping                Code
                                                       generation




Abstract syntax:                                         Source Code
                                            View
• Internal graph representation                        (Documentation,
• Defined by a metamodel                               Configuration file)
Domain Specific Modeling Languages
      Concrete syntax            Abstract syntax     Well-formedness
    (Graphical/Textual)           (Metamodel)          constraints




                                                   Behavioural semantics,
                                                        Simulation

                           Mapping                   Code
                                                   generation




Well-formedness constraints:                         Source Code
                                     View
• REQs for valid static models                     (Documentation,
• Captured declaratively (OCL)                     Configuration file)
Domain Specific Modeling Languages
      Concrete syntax            Abstract syntax     Well-formedness
    (Graphical/Textual)           (Metamodel)          constraints




                                                   Behavioural semantics,
                                                        Simulation

                             Mapping                 Code
                                                   generation




Behavioural Semantics:                               Source Code
                                     View
• For dynamic MLs only                             (Documentation,
  (statecharts, business processes)                Configuration file)
• Enables model simulation/execution
Domain Specific Modeling Languages
      Concrete syntax             Abstract syntax     Well-formedness
    (Graphical/Textual)            (Metamodel)          constraints




                                                    Behavioural semantics,
                                                         Simulation

                              Mapping                 Code
                                                    generation




View/Compile/Map:                                     Source Code
                                        View
• View / code generation                            (Documentation,
• Model transformation exercise                     Configuration file)
Model Transformation Overview: Metamodels
Metamodel: Precise spec of
a modeling language

                             Modeling tool
        Source                                Target
                               MT rule
       metamodel                             metamodel


         Source                               Target
         model                                model
Model Transformation Overview: Models
Eclipse 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:Transition

p1:Place      tk:Token        p2:Place

            t2:Transition
 a4:TPArc                    a3:PTArc
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
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
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
Overview of Model Transformations
                       Eclipse Framework
                   Model Transformation Tool

                           Modeling tool
      Source                                           Target
                              MT rule
    metamodel                                       metamodel
Native 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
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
Incremental Model Queries

       By EMF-IncQuery
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                      Generation
Validation of design rules
by incremental model queries
                                                                              Design + V&V Artifacts
                                                                            (Source code, Glue code,
                                                                       Config. Tables, Test Cases, Monitors,
                                                                                 Fault Trees, etc.)
Challenge: Early validation of design rules
SystemSignalGroup 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
Capturing design rules as model queries
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, …

ModelQuery(A,B):
• tuples of model elements A, B
• satisfying the query condition
• enumerate 1 / all instances
• A,B can be input or output
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);
                                        }
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.
Scalability of EMF-IncQuery
EMF-IncQuery: available from                                                 Context of experiments:
http://viatra.inf.mit.bme.hu/incquery                                        • Generated AUTOSAR models
                                                                             • > 1,5 million model elements
                                                                             • #violations << model size

Memory 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 sizes

Measured scenarios:
• Read and first check
• Change and revalidate




  G. Bergmann et al.: Incremental evaluation of model queries over EMF models. MODELS 2010.
Cross technology benchmarking for
    on-the-fly model validation




                          39
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), …
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
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
Incremental Model Transformations
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     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                    Generation


                                                                             Design + V&V Artifacts
                                                                           (Source code, Glue code,
                                                                      Config. Tables, Test Cases, Monitors,
                                                                                                         Incremental model synchronization
                                                                                Fault Trees, etc.)
                                                                                                   by change-driven transformations
Incremental Forward Transformation

    MSRC                              TRACE                                MTRG


                       1. First transformation

                       2. Source model changes

                        3. Apply changes to
                           target model

    M’SRC                             TRACE’                               M’TRG




Practical application scenarios:               Solutions:
• Incremental model synchronization            • Bidirectional transformations
• Tool integration                             • Change-driven transformations
Incremental Backward Transformation

  MSRC                         TRACE                                  MTRG


                    1. First transformation

                    2. Target model changes

                    3. Apply changes to
                       source model

  M’SRC                        TRACE’                                 M’TRG




Challenge:                  Recent Approaches:
SRCTRG specified           A. Schürr, P. Stevens, N. Foster, T. Hettel,
TRGSRC inferred            Cicchetti&Pierantonio, Czarnecki&Diskin
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
Change Driven Model Transformations

    MSRC                                             TRACE                                   MTRG



                                   Change Driven Model Transformations
                         Change                                              Change
                         ModelSRC                                            ModelTRG




   M’SRC                                            TRACE’                                  M’TRG



Change 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
Design Space Exploration




Hegedüs et al.: Quick fix generation for DSMLs. VL/HCC 2011

Hegedüs et al.: A Model Driven Framework for Guided Design Space Exploration ASE 2011
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     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                      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.)
Fixing errors in modern IDEs
Visual Studio Smart Compile Auto Correction
Netbeans Editor Hints
Eclipse Quick Fix




                            51
Our Context: Validation of BPMN processes
Standard                 How to fix these
Eclipse BPMN tool        inconsistencies?




                    52
Quick fix generation for BPMN editors




                  53
Design Space Exploration

   Goals                                                   Design
                                                        Alternative 1

  Global
                                                           Design
Constraints
                                                        Alternative 2

Operations                                                 Design
                                                        Alternative 3


Initial Design                                             Design
                       Design Space Exploration         Alternative 4

                   Special state space exploration
                   • potentially infinite state space
                   • „dense” solution space
                                     54
Model Driven Guided Design Space Exploration

Model queries                                                    Seq of Transf.
  as Goals                                     Initial model        Rules 1
                             Operation
Model queries
                  Modified model                                 Seq of Transf.
as Constraints
                 Constraints                                        Rules 2
                  violated
Transf. Rules                                         Goals
as 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
Result: Quick fix generation for BPMN editors

                Sequence of
List of fixes                          Context
                edit operations




                                  56
Back-annotation of
Execution Traces for Model Analysis
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     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                      Generation               Back-annotation of
                                                                                                                execution traces
                                                                             Design + V&V Artifacts
                                                                           (Source code, Glue code,
                                                                      Config. Tables, Test Cases, Monitors,
                                                                                Fault Trees, etc.)
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
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
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
Model Based Analysis
                 System design                                         Mathematical analysis
                                                         Model
 High-level
                                                       generation       Mathematical
System Model
               Receive request                          Fix problem
                                                                           model
               Calculate Rating


                   Accept?
  Yes                                 No

  Send offer                  Send rejection
                                                         List of
Receive answer
                                 Receive
                              update request
                                                     inconsistencies        Analysis
                       No
                                  Update?
                                               Yes                     (e.g model checker)
                 Send reply
Counter-example / Execution traces





Back-Annotation of Counter Example Traces
                                                                 Model
 High-level
                                                               generation                              Mathematical
System Model
               Receive request                                Replay of
                                                                                                          model
                                                              source trace
               Calculate Rating


  Yes
                   Accept?
                                      No                Back-annotation
  Send offer                  Send rejection
                                                         of target trace
Receive 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
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 reply




Extended BPEL Simulator:
• Current state: coloured
• Intuitive navigation
 along the trace                                                                    
Software Maintenance Techniques
    for Model Transformations
Reengineering and Model Transformations
Graph 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
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
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 MT
as model           as model
                                     o Ehrig et al. 2009
           refactor

                              69
Migration / Evolution
            change                     Model migration
Metamodel            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
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 executions


Transformation                                                                                     Transformation
   Program                                                                                              Slice


   Models                                                                                           Model Slice


                                Model Transformation Slicing
            Z. Ujhelyi, A. Horvath, D. Varró: Dynamic backward 71
                                                               Slicing of MT programs. ICST 2012
Conclusions
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         Architecture
Vertical 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.)
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     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                 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
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     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                  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)
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     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                 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
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     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
                                                                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
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

Contenu connexe

Tendances

Tendances (6)

Story ofnoman kamilkailani
Story ofnoman kamilkailaniStory ofnoman kamilkailani
Story ofnoman kamilkailani
 
paper and twine || issue no. 3
paper and twine || issue no. 3paper and twine || issue no. 3
paper and twine || issue no. 3
 
"My Haunted Memory"
"My Haunted Memory""My Haunted Memory"
"My Haunted Memory"
 
Writing banners wharekura
Writing banners wharekuraWriting banners wharekura
Writing banners wharekura
 
Singh Song
Singh SongSingh Song
Singh Song
 
20th century poetry1
20th century poetry120th century poetry1
20th century poetry1
 

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

Diane Cameron Poetry Collection # 1
Diane  Cameron Poetry Collection # 1Diane  Cameron Poetry Collection # 1
Diane Cameron Poetry Collection # 1THEATER ON WHEELS
 
以詩入樂20121217
以詩入樂20121217以詩入樂20121217
以詩入樂20121217apple00
 
25280570 Writing Down My Family2 Unit
25280570 Writing Down My Family2 Unit25280570 Writing Down My Family2 Unit
25280570 Writing Down My Family2 UnitJeremy McWilliams
 
MOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg Bem
MOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg BemMOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg Bem
MOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg BemGregoryBem
 
Shall I Compare Thee to a Line of Code?
Shall I Compare Thee to a Line of Code?Shall I Compare Thee to a Line of Code?
Shall I Compare Thee to a Line of Code?Lauren Scott
 
Mariana development
Mariana   developmentMariana   development
Mariana developmentjorawlings
 
Mariana development
Mariana   developmentMariana   development
Mariana developmentjorawlings
 

Similaire à A Bridge over Troubled Water: Synergies between Model Transformations and Software Maintenance Techniques (9)

Diane Cameron Poetry Collection # 1
Diane  Cameron Poetry Collection # 1Diane  Cameron Poetry Collection # 1
Diane Cameron Poetry Collection # 1
 
以詩入樂20121217
以詩入樂20121217以詩入樂20121217
以詩入樂20121217
 
25280570 Writing Down My Family2 Unit
25280570 Writing Down My Family2 Unit25280570 Writing Down My Family2 Unit
25280570 Writing Down My Family2 Unit
 
Http www.marcopoloartsmag
Http   www.marcopoloartsmagHttp   www.marcopoloartsmag
Http www.marcopoloartsmag
 
Elements of Poetry
Elements of PoetryElements of Poetry
Elements of Poetry
 
MOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg Bem
MOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg BemMOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg Bem
MOMENT, Benzoned, and Vaster Landscapes: Ratanakiri Poems by Greg Bem
 
Shall I Compare Thee to a Line of Code?
Shall I Compare Thee to a Line of Code?Shall I Compare Thee to a Line of Code?
Shall I Compare Thee to a Line of Code?
 
Mariana development
Mariana   developmentMariana   development
Mariana development
 
Mariana development
Mariana   developmentMariana   development
Mariana development
 

Dernier

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Dernier (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

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

  • 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, 2012 Budapest University of Technology and Economics Department of Measurement and Information Systems
  • 2. Song writing methods of Simon and Garfunkel
  • 3. Paul Simon’s technique #1 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 1. Create music first 2. Write lyrics accordingly 3
  • 4. Paul Simon’s technique #2 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 2. Compose music accordingly 4
  • 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 weeps Parsley, sage, rosemary and thyme; And waters the grave with its silent tears Between the salt water and the sea strand, While a soldier cleans and polishes a gun Then she'll 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. Naming These Techniques… Bridge Over Troubled Water When you're weary Feeling small Music Driven Song Development When tears are in your eyes I will dry them all (MDSD) 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 1. Create music first 2. Write lyrics 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 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. Applying the Principle to Software Systems Model Code 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 Music Lyrics 7
  • 8. Some Well-known Transformations Code generation Generative programming Model Code Model Re-engineering Query Query Program comprehension Model Refactoring Refactoring 8
  • 9. A Classification of Transformations M2T: Model-to-Text Model Code T2M: Text-to- Model Model Transformations: Topic of this talk M2M: Model-to-Model T2T: Text-to-Text 9
  • 10. Model-Driven Software Development M2T: Model-to-Text Model Code Conferences: M2M: Model-to-Model MODELS, ECMFA, ICMT 10
  • 11. Software Maintenance and Re-engineering Model Code T2M: Text-to- Model Conferences: CSMR, ICSM … T2T: Text-to-Text 11
  • 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. 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. Model Transformations in Model Driven Software Development
  • 15. 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 DO-178B  used in critical system design IEC 61508 Innovative Tool  Better System Qualified Tool  Certified Output
  • 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 models Equipment Certification (RTCA, EUROCAE) • Steven P. Miller: Certification Issues in Model Based Development • automatic source code generation (Rockwell Collins)  quality++ tools ++ development cost--
  • 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 Formal Vertical 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. Modeling Languages and Model Transformations
  • 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 Architecture Vertical 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. 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. Domain Specific Modeling Languages Concrete syntax Abstract syntax Well-formedness (Graphical/Textual) (Metamodel) constraints Behavioural semantics, Simulation Mapping Code generation Abstract syntax: Source Code View • Internal graph representation (Documentation, • Defined by a metamodel Configuration file)
  • 22. Domain Specific Modeling Languages Concrete syntax Abstract syntax Well-formedness (Graphical/Textual) (Metamodel) constraints Behavioural semantics, Simulation Mapping Code generation Well-formedness constraints: Source Code View • REQs for valid static models (Documentation, • Captured declaratively (OCL) Configuration file)
  • 23. Domain Specific Modeling Languages Concrete syntax Abstract syntax Well-formedness (Graphical/Textual) (Metamodel) constraints Behavioural semantics, Simulation Mapping Code generation Behavioural Semantics: Source Code View • For dynamic MLs only (Documentation, (statecharts, business processes) Configuration file) • Enables model simulation/execution
  • 24. Domain Specific Modeling Languages Concrete syntax Abstract syntax Well-formedness (Graphical/Textual) (Metamodel) constraints Behavioural semantics, Simulation Mapping Code generation View/Compile/Map: Source Code View • View / code generation (Documentation, • Model transformation exercise Configuration file)
  • 25. Model Transformation Overview: Metamodels Metamodel: Precise spec of a modeling language Modeling tool Source Target MT rule metamodel metamodel Source Target model model
  • 26. Model Transformation Overview: Models Eclipse 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:Transition p1:Place tk:Token p2:Place t2:Transition a4:TPArc a3:PTArc
  • 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. 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. 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. Overview of Model Transformations Eclipse Framework Model Transformation Tool Modeling tool Source Target MT rule metamodel metamodel Native 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. 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. Incremental Model Queries By EMF-IncQuery
  • 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 Generation Validation of design rules by incremental model queries Design + V&V Artifacts (Source code, Glue code, Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
  • 34. Challenge: Early validation of design rules SystemSignalGroup 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. Capturing design rules as model queries 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, … 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. 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. 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. Scalability of EMF-IncQuery EMF-IncQuery: available from Context of experiments: http://viatra.inf.mit.bme.hu/incquery • Generated AUTOSAR models • > 1,5 million model elements • #violations << model size Memory 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 sizes Measured scenarios: • Read and first check • Change and revalidate G. Bergmann et al.: Incremental evaluation of model queries over EMF models. MODELS 2010.
  • 39. Cross technology benchmarking for on-the-fly model validation 39
  • 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. 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. 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
  • 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 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 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. Incremental Forward Transformation MSRC TRACE MTRG 1. First transformation 2. Source model changes 3. Apply changes to target model M’SRC TRACE’ M’TRG Practical application scenarios: Solutions: • Incremental model synchronization • Bidirectional transformations • Tool integration • Change-driven transformations
  • 46. Incremental Backward Transformation MSRC TRACE MTRG 1. First transformation 2. Target model changes 3. Apply changes to source model M’SRC TRACE’ M’TRG Challenge: Recent Approaches: SRCTRG specified A. Schürr, P. Stevens, N. Foster, T. Hettel, TRGSRC inferred Cicchetti&Pierantonio, Czarnecki&Diskin
  • 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. Change Driven Model Transformations MSRC TRACE MTRG Change Driven Model Transformations Change Change ModelSRC ModelTRG M’SRC TRACE’ M’TRG Change 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. Design Space Exploration Hegedüs et al.: Quick fix generation for DSMLs. VL/HCC 2011 Hegedüs et al.: A Model Driven Framework for Guided Design Space Exploration ASE 2011
  • 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 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 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. Fixing errors in modern IDEs Visual Studio Smart Compile Auto Correction Netbeans Editor Hints Eclipse Quick Fix 51
  • 52. Our Context: Validation of BPMN processes Standard How to fix these Eclipse BPMN tool inconsistencies? 52
  • 53. Quick fix generation for BPMN editors 53
  • 54. Design Space Exploration Goals Design Alternative 1 Global Design Constraints Alternative 2 Operations Design Alternative 3 Initial Design Design Design Space Exploration Alternative 4 Special state space exploration • potentially infinite state space • „dense” solution space 54
  • 55. Model Driven Guided Design Space Exploration Model queries Seq of Transf. as Goals Initial model Rules 1 Operation Model queries Modified model Seq of Transf. as Constraints Constraints Rules 2 violated Transf. Rules Goals as 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. Result: Quick fix generation for BPMN editors Sequence of List of fixes Context edit operations 56
  • 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 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 Generation Back-annotation of execution traces Design + V&V Artifacts (Source code, Glue code, Config. Tables, Test Cases, Monitors, Fault Trees, etc.)
  • 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. 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. 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. Model Based Analysis System design Mathematical analysis Model High-level generation Mathematical System Model Receive request Fix problem model Calculate Rating Accept? Yes No Send offer Send rejection List of Receive answer Receive update request inconsistencies Analysis No Update? Yes (e.g model checker) Send reply
  • 64. Back-Annotation of Counter Example Traces Model High-level generation Mathematical System Model Receive request Replay of model source trace Calculate Rating Yes Accept? No Back-annotation Send offer Send rejection of target trace Receive 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. 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 reply Extended BPEL Simulator: • Current state: coloured • Intuitive navigation along the trace 
  • 66. Software Maintenance Techniques for Model Transformations
  • 67. Reengineering and Model Transformations Graph 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. 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. 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 MT as model as model o Ehrig et al. 2009 refactor 69
  • 70. Migration / Evolution change  Model migration Metamodel 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. 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 executions Transformation Transformation Program Slice Models Model Slice Model Transformation Slicing Z. Ujhelyi, A. Horvath, D. Varró: Dynamic backward 71 Slicing of MT programs. ICST 2012
  • 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 Architecture Vertical 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. 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 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 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. 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 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 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. 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 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 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. 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 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 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. 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