keynote extreme modelling 2014

71
Putting Engineering into MDE Components and contracts for models and transformations Steffen Zschaler 29 September, 2014 With (lots of) help by Francisco Duran, Jeffrey Terrell, Jendrik Johannes, Dimitris Kolovos, and many others All errors my own!

Upload: steffen-zschaler

Post on 24-Jan-2015

163 views

Category:

Software


0 download

DESCRIPTION

Slides from my keynote at XM 2014. http://www.di.univaq.it/XM2014/

TRANSCRIPT

Page 1: Keynote Extreme Modelling 2014

Putting Engineering into MDE

Components and contracts for models and transformations

Steffen Zschaler

29 September, 2014With (lots of) help by

Francisco Duran, Jeffrey Terrell, Jendrik Johannes, Dimitris Kolovos, and many others

All errors my own!

Page 2: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Motivation

• MDE is beginning to see some use– Automotive– Telecommunications– Enterprise systems (especially for quality prediction)

• Need for systematic engineering– To deal with scale of models– To deal with complexity of domains– To ensure correctness so MDE techniques can be

relied on

29/09/2014 2

Page 3: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Motivation (2)

• Elements of systematic MDE engineering– Requirements– Architectures– (Reusable) Components– Patterns and Architecture Styles– Methods and Guidelines

A re

sea

rch

ag

en

da

for the yea

rs to co

me

29/09/2014 3

Page 4: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Motivation (2)

• Elements of systematic MDE engineering– Requirements– Architectures– (Reusable) Components– Patterns and Architecture Styles– Methods and Guidelines

A re

sea

rch

ag

en

da

for the yea

rs to co

me

29/09/2014 3

Page 5: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

A framework for discussing composition

Uwe Aßmann: Invasive Software Composition.29/09/2014 4

Page 6: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

A framework for discussing composition

Component Model

(incl. contracts)

Uwe Aßmann: Invasive Software Composition.29/09/2014 4

Page 7: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

A framework for discussing composition

Composition Model(composition

technique)

Component Model

(incl. contracts)

Uwe Aßmann: Invasive Software Composition.29/09/2014 4

Page 8: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

A framework for discussing composition

Composition Language

Composition Model(composition

technique)

Component Model

(incl. contracts)

Uwe Aßmann: Invasive Software Composition.29/09/2014 4

Page 9: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

A framework for discussing composition

Composition System

Composition Language

Composition Model(composition

technique)

Component Model

(incl. contracts)

Uwe Aßmann: Invasive Software Composition.29/09/2014 4

Page 10: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Outline

1. Motivation

2. Models

3. Transformations

4. Challenges

29/09/2014 5

Page 11: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Outline

1. Motivation

2. Models

3. Transformations

4. Challenges

1. Composition techniques2. Contracts

29/09/2014 5

Page 12: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Model components

• Variety of approaches– Model/Package Import– AOM

• Package Merge• Language-specific merges

– E.g., for sequence diagrams– RAM, MATA, ...

• Generic merges– E.g., GeKo, Reuseware, ...

29/09/2014 6

Page 13: Keynote Extreme Modelling 2014

Model componentsExample 1

29/09/2014

Page 14: Keynote Extreme Modelling 2014

Model componentsExample 1

29/09/2014

Page 15: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014 8

Model componentsExample 2

Page 16: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014 8

Model componentsExample 2

Page 17: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014 8

Model componentsExample 2

Page 18: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014 8

Model componentsExample 2

Page 19: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014 8

Model componentsExample 2

Page 20: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014 8

Model componentsExample 2

Page 21: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014 8

Model componentsExample 2

Page 22: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Model componentsContracts?

• Only syntactical, if any– Meta-classes of elements expected– Naming and signatures of operations

• Key exception: Rely-Guarantee Specifications– For temporal logic and state machines

29/09/2014 9

Page 23: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Syntactic Contracts

29/09/2014 10

Page 24: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Syntactic Contracts

29/09/2014 10

Page 25: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Syntactic Contracts

29/09/2014 10

Page 26: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Outline

1. Motivation

2. Models

3. Transformations

4. Challenges

1. Composition techniques2. Contracts

29/09/2014 11

Page 27: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

29/09/2014 12

Page 28: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

InternalExternal

29/09/2014 12

Page 29: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

InternalExternal

Sequential

T1

M

1

M

2

M

3

T2

29/09/2014 12

Page 30: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

InternalExternal

Sequential Rule Superimposition(aka import with replacement)

29/09/2014 12

Page 31: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

InternalExternal

Sequential Rule Superimposition(aka import with replacement)

M

2

M

1

29/09/2014 12

Page 32: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

InternalExternal

Sequential Parallel Rule Superimposition(aka import with replacement)

T1

M

1

M

2

M

3

T2

M

4

M

5

29/09/2014 12

Page 33: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

InternalExternal

Sequential Parallel Rule Superimposition(aka import with replacement)

Rule Weaving(aka full aspect orientation)

29/09/2014 12

Page 34: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

InternalExternal

Sequential Parallel Rule Superimposition(aka import with replacement)

Rule Weaving(aka full aspect orientation)

M

2

M

1

29/09/2014 12

Page 35: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation CompositionSequential

OO to Relational

Class Model

Table Model

29/09/2014 13

Page 36: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation CompositionSequential

Table Model

NormalisedTable Model

Normalisation

29/09/2014 13

Page 37: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation CompositionSequential

OO to Relational

Class Model

Table Model

NormalisedTable Model

Normalisation

29/09/2014 13

Page 38: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

:Table

<<hook>>:Column

*

Page 39: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

:Table

<<hook>>:Column

*:Class

Page 40: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

:Table

<<hook>>:Column

*:Class

:Attribute

Page 41: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

<<anchor>>:Column

:Table

<<hook>>:Column

*:Class

:Attribute

Page 42: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

<<anchor>>:Column

:Table

<<hook>>:Column

*:Class

:Attribute

Page 43: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

<<anchor>>:Column

:Table

<<hook>>:Column

*:Class

:Attribute

:Classsuper

sub

Page 44: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

<<anchor>><<slot>>:Table

<<hook>>:Column

*

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

<<anchor>>:Column

:Class

:Attribute

:Classsuper

sub

Page 45: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

<<anchor>><<slot>>:Table

<<hook>>:Column

*

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

<<anchor>>:Column

<<anchor>><<slot>>:Table

<<hook>>:Column

*

:Class

:Attribute

:Classsuper

sub

Page 46: Keynote Extreme Modelling 2014

Transformation Composition

Parallel

<<anchor>><<slot>>:Table

<<hook>>:Column

*

Based on Jendrik Johannes, Steffen Zschaler, Miguel A. Fernández, Antonio Castillo, Dimitrios S. Kolovos, Richard F. Paige: Abstracting Complex Languages through Transformation and Composition. MODELS 2009, LNCS 5795, pp 546–550.

<<anchor>>:Column

<<anchor>><<slot>>:Table

<<hook>>:Column

*

:Class

:Attribute

:Classsuper

sub

Weaving

Weaving

Page 47: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

Superimposition

Based on Lawley, M., Duddy, K., Gerber, A., Raymond, K. Language Features for Re-Use and Maintainability of MDA Transformations. OOPSLA & GPCE Workshop, 2004

and: Jouault, F. and Kurtev, I. Transforming models with ATL. In: Satellite Events at the MoDELS 2005 Conference, Oct 2005, Montego Bay, Jamaica. pp. 128-138, LNCS 3844 (long version from http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.6117&rep=rep1&type=pdf )

module Class2Relational;create OUT : Relational from IN : Class;

rule Class2Table { from c : Class!Class to out : Relational!Table ( name <- c.name, col <- Sequence {key} ->union(c.attr)), key : Relational!Column ( name <- 'objectId', type <- objectIdType)}

rule Attribute2Column { from a : Class!Attribute to out : Relational!Column ( name <- a.name, type <- a.type)}

29/09/2014 15

Page 48: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

Superimposition

Based on Lawley, M., Duddy, K., Gerber, A., Raymond, K. Language Features for Re-Use and Maintainability of MDA Transformations. OOPSLA & GPCE Workshop, 2004

and: Jouault, F. and Kurtev, I. Transforming models with ATL. In: Satellite Events at the MoDELS 2005 Conference, Oct 2005, Montego Bay, Jamaica. pp. 128-138, LNCS 3844 (long version from http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.6117&rep=rep1&type=pdf )

module Class2Relational;create OUT : Relational from IN : Class;

rule Class2Table { from c : Class!Class to out : Relational!Table ( name <- c.name, col <- Sequence {key} ->union(c.attr)), key : Relational!Column ( name <- 'objectId', type <- objectIdType)}

rule Attribute2Column { from a : Class!Attribute to out : Relational!Column ( name <- a.name, type <- a.type)}

module Class2RelationalInheritance;create OUT : Relational from IN : Class;

rule Class2Table { from c : Class!Class ( c.parent.oclIsUndefined()) to out : Relational!Table ( name <- c.name, col <- Sequence {key} ->union(c.flattenedFeatures)), key : Relational!Column ( name <- 'objectId', type <- objectIdType)}

-- flattenedFeatures helper not shown.-- It collects all features of a class-- and all its sub-classes

29/09/2014 15

Page 49: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Transformation Composition

Superimposition

Based on Lawley, M., Duddy, K., Gerber, A., Raymond, K. Language Features for Re-Use and Maintainability of MDA Transformations. OOPSLA & GPCE Workshop, 2004

and: Jouault, F. and Kurtev, I. Transforming models with ATL. In: Satellite Events at the MoDELS 2005 Conference, Oct 2005, Montego Bay, Jamaica. pp. 128-138, LNCS 3844 (long version from http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.6117&rep=rep1&type=pdf )

module Class2Relational;create OUT : Relational from IN : Class;

rule Class2Table { from c : Class!Class to out : Relational!Table ( name <- c.name, col <- Sequence {key} ->union(c.attr)), key : Relational!Column ( name <- 'objectId', type <- objectIdType)}

rule Attribute2Column { from a : Class!Attribute to out : Relational!Column ( name <- a.name, type <- a.type)}

module Class2Relational;create OUT : Relational from IN : Class;

rule Class2Table { from c : Class!Class ( c.parent.oclIsUndefined()) to out : Relational!Table ( name <- c.name, col <- Sequence {key} ->union(c.flattenedFeatures)), key : Relational!Column ( name <- 'objectId', type <- objectIdType)}

rule Attribute2Column { from a : Class!Attribute to out : Relational!Column ( name <- a.name, type <- a.type)}

-- flattenedFeatures helper-- not shown...

29/09/2014 15

Page 50: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014

Transformation Composition

Weaving

16

Page 51: Keynote Extreme Modelling 2014

(c) Steffen Zschaler29/09/2014

Transformation Composition

Weaving

16

Page 52: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Contracts

• Need both syntactical and semantic contracts

• Goal:– Be precise enough to enable reasoning and

give assurances– Be lenient enough to maximise reusability

29/09/2014 17

Page 53: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Contracts (2)

Will look at two types of contracts:– Syntactic contracts for sequential composition

(aka model typing)– Semantic contracts for rule weaving

29/09/2014 18

Page 54: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Contracts for sequential composition

• Contracts specify the kinds of models read and written by a transformation

• Options:1. Meta-models

2. Effective meta-models

3. Model types / Concepts

OO to Relational

Class Model

Table Model

NormalisedTable Model

Normalisation

29/09/2014 19

Page 55: Keynote Extreme Modelling 2014

Model typing problems

mmo NewSM (s : Simple) { s += new StateMachine ()}

S. Zschaler: Towards Constraint-Based Model Types: A Generalised Formal Foundation for Model Genericity.In VAO’14

Page 56: Keynote Extreme Modelling 2014

Model typing problems

mmo NewSM (s : Simple) { s += new StateMachine ()}

StateMachineState

name: String

Transitionevent: String

initialState0..1

containedState *

src 1

tgt1

incoming*

*outgoing

S. Zschaler: Towards Constraint-Based Model Types: A Generalised Formal Foundation for Model Genericity.In VAO’14

Page 57: Keynote Extreme Modelling 2014

Model typing problems

mmo NewSM (s : Simple) { s += new StateMachine ()}

StateMachineState

name: String

Transitionevent: String

initialState0..1

containedState *

src 1

tgt1

incoming*

*outgoing

Difference between Simple and Mandatory-startMandatory-start <:Steel Simple

S. Zschaler: Towards Constraint-Based Model Types: A Generalised Formal Foundation for Model Genericity.In VAO’14

Page 58: Keynote Extreme Modelling 2014

Model typing problems

mmo NewSM (s : Simple) { s += new StateMachine ()}

StateMachineState

name: String

Transitionevent: String

initialState0..1

containedState *

src 1

tgt1

incoming*

*outgoing

Difference between Simple and Mandatory-start

Error: Allows passing in Mandatory-start instance, but breaks it.

Mandatory-start <:Steel Simple

S. Zschaler: Towards Constraint-Based Model Types: A Generalised Formal Foundation for Model Genericity.In VAO’14

Page 59: Keynote Extreme Modelling 2014

mmo NewSM (s : Simple) { sm := new StateMachine () ; sm.initialState += new State () ; s += sm}

Model typing problems

StateMachineState

name: String

Transitionevent: String

initialState0..1

containedState *

src 1

tgt1

incoming*

*outgoing

Difference between Simple and Mandatory-startMandatory-start <:Guy Simple

S. Zschaler: Towards Constraint-Based Model Types: A Generalised Formal Foundation for Model Genericity.In VAO’14

Page 60: Keynote Extreme Modelling 2014

mmo NewSM (s : Simple) { sm := new StateMachine () ; sm.initialState += new State () ; s += sm}

Model typing problems

StateMachineState

name: String

Transitionevent: String

initialState0..1

containedState *

src 1

tgt1

incoming*

*outgoing

Difference between Simple and Mandatory-start

Over-restriction: Would work with Mandatory-start instance, but cannot specify.

Mandatory-start <:Guy Simple

S. Zschaler: Towards Constraint-Based Model Types: A Generalised Formal Foundation for Model Genericity.In VAO’14

Page 61: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Syntactic contracts:Research challenges

• Type theory of transformations– Including intrinsic and extrinsic contracts

• Static analysis of transformations– Data flow analysis

• Tool support for managing and checking transformation contracts

29/09/2014 21

Page 62: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Contracts for rule weaving

29/09/2014 22

Page 63: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Contracts for rule weaving

29/09/2014 22

Page 64: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Contracts for rule weaving

• Morphisms over transformation systems– Both for parameter and bindings

• Define Properties of morphisms to ensure semantics of weaving– Behaviour reflection and preservation

Semantic contracts

29/09/2014 23

Page 65: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

• Other semantic properties– Allow some change of behaviour– Express behaviour of base parametrised over

transformations to be woven

Semantic contracts:Research challenges

29/09/2014 24

Page 66: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

• Other semantic properties– Allow some change of behaviour– Express behaviour of base parametrised over

transformations to be woven

Semantic contracts:Research challenges

τM1 M2

29/09/2014 24

Page 67: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

• Other semantic properties– Allow some change of behaviour– Express behaviour of base parametrised over

transformations to be woven

Semantic contracts:Research challenges

τM1 M2

ζ

sem1 sem2

Γ1 Γ229/09/2014 24

Page 68: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

• Other semantic properties– Allow some change of behaviour– Express behaviour of base parametrised over

transformations to be woven

Semantic contracts:Research challenges

τ(τ1, .. , τn)

f(ζ1, .. , ζn)

M1 M2

ζ

sem1 sem2

Γ1 Γ229/09/2014 24

Page 69: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Outline

1. Motivation

2. Models

3. Transformations

4. Challenges

29/09/2014 25

Page 70: Keynote Extreme Modelling 2014

(c) Steffen Zschaler

Research Agenda

• Need a calculus of transformation components– What do they look like?– What composition operations are there?– What are contracts?– What properties can we derive for composite transformations?

• Some work exists:– See talk– Megamodelling (e.g., MINNT for typing)

• But are still missing fundamental theory

29/09/2014 26

Page 71: Keynote Extreme Modelling 2014

(c) Steffen Zschalerhttp://xkcd.com/1343/

29/09/2014