Variability Modelling in the ABS Language Dave Clarke Katholieke - - PowerPoint PPT Presentation

variability modelling in the abs language
SMART_READER_LITE
LIVE PREVIEW

Variability Modelling in the ABS Language Dave Clarke Katholieke - - PowerPoint PPT Presentation

Variability Modelling in the ABS Language Dave Clarke Katholieke Universiteit Leuven based on joint work with Jos Proena, Michiel Helvenstijen, Ina Schaefer, Radu Muschevici Tuesday 1 March 2011 Outline Introduction Feature


slide-1
SLIDE 1

Variability Modelling in the ABS Language

Dave Clarke Katholieke Universiteit Leuven based on joint work with José Proença, Michiel Helvenstijen, Ina Schaefer, Radu Muschevici

Tuesday 1 March 2011

slide-2
SLIDE 2

Outline

  • Introduction
  • Feature Modelling
  • Delta Modelling
  • Product Line Configuration
  • Feature Selection
  • Product Generation
  • Conclusion

Tuesday 1 March 2011

slide-3
SLIDE 3

Outline

  • Feature Modelling
  • Delta Modelling
  • Product Line Configuration
  • Feature Selection
  • Product Generation
  • Conclusion

Introduction

Tuesday 1 March 2011

slide-4
SLIDE 4

Product Line Development

Feature Model Family Engineering Product Line Artefacts Base Application Engineering Feature Selection Product

Tuesday 1 March 2011

slide-5
SLIDE 5

Running Example

Tuesday 1 March 2011

slide-6
SLIDE 6

Running Example: Multi-lingual Hello World

  • English: “Hello World”
  • German: “Hallo Welt”
  • Dutch: “Hallo Wereld”
  • Swedish: “Hejsan Allihopa”
  • French: “Bonjour tout le monde”
  • Possibly with repetition

Tuesday 1 March 2011

slide-7
SLIDE 7

Ingredients of Variability in ABS

  • Core ABS
  • Feature Model (µTVL) – describing variability
  • Deltas – implementing variability
  • Configuration Language
  • Feature Selection Language

Tuesday 1 March 2011

slide-8
SLIDE 8

The Core Functionality

Tuesday 1 March 2011

slide-9
SLIDE 9

The Core

interface Greeting { String say_hello(); } class Greeter implements Greeting { String say_hello() { return "Hello world"; } }

English by default A fully functioning application (minus main)

Tuesday 1 March 2011

slide-10
SLIDE 10

Outline

  • Introduction
  • Delta Modelling
  • Product Line Configuration
  • Feature Selection
  • Product Generation
  • Conclusion

Feature Modelling

Tuesday 1 March 2011

slide-11
SLIDE 11

Product Line Development

Feature Model Family Engineering Product Line Artefacts Base Application Engineering Feature Selection Product

Tuesday 1 March 2011

slide-12
SLIDE 12

Feature Models

I18n Repeat

times:[1,1000]

German French English Swedish

Repeat → (times ≥ 2 && times ≤ 5)

Or Cardinalities Excludes Requires Optional Alternative Constraints Attributes And

Tuesday 1 March 2011

slide-13
SLIDE 13

Feature Model in µTVLs

root I18n { group allof { Language { group oneof { English, Dutch, French, German, Swedish } },

  • pt Repeat {

int [0,1000] times; } } } extension English { ifin: Repeat -> (Repeat.times >= 2 && Repeat.times <= 5); }

Tuesday 1 March 2011

slide-14
SLIDE 14

µTVL Feature Modelling Language

  • µTVL adapts existing TVL language

[Claessen, FUNDP , Namur U]

  • Constraint solver written in Choco:
  • finds valid feature selections matching

specified constraints

  • checks validity of feature selections

Tuesday 1 March 2011

slide-15
SLIDE 15

Outline

  • Introduction
  • Feature Modelling
  • Product Line Configuration
  • Feature Selection
  • Product Generation
  • Conclusion

Delta Modelling

Tuesday 1 March 2011

slide-16
SLIDE 16

Delta-oriented Programming

Feature Model Family Engineering Product Line Artefacts Base Application Engineering Feature Selection Product

Automated Product Derivation Core Products –

complete product for some feature configuration

Product Deltas – additions, removals, modifications to core product

Tuesday 1 March 2011

slide-17
SLIDE 17

Delta-oriented Programming

  • Modifications on Class Level:
  • Addition, Removal and Modification of Classes
  • Modifications of Class Structure:
  • Changing Super Class and Constructor
  • Adding/Removing Fields/Methods
  • Modifying Methods (wrapping original call)
  • [Delta-oriented Programming of Software Product Lines

Schaefer, Bettini, Bono, Damiani, Tanzarella. SPLC 2010.]

Tuesday 1 March 2011

slide-18
SLIDE 18

The Repeat Delta

delta Rpt (Int times) { modifies Greeter { modifies String say_hello() { String result = ""; Int i = 0; while (i < times) { result = result + original(); i = i + 1; } return result; } } }

Tuesday 1 March 2011

slide-19
SLIDE 19

The German Delta

delta De { modifies Greeter { modifies String say_hello() { return "Hallo Welt"; } } }

Tuesday 1 March 2011

slide-20
SLIDE 20

The Dutch Delta

delta Nl { modifies Greeter { modifies String say_hello() { return "Hallo wereld"; } } }

Tuesday 1 March 2011

slide-21
SLIDE 21

The French Delta

delta Fr { modifies Greeter { modifies String say_hello() { return "Bonjour tout le monde"; } } }

Tuesday 1 March 2011

slide-22
SLIDE 22

The Swedish Delta

delta Sv { modifies Greeter { modifies String say_hello() { return "Hejsan allihopa"; } } }

Tuesday 1 March 2011

slide-23
SLIDE 23

Outline

  • Introduction
  • Feature Modelling
  • Delta Modelling
  • Feature Selection
  • Product Generation
  • Conclusion

Product Line Configuration

Tuesday 1 March 2011

slide-24
SLIDE 24

Features-Delta Mapping

Deltas Core

Artefacts

Feature Model

Configuration

application conditions & delta ordering

Tuesday 1 March 2011

slide-25
SLIDE 25

Configuration

  • Links feature model with deltas
  • Adds application conditions to deltas:
  • constraints on features and attributes
  • Specifies ordering between deltas
  • Nests deltas to ensure atomic application

Tuesday 1 March 2011

slide-26
SLIDE 26

Configuration

product line HelloMultiLingual { features Repeat, German, French, Dutch, Swedish; core English; delta De when German && not Repeat; delta Fr when French; delta Nl when Dutch; delta Sv when Swedish && Repeat; delta Rpt(Repeat.times) after De, Fr, Nl, Sv when Repeat; }

parameter passing

  • rdering

application conditions

Tuesday 1 March 2011

slide-27
SLIDE 27

Outline

  • Introduction
  • Feature Modelling
  • Delta Modelling
  • Product Line Configuration
  • Product Generation
  • Conclusion

Feature Selection

Tuesday 1 March 2011

slide-28
SLIDE 28

Product Line Development

Feature Model Family Engineering Product Line Artefacts Base Application Engineering Feature Selection Product

Tuesday 1 March 2011

slide-29
SLIDE 29

Feature Selection

Deltas Core

Artefacts

Feature Model

Configuration Satisfies

Product

Uses Uses Generates

Feature Selection

Tuesday 1 March 2011

slide-30
SLIDE 30

Feature Selection

  • Specifies selected features and their attributes.
  • Final Ingredient required to Generate Product.
  • Checked against Feature Model.

Tuesday 1 March 2011

slide-31
SLIDE 31

Feature Selection

// basic product with no deltas product P1 { Greeting bob; bob = new Greeter(); String s = ""; s = bob.say_hello(); }

}

Initialisation (aka main)

Tuesday 1 March 2011

slide-32
SLIDE 32

Feature Selection

// apply delta Fr and Repeat product P3 (French, Repeat{times=10}) { Greeting bob; bob = new Greeter(); String s = ""; s = bob.say_hello(); }

Attribute Specification Feature Selection

Tuesday 1 March 2011

slide-33
SLIDE 33

Outline

  • Introduction
  • Feature Modelling
  • Delta Modelling
  • Product Line Configuration
  • Feature Selection
  • Conclusion

Product Generation

Tuesday 1 March 2011

slide-34
SLIDE 34

Product Line Development

Feature Model Family Engineering Product Line Artefacts Base Application Engineering Feature Configuration Product

Tuesday 1 March 2011

slide-35
SLIDE 35

Product Generation

  • For a Feature Configuration:
  • Select product deltas with valid application

condition

  • Determine linear ordering of product

deltas compatible with partial ordering

  • Apply changes specified by product deltas

to core product in the linear order

Tuesday 1 March 2011

slide-36
SLIDE 36

Given Feature Selection

// apply delta Fr and Repeat product P3 (French, Repeat{times=10}) { Greeting bob; bob = new Greeter(); String s = ""; s = bob.say_hello(); }

Tuesday 1 March 2011

slide-37
SLIDE 37

Apply Delta Fr

class Greeter implements Greeting { String say_hello() { return "Hello world"; } } delta Fr { modifies Greeter { modifies String say_hello() { return "Bonjour tout le monde"; } } }

+

Tuesday 1 March 2011

slide-38
SLIDE 38

Apply Delta Fr

class Greeter implements Greeting { String say_hello() { return "Bonjour tout le monde"; } }

Tuesday 1 March 2011

slide-39
SLIDE 39

Configure Repeat

delta Rpt (Int times) { modifies Greeter { modifies String say_hello() { String result = ""; Int i = 0; while (i < times) { result = result + original(); i = i + 1; } return result; } } } times=10

Tuesday 1 March 2011

slide-40
SLIDE 40

Configure Repeat

delta Rpt { modifies Greeter { modifies String say_hello() { String result = ""; Int i = 0; while (i < 10 ) { result = result + original(); i = i + 1; } return result; } } }

Tuesday 1 March 2011

slide-41
SLIDE 41

Apply Repeat

delta Rpt { modifies Greeter { modifies String say_hello() { String result = ""; Int i = 0; while (i < 10) { result = result + original(); i = i + 1; } return result; } } } class Greeter implements Greeting { String say_hello() { return "Bonjour tout le monde"; } }

+

Tuesday 1 March 2011

slide-42
SLIDE 42

Apply Repeat

class Greeter implements Greeting { String __say_hello_original() { return "Bonjour tout le monde"; } String say_hello() { String result = ""; Int i = 0; while (i < 10) { result = result + __say_hello_original(); i = i + 1; } return result; } }

Tuesday 1 March 2011

slide-43
SLIDE 43

Adding Initialisation

class Greeter implements Greeting { String __say_hello_original() { return "Bonjour tout le monde"; } String say_hello() { String result = ""; Int i = 0; while (i < 10) { result = result + __say_hello_original(); i = i + 1; } return result; } } { Greeting bob; bob = new Greeter(); String s = ""; s = bob.say_hello(); }

Tuesday 1 March 2011

slide-44
SLIDE 44

Typing Issues

  • Errors
  • Field, method, class missing
  • Incorrect type: field/method
  • Warnings
  • Field/method/class not expected one
  • Conflicting implementation orderings
  • Product line level checking instead of per

product (= after generation) checking

Tuesday 1 March 2011

slide-45
SLIDE 45

Outline

  • Introduction
  • Feature Modelling
  • Delta Modelling
  • Product Line Configuration
  • Feature Selection
  • Product Generation
  • Conclusion

Tuesday 1 March 2011

slide-46
SLIDE 46

HATS ABS

  • HATS ABS is a collection of 5 languages
  • Core Product
  • Product Deltas
  • Feature Modelling
  • Configuration: Links FM and Core+Deltas
  • Feature Selection
  • Implementation efforts are well underway

Tuesday 1 March 2011

slide-47
SLIDE 47

Questions?

Tuesday 1 March 2011