+ All Categories
Home > Documents > The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem...

The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem...

Date post: 10-Mar-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
79
INF 5150 7-Nov-14 INF5150 INFUIT Haugen / Stølen 1 Variability Modeling by Øystein Haugen Version 141107
Transcript
Page 1: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

7-Nov-14 INF5150 INFUIT Haugen / Stølen 1

Variability Modeling by Øystein Haugen

Version 141107

Page 2: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

2

What do we mean by “variability”?

Product Line variance – often variants of the same

software base Cross-cutting variability

– often variability is orthogonal to the software design

– variability needs are discovered after the first software design

The variability designer is not always the software designer – division of labor and of

competences

11/7/2014 CVL – Common Variability Language

Page 3: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Common ways to model variability Framework/ Configuration

Union-of-all-systems

Domain Specific

Languages How? By

mechanisms of a general language

As annotations to

a language

By the specific language

mechanisms

Constructs Function, Type, Inheritance, Template,

Plugin

Pragma, Stereotype,

feature diagram

Proprietary language constructs

unforeseen modeling

needs

Just enhance the final model

Enhance the product line

model

If not expressible, enhance the

language

11/7/2014 CVL – Common Variability Language 3

Page 4: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

4

The worlds of UML and DSL

UML – 700 pages, >100 classes – 2000 issues after UML 2.0 – semantic variation points – No correct implementation (?)

Education – Taught in schools – Used by thousands

misused by even more

Migration – Big steps (UML 1 to UML 2) – Up front review process

DSL (imagine one you know) – no pages, no definition doc. – <50 classes – The code generator is the

semantics Education

– Ad hoc teaching in-house – Used by a few dedicated ones

but hardly misused

Migration – Many small steps

and version problems – Review process post festum

Page 5: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

5

UML and DSL continued

UML problem – there are many ways to goal

all of them to be implemented – typically something is skipped

UML Profiles – additions to UML

carries UML on its back with all its faults (in principle) and its benefits

– thus even bigger than UML needs to piggyback on UML

tool

DSL problem – there is no way to the goal

and a way must be made – typically need for abstractions

Meta-libraries – additions to the DSL

selected for the needs but the concepts must be

combined with the DSL – libraries have useful stuff

and also useless stuff clutters the DSL concepts

Page 6: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

6

The Compromise

DSL VAR focused on domain standardized

DSL+VAR easy code generator available general tools

Page 7: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

7

ARI – the simplest DSL expr

aoperand

1..*

aoperator

*

moperand

1..*

moperator

*

basicterm POT

1..2

varparenthesis num

MULT DIV

PLUS MINUS

3*x^2 – 4*x + 1 3*x*y + 5

Page 8: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

8

The need for abstraction

The ARI language can describe any arithmetic expression – thus it is ”complete” within its domain – but modeling every desirable arithmetic expression from scratch

may be too time consuming or too error prone

We would like to use some of the arithmetic expressions that we have already made – or we would like to have the chance to define general patterns

and reuse those effectively in new descriptions

Two ways to achieve simple abstraction from ARI: – Enhance the DSL by some general function or type concept – Apply a generative approach: The VARiability language

Page 9: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

9

FUNC: enhancing ARI with function

Specific

General

function

body1

call

func

actualparameter

fparm

aparm

expr

aoperand

1..*

aoperator

*

moperand

1..*

moperator

*

basicterm POT

1..2

varparenthesis num

MULT DIV

PLUS MINUS

formalparameter

f(x) = 3*x^2 – 4*x + 1 g(y) = f(y)*R h(x,y) = 3*x*y + 5

Page 10: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

10

The generative ARI+VAR+RES

DSL model (ARI: 3*x^2 – 4*x + 1)

VAR (vary coefficients)

VAR

RES (resolve coefficients)

Page 11: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

11

One example ARI+VAR+RES

3x^2-4x+1:expr

3x^2:aoperand - 4x:aoperand + 1:aoperand

3:moperand * x^2:moperand 4:moperand * x:moperand

3:num x:var ^ 2:num 4:num

varyingcoeffs:VariationModel

Acoeff:VariationElement

Bcoeff:VariationElement

Ccoeff:VariationElement

A:Value

Transformer

B:Value

Transformer

C:Value

Transformer

-6x^2-23x+14:ResolutionModel

-6:ValueResolution

23:ValueResolution

14:ValueResolution

3x2-4x+1

3Ax2-4Bx+1C

-6x2-23x+14

one formula

any formula

one formula

Page 12: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

12

Across the river for water?

We started with a specific formula (arithmetic expression) – and ended up with a specific second order polynomial

What is gained? – The basic DSL must always have the full modeling capabilities

thus adding variability does not add the ability to model new products – Modeling is not only about what can be described

then we could all settle for assembler code – Modeling is about effective description

cooperation, maintenance, similarities

ARI can express every polynomial – but ARI cannot express the concept ”Polynomial”

Page 13: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

13

Comparing FUNC and ARI+VAR+RES

FUNC – Functions vary over values at

runtime – Adding functions to ARI adds

obligation to implement them in the code generator

– Adding functions to ARI is a job for the language designer

– Functions represent variability aligned with the original design

– Adding functions to ARI does not exclude also applying VAR

ARI+VAR+RES – VAR expressed values that

vary at compiletime – Applying VAR to ARI creates

no new implementation obligations

– Applying VAR to ARI is a job for the variability designer

– Applying VAR may cross-cut the original design

– Applying VAR to ARI does not exclude adding functions to ARI

Page 14: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

14

Advantages of the BVR approach

Base Language (DSL) – Focused language design for the DSL designers – Simplest implementation of DSL tools

Variation and Resolution Languages – Standard

Up front reviewing process Community Common variability tools

– Requirements Only that all the metamodels are described in MOF

– which will make the semantics of the VAR language definable in QVT

Language Engineering Process – Division of labor and reaping differences of competence

Page 15: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Goals for OMG Standardization

Intuitive ways to describe the product line variability on high abstraction level – and means to configure products without being a software

specialist

Automatic means to produce products from product line (cf. MDA)

Generic ways to describe variability – that can work well with product line descriptions in any base

language

Techniques for making generic tools that can work well with the tools for the base languages

11/7/2014 CVL – Common Variability Language 15

Page 16: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Common Variability Language

CVL = Common Variability Language The objective of CVL is to enable the specification of the variability in

product line models in order to support seamless product line modeling across the whole product line engineering process.

CVL is a specification language including a metamodel, semantics and concrete syntax for variability specification.

Variability specifications shall relate to a base product line model that describes the whole product line and shall comprise: – a variability model with the following elements: a model of possible choices

and relationships between those choices and the base model – resolution models which resolve variability (by a set of choices) and thus

define specific product models. CVL shall support base models in languages that are defined by

means of metamodels, including UML and Domain Specific Languages.

11/7/2014 CVL – Common Variability Language 16

Page 17: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

CVL Tutorial

CVL in a Nutshell

11/7/2014 CVL – Common Variability Language 17

Page 18: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

DSL

Variability model

CVL

Base model

Generic & Standardized

resolution models

Focused on a domain

Execute CVL

Resolved models

Specification in CVL of

base model variabilities

Product line model in any MOF-compliant language

Selection of a set of choices in the variation model

Product models fully described in the base language. All regular base language tools can be applied to these models

CVL overview and terms

11/7/2014 CVL – Common Variability Language

Page 19: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Printer«Block»

mainSupply:MainPower1

Attributes

Operations

powerCtrl

emgSupply:EmgPower1

Attributesthreshold:int

Operations

powerCtrl

inputSection1

highSpeedConnector1

Attributes

Operations

MainPowerCtrl EmgPowerCtrl

MainPower«Block»

Values

Operations

powerCtrlEmgPower

«Block»

Valuesthreshold:int

powerCtrl

Variation Points over base model :ObjectExistence :SlotValueAssignment

CVL variation points

SYSML (base model) elements

:ObjectExistence :ObjectExistence

Variability in this example:

Part EmergencySupply is optional

Part HighSpeedConnector is optional

Port EmgPowerCtrl on block Printer is optional

Value of attribute threshold in block EmergencyPower is variable

11/7/2014 CVL – Common Variability Language 19

Page 20: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Variation points in CVL

Variation Points refer to Base objects Variation Points define the base model modifications

precisely There are different kinds of Variation Points

– Existence – Value assignment – Substitution – Opaque variation point – Configurable Unit

11/7/2014 CVL – Common Variability Language 20

Page 21: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Printer«Block»

mainSupply:MainPower1

Attributes

Operations

powerCtrl

emgSupply:EmgPower1

Attributesthreshold:int

Operations

powerCtrl

inputSection1

highSpeedConnector1

Attributes

Operations

MainPowerCtrl EmgPowerCtrl

MainPower«Block»

Values

Operations

powerCtrlEmgPower

«Block»

Valuesthreshold:int

powerCtrl

VSpec trees and binding

Printer

EmergencyPower

threshold:Int

Variation points

VSpec tree choice variable constraint

HighSpeed & threshold>100 EmergencyPower

HighSpeed

:ObjectExistence :SlotValueAssignment :ObjectExistence :ObjectExistence

11/7/2014 CVL – Common Variability Language 21

Page 22: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

VSpecs in CVL

VSpecs (Variation Specifications) describe the abstract variability

Every Variation Point is bound to exactly one VSpec VSpecs come in different kinds:

– Choice – Variable – Constraint – VClassifier – CVSpec

11/7/2014 CVL – Common Variability Language 22

Page 23: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Constraints in CVL

CVL include a basic language for expressing constraints on the VSpec tree – Propositional logic is supported

CVL also has the opportunity to let you apply other constraint languages like OCL

11/7/2014 CVL – Common Variability Language 23

Page 24: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Printer«Block»

mainSupply:MainPower1

Attributes

Operations

powerCtrl

emgSupply:EmgPower1

Attributesthreshold:int

Operations

powerCtrl

inputSection1

highSpeedConnector1

Attributes

Operations

MainPowerCtrl EmgPowerCtrl

MainPower«Block»

Values

Operations

powerCtrlEmgPower

«Block»

Valuesthreshold:int

powerCtrl

Resolution

11/7/2014 CVL – Common Variability Language 24

Printer

EmergencyPower

threshold:Int

Variation points

HighSpeed

:ObjectExistence :SlotValueAssignment :ObjectExistence :ObjectExistence

True

90

False

Resolution model

HighSpeed & threshold>100 EmergencyPower

Page 25: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Variability Resolution in CVL

VSpecResolution elements refer to VSpecs The set of valid Resolutions is restricted by the

constraints Represent information necessary to materialize product

models – Actual yes/no decisions on Choices – Actual values to Variables – Instances of VClassifiers – Configurations of CVSpecs/Configurable Units

11/7/2014 CVL – Common Variability Language 25

Page 26: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Printer«Block»

mainSupply:MainPower1

Attributes

Operations

powerCtrl

emgSupply:EmgPower1

Attributesthreshold:int

Operations

powerCtrl

inputSection1

highSpeedConnector1

Attributes

Operations

MainPowerCtrl EmgPowerCtrl

MainPower«Block»

Values

Operations

powerCtrlEmgPower

«Block»

Valuesthreshold:int

powerCtrl

Materialization

11/7/2014 CVL – Common Variability Language 26

Printer

EmergencyPower

threshold:Int

Variation points

HighSpeed

:ObjectExistence :SlotValueAssignment :ObjectExistence :ObjectExistence

True

90

False

Resolution model

HighSpeed & threshold>100 EmergencyPower

Printer«Block»

mainSupply:MainPower1

Attributes

Operations

powerCtrl

emgSupply:EmergencyPower1

Attributesthreshold:int=90

Operations

powerCtrl

InputSection1

MainPowerCtrlEmgPowerCtrl

MainPower«Block»

Values

Operations

powerCtrl

EmergencyPower«Block»

Valuesthreshold:int=90

powerCtrl

Materialization

threshold=90

Page 27: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Materialization (with annotations)

11/7/2014 CVL – Common Variability Language 27

Printer«Block»

mainSupply:MainPower1

Attributes

Operations

powerCtrl

emgSupply:EmergencyPower1

Attributesthreshold:int=90

Operations

powerCtrl

InputSection1

MainPowerCtrlEmgPowerCtrl

MainPower«Block»

Values

Operations

powerCtrl

EmergencyPower«Block»

Valuesthreshold:int=90

powerCtrl

Product Model (materialized model)

Printer«Block»

mainSupply:MainPower1

Attributes

Operations

powerCtrl

emgSupply:EmgPower1

Attributesthreshold:int

Operations

powerCtrl

inputSection1

highSpeedConnector1

Attributes

Operations

MainPowerCtrl EmgPowerCtrl

MainPower«Block»

Values

Operations

powerCtrlEmgPower

«Block»

Valuesthreshold:int

powerCtrl

{?}

{?}

{=?}

{?}

Product Line Model

Materialization

Page 28: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Configurable Unit and VInterface

11/7/2014 CVL – Common Variability Language 28

PrinterPackage

AcmePower TexasPower

ObjectExistence ObjectExistence

Acme Texas

Power

1..1

Printer_CU

Printer_Int

Pr_Cv

CU

VInterface

CVSpec

Binding

Base model reference

Page 29: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

CVL Architecture

Base Model

Variability Abstraction Variability Realization

Constraints

Resolutions

Configurable Units Variability Interfaces

VSpecs Variation Points

11/7/2014 CVL – Common Variability Language 29

Page 30: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

CVL Tutorial

CVL in Detail

11/7/2014 CVL – Common Variability Language 30

Page 31: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Recall CVL Architecture

Base Model

Variability Abstraction Variability Realization

Constraints

Resolutions

Configurable Units Variability Interfaces

VSpecs Variation Points

11/7/2014 CVL – Common Variability Language 31

Page 32: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Variability Specification (Vspec)

32

Scanner

Type BothSides

Color BW

1..1

Choice

Group multiplicity of type XOR/alternative (1..1): a scanner can be either of type color or BW

Choice

Is implied by parent=true

(mandatory) speed: integer

Is implied by parent=false (optional)

Variable

11/7/2014 CVL – Common Variability Language

Page 33: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Abstract variability specifiers Similar to features in feature modeling Essentially decisions like in decision modeling Example: “GPS” is a feature of a camera, but it is also a

choice, which can be decided yes/no VSpecs can be used for feature modeling Variation points are bound to VSpecs,

giving semantics to VSpecs. VSpecs are arranged in trees, Parent-child relations organize

the resolution space in usual way, like in FMs.

Variability Specification (Vspec)

11/7/2014 CVL – Common Variability Language 33

Scanner

Type BothSides

Color BW

1..1

speed: integer

Page 34: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

VSpec Types (continued)

Choice requires yes/no decision Variable is a VSpec allows for providing a value of a

specified type VClassifier allows for creating instances and then

providing per-instance resolutions for the VSpecs in its sub-tree

Composite VSpecs – used for modularity (not covered)

11/7/2014 CVL – Common Variability Language 34

Page 35: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

VClassifier

11/7/2014 CVL – Common Variability Language 35

PrinterPool

Printer [*]

Speed Color

X20 X22

1..1

VClassifier

Instance multiplicity of Printer indicating 0 to any number of instances

Every printer has a Speed

choice

Page 36: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Constraints

Express intricate relations between VSpecs That cannot be captured by trees

CVL offers basic constraint language A sublanguage of OCL

Other constraint languages, including full OCL, are

admitted. We show the basic language by example And a bit of the full OCL

11/7/2014 CVL – Common Variability Language 36

Page 37: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Simple Propositional Constraints

11/7/2014 CVL – Common Variability Language 37

fax

PrinterPool

printer fax implies printer

Page 38: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Complex Propositional Constraints

11/7/2014 CVL – Common Variability Language 38

fax

PrinterPool

printer

(fax implies printer) and (copier implies (scan and

printer))

scan copier

• Global context used in this example • Using PrinterPool would be equivalent

Page 39: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Arithmetic Constraints

11/7/2014 CVL – Common Variability Language 39

PrinterPool minSpeed : int speed : int

Speed = minSpeed + 300

Page 40: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Path Expressions

11/7/2014 CVL – Common Variability Language 40

fax

PrinterPool

printer

PrinterPool.fax implies PrinterPool.printer

Now using fully qualified names, instead of relying on name disambiguation.

Page 41: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Implicit Quantification

11/7/2014 CVL – Common Variability Language 41

color

Printer [1..*]

colorPrinterHead color implies colorPrinterHead

PrinterPool

Page 42: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Recall CVL Architecture

Base Model

Variability Abstraction Variability Realization

Constraints

Resolutions

Configurable Units Variability Interfaces

VSpecs Variation Points

11/7/2014 CVL – Common Variability Language 42

Page 43: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

The Base Model of the Scanner

11/7/2014 CVL – Common Variability Language 43

Feeder speed:integer

Scanner

f:Feeder speed=100

BW

Quality

q:Quality

t:Turner

Turner

Color

Object Existence

Object Substitution

ParametricSlot Assignment

Page 44: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

The VSpec layer of the Scanner

11/7/2014 CVL – Common Variability Language 44

Scanner

Type BothSides

Color BW

1..1

speed: integer

Page 45: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

One resolution of the Scanner

11/7/2014 CVL – Common Variability Language 45

Scanner = True

Type = True

BothSides = False

Color = True BW =

False

speed = 200

Scanner

Type

BothSides

Color BW

1..1

speed: integer

Page 46: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Realization Layer of the Scanner (Object)

11/7/2014 CVL – Common Variability Language 46

Feeder speed:integer

Scanner

f:Feeder speed=100

BW

Quality

q:Quality

t:Turner

Turner

Color

Scanner

Type

BothSides

Color

BW

1..1

speed: integer

ParametricSlotAssignment slotIdentifier=”speed”

ObjectExistence

Object Substitution

Object Substitution

Page 47: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

The resulting product of the Scanner

11/7/2014 CVL – Common Variability Language 47

Feeder speed:integer

Scanner

f:Feeder speed=200

BW

Color

q:Color

Turner

Scanner = True

Type = True

BothSides = False

Color = True

BW = False

speed = 200

Page 48: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

The Printer Pool

VClassifiers

7-Nov-14 INF5150 INFUIT Haugen / Stølen 48

Page 49: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

The base model of the PrinterPool

11/7/2014 CVL – Common Variability Language 49

PrinterPool

p:Printer[1..*]

PX

Printer color:Boolean speed:String

Page 50: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

The VSpec layer of the PrinterPool

11/7/2014 CVL – Common Variability Language 50

PrinterPool

Printer [*]

Speed Color

X20 X22

1..1

Page 51: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

One resolution of PrinterPool

11/7/2014 CVL – Common Variability Language 51

PrinterPool =True

VInst1:Printer

Speed = True

Color = True

X20 = True

PrinterPool

Printer [*]

Speed Color

X20 X22 X22 =

False

VInst2:Printer

Speed = True

Color = False

X20 = False X22 =

True

1..1

Page 52: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Realization Layer of the PrinterPool

11/7/2014 CVL – Common Variability Language 52

PrinterPool p:Printer[1..*]

PY

color:Boolean = True speed:String = “X20”

Printer

PrinterPool

Printer [*]

Speed Color

X20 X22

FragmentSubstitution multi=True

SlotAssignment slotIdentifier=”speed”, value=”X20”

SlotAssignment slotIdentifier=”speed”, value=”X22”

(Realization of Color not shown)

placement

replacement

(Green arrow is ‘scope’ ref)

1..1

PX

Printer color:Boolean speed:String

Page 53: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Achieving generality: The Fragment

CVL has two layers: abstraction layer and realization layer Substitution is the key concept of realization layer The fragments are on the model instances and they are all

defined by MOF

11/7/2014 CVL – Common Variability Language 53

Page 54: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Resulting Product model of PrinterPool

11/7/2014 CVL – Common Variability Language 54

Printer

color:Boolean speed:String

PrinterPool

p:Printer[1..*]

P1

color:Boolean = True speed:String = “X20”

Printer

color:Boolean speed:String

P2

color:Boolean = False speed:String = “X22”

one P1 and one P2 are included in p:Printer. How to achieve this is not shown here for simplicity.

Page 55: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Semantics of Fragment substitution

Simple fragment substitution when multi=False – Delete the placement – Make a copy of the replacement – Bind the replacement copy to the hole of the placement

The boundary points must correspond

Multiple fragment substitution when multi=True – Delete the placement – Make a number of copies of the replacement

the actual number of copies is given by the resolution model resolving the VSpec that refers the given FragmentSubstitution

– Bind all the copies to the hole of the placement All references into the placement must have multiplicity more than

one

11/7/2014 CVL – Common Variability Language 55

Page 56: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Opaque Variation Point (1/2)

11/7/2014 CVL – Common Variability Language 57

Page 57: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Opaque Variation Point (2/2)

11/7/2014 CVL – Common Variability Language 58

Printer

MainPowerSupply

AcmePowerTexasPower

EmergencyPowerSupply

<1..1>

maxNumberOfAdapters: Int

Choice

Variable

Abstraction (vSpec Tree)

Bindings

OpaqueVariationPoint 1 OpaqueVariationPoint 2Realization

Variation Point

placeHoldersourceObject

SpecialSubstitution

Base Models

SemanticSpec1

type

spec

Sample Transformation Rule for1. Copying all attributes associated with self->placeHolder to self->sourceObject2. Assign self->sourceObject.powerType= self->sourceObject.Name3. Substitute self->placeHolder by self->sourceObject

Page 58: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Recall CVL Architecture

Base Model

Variability Abstraction Variability Realization

Constraints

Resolutions

Configurable Units Variability Interfaces

VSpecs Variation Points

11/7/2014 CVL – Common Variability Language 59

Page 59: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Configurable Units: Mission Statement

Produce configurable components reusable across multiple projects

Associate a collection of variability declarations with a base model container

Containers: UML/SYSML component, package or class, etc …

Hide details, Expose variability interface Component can be configured Reuse CUs: clone-and-own or by reference

11/7/2014 CVL – Common Variability Language 60

Page 60: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Examples

remember?

7-Nov-14 INF5150 INFUIT Haugen / Stølen 61

Page 61: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Page 62: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Page 63: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Page 64: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Page 65: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Page 66: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Page 67: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

CVL – Early Experiments

SINTEF CVL Tool (Projects CESAR and VERDE)

11/7/2014 CVL – Common Variability Language 69

Page 68: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Example of industrial applications

11/7/2014 CVL – Common Variability Language 70

Elevator

Paper Cutting Machine

Pumps

Pumps

Page 69: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Safe Power Drive System – PDS (SR) Drive

Plug-in safety

module Safe Drive

STO (Safe Torque Off - cut power to

motor)

Optional tachometer (Speed and direction)

Optional brake

11/7/2014 CVL – Common Variability Language 71

Page 70: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Domain and Product Variability

Conveyor belt safety requirements:

1. An emergency stop device shall be provided 2. The safety-related part of the control system

shall comply with Safety Integrity level SIL2. 3. Devices for detection of unexpected start-up

shall be provided. 4. The drive system shall be designed, that the

speed does not exceed the designed speed.

Hoisting machine (e.g. crane, elevator...) safety requirements:

1. ..... 2. The safety-related part of the control system

shall comply with Safety Integrity level SIL3. 3. ...... 4. Machine shall be fitted with braking devices

Safety functions selected: Safety Function 1: STO (Safe Torque Off) (mandatory) Safety Function 2: SSE (Safe Stop Emergency)

Safety Function 3: SMS (Safe Maximum Speed))

Safety functions selected: Safety Function 1: STO (Safe Torque Off)) (mandatory) Safety Function 2: SBC (Safe Brake Control) Safety Function 3: SSE (Safe Stop Emergency) Safety Function 4: SS1 (Safe Stop 1) (with encoder)

11/7/2014 CVL – Common Variability Language 72

Page 71: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Safety Drive Product Line

Safety Drive (one product with the Safety Module)

The Safety Module and a Safety Drive

Safety Module (here simulated)

Motor Controller Motor

Executable Testing Code

Product Configuration File

11/7/2014 CVL – Common Variability Language 73

Page 72: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

74

Safety Module scenarios

Safety Module scenarios, documentation, expertise

CVL Abstraction Layer

CVL Realization Layer

CVL Realization Layer

Product Configuration

Template

UML Product model with tests

Product Configuration File

Product Simulation

Code

Base Configuration

Template

Configuration Fragments

Configuration Fragments

Base UML Model incl. tests

UML Fragments UML Fragments

Ecore (meta)metamodel

UML metamodel + JavaFrame profile

+ UML Testing Profile

CVL metamodel

CVL Resolution

generate

configure

instantiate

Product Simulation Execution

Deployment compile and run

Derivation

Variability and domain design

Executable Testing Code

execute tests

code

Page 73: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

The Executable Base Model: UML on Papyrus with profiles

Composite structure(s)

State Machine(s)

«SUT» Safety Module

«Test Component» Motor Controller

«Test Component» Motor

11/7/2014 CVL – Common Variability Language 75

Page 74: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Defining the Product Line with CVL Tool and Papyrus

CVL Abstraction Layer

CVL Realization Layer

Coloring the effects of the substitution

11/7/2014 CVL – Common Variability Language 76

Page 75: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Variants of behavior: changes to a state machine

Substitution

Replacement

Placement

11/7/2014 CVL – Common Variability Language 79

Page 76: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Product Selection and Resolution (Hoisting Machine)

11/7/2014 CVL – Common Variability Language 80

Page 77: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Execute CVL to obtain set of product models

Execute CVL – on design time model – on configuration file model

11/7/2014 CVL – Common Variability Language 81

Page 78: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

UTP Test Cases integrated with model

Test component port

Test component part

SUT

Test component port

Test component part

SUT

11/7/2014 CVL – Common Variability Language 82

Page 79: The Variability Modeling Experiment by Øystein …...INF 5150 5 UML and DSL continued UML problem – there are many ways to goal all of them to be implemented – typically something

INF 5150

Executable Testing Code

The Product model with tests

CVL Resolution

Testing a product line

83

The Product Line: CVL Abstraction Layer

CVL Realization Layer

The Product model with tests

Product Simulation

Code

Base DSL Model incl. tests

UML Fragments DSL Fragments

DSL metamodel (+ profiles)

CVL metamodel

CVL Resolution

generate

select

Product Simulation Execution

Deployment compile and run

Derivation

Variability and domain design

Executable JUnit Testing Code

execute tests

generate

Combinatorial Coverage arrays

11/7/2014 CVL – Common Variability Language


Recommended