31) Feature Models and MDA for Product Lines 1. Feature Models 2. - - PowerPoint PPT Presentation

31 feature models and mda for product lines
SMART_READER_LITE
LIVE PREVIEW

31) Feature Models and MDA for Product Lines 1. Feature Models 2. - - PowerPoint PPT Presentation

Fakultt Informatik, Institut fr Software- und Multimediatechnik, Lehrstuhl fr Softwaretechnologie 31) Feature Models and MDA for Product Lines 1. Feature Models 2. Product Linie Configuration with Feature Models 3. Multi-Stage Configuration


slide-1
SLIDE 1

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl für Softwaretechnologie

31) Feature Models and MDA for Product Lines

Ø

  • Prof. Dr. U. Aßmann

Ø

Florian Heidenreich

Ø

Technische Universität Dresden

Ø

Institut für Software- und Multimediatechnik

Ø

Gruppe Softwaretechnologie

Ø

http://st.inf.tu-dresden.de

Ø

Version 12-0.2, January 23, 2013

  • 1. Feature Models
  • 2. Product Linie Configuration with Feature

Models

  • 3. Multi-Stage Configuration
slide-2
SLIDE 2

Obligatory Literature

Ø Florian Heidenreich, Jan Kopcsek, and Christian Wende. FeatureMapper: Mapping Features to Models. In Companion Proceedings of the 30th International Conference on Software Engineering (ICSE'08), Leipzig, Germany, May 2008.

  • http://fheidenreich.de/work/files/ICSE08-FeatureMapper--Mapping-Features-to-

Models.pdf

  • Prof. U. Aßmann

Feature-driven SPLE 2

slide-3
SLIDE 3

References

Ø [Aßm03] U. Aßmann. Invasive Software Composition. Springer, 2003. Ø [Cza05] K. Czarnecki and M. Antkiewicz. Mapping Features to Models: A Template Approach Based on Superimposed Variants. In R. Glück and M. Lowry, editors, Proceedings of the 4th International Conference on Generative Programming and Component Engineering (GPCE'05), volume 3676 of LNCS, pages 422-437. Springer, 2005. Ø [Cza06] K. Czarnecki and K. Pietroszek. Verifying Feature-Based Model Templates Against Well-Formedness OCL Constraints. In Proceedings of the 5th International Conference on Generative Programming and Component Engineering (GPCE'06), pages 211-220, New York, NY, USA, 2006. ACM. Ø [Hei08a] F. Heidenreich, J. Kopcsek, and C. Wende. FeatureMapper: Mapping Features to Models. In Companion Proceedings of the 30th International Conference on Software Engineering (ICSE'08), pages 943-944, New York, NY, USA, May 2008. ACM. Ø [Hei08b] Florian Heidenreich, Ilie Şavga and Christian Wende. On Controlled Visualisations in Software Product Line Engineering. In Proc. of the 2nd Int‘l Workshop on Visualisation in Software Product Line Engineering (ViSPLE 2008), collocated with the 12th Int‘l Software Product Line Conference (SPLC 2008), Limerick, Ireland, September 2008. Ø [Hei09] Florian Heidenreich. Towards Systematic Ensuring Well-Formedness of Software Product Lines. In Proceedings of the 1st Workshop on Feature- Oriented Software Development (FOSD 2009) collocated with MODELS/GPCE/ SLE 2009. Denver, Colorado, USA, October 2009. ACM Press

  • Prof. U. Aßmann

Feature-driven SPLE Slide 3

slide-4
SLIDE 4

analysis model domain model use cases textual requirements (stories) architectural design detailed design analysis model context model requirements specification

Object-Oriented Analysis vs Object-Oriented Design

  • Prof. U. Aßmann

Feature-driven SPLE 4

slide-5
SLIDE 5

Extended to Model-Driven Architecture (MDA)

Ø Horizontal product line: one product idea in several markets

  • Prof. U. Aßmann

Feature-driven SPLE 5

analysis model use cases

textual requirements (stories)

Platform independent model Platform-1 specific model requirements specification Platform-(1,.., n) specific model domain model context model analysis model (CIM)

slide-6
SLIDE 6

use cases

textual requirements (stories)

Product 1 Product 2 requirements specification Product n domain model context model

Product Lines (Product Families)

analysis Model

  • Prof. U. Aßmann

Feature-driven SPLE 6

Feature Model (varability model)

slide-7
SLIDE 7

Model weaving Platform-1 specific model (PIM) Platform-1-specific extension (PSE) Platform independent model (PIM) Model weaving Platform-(1+2) specific model (PSM) Platform-2 specific extension (PSE)

Adding Extensions to Abstract Models in the MDA

Ø In the following, we extend the MDA (below) with configuration

  • Prof. U. Aßmann

Feature-driven SPLE 7

slide-8
SLIDE 8

Variants Variants Variants Analysis Model Product Line Model (Framework, VIM) Product PSM Product PIM

Domain Model

Variants Configuration With FeatureModel

Configuration of Variabilities in Vertical Product Lines (MDA for Vertical Product Lines)

Vertical product line: several products in one or several markets

The VIM (variant independent model) is the common model of the product family

  • Prof. U. Aßmann

Feature-driven SPLE 8

Product Design Variants Configuration With FeatureModel PSM Extensions

Model weaving Model weaving

Product PSM Product PSM

slide-9
SLIDE 9

31.1 PRODUCT LINES WITH FEATURE TREES AND FEATURE MODELS

  • Prof. U. Aßmann

Feature-driven SPLE 9

slide-10
SLIDE 10

Feature Models for Product configuration

Ø Feature models are used to express

variability in Product Lines

Ø alternative, Ø mandatory, Ø optional features, and Ø their relations

Ø A variant model represents a concrete product (variant)

from the product line Ø The variant model results from a selection of a subgraph of the feature

model

Ø The variant model can be used to parameterize and drive the product

instantiation process

  • Prof. U. Aßmann

Feature-driven SPLE 10 OR OR XO XOR

slide-11
SLIDE 11

Feature Models

Ø The Feature Tree Notation is derived from And-Or-Trees

Group of AND Features

Group of Alternative (XOR) Features FeatureA FeatureB Mandatory Feature Group of OR Features Optional Feature FeatureC FeatureD

PhD Thesis, Czarnecki (1998) based on FODA-Notation by Kang et al. (1990)

  • Prof. U. Aßmann

Feature-driven SPLE 11

slide-12
SLIDE 12

Example

Ø A1 or A2 or A3 Ø B1; B2 xor B3 Ø B4; optional B5 Ø B1; B7

A1 A2 A3 B1 B2 B4 B5 B6 B7 B3

  • Prof. U. Aßmann

Feature-driven SPLE 12

slide-13
SLIDE 13

Ein Featuremodell for Computer-Aided cognitive Rehabilitation

Ø [K. Lehmann-Siegemund, Diplomarbeit]

FM A/K K J E S CE CU NO NM K J E S CE CU NO NM gE gZ IS IT gE gZ gE gZ IS IT gE gZ IS IT gE IS IT T A [c1] T A [c1] gE gZ IS IT T A [c1] IS IT T A [c1] T A T A T A T A

. . .

IS IT

. . .

IS IT IS IT [1-2] [1-2] [1-2] [1-2] [1-2] [1-2] [1-2] [1-2]

  • Prof. U. Aßmann

Feature-driven SPLE 13

slide-14
SLIDE 14

Mapping Features to Model Fragments (Model Snippets)

Ø Bridging the gap between configuration and solution space Ø Need for mapping of features from feature models to artefacts of

the solution space

Ø Possible artefacts

Ø Models defined in DSLs Ø Model fragments (snippets) Ø Architectural artefacts (components, connectors, aspects) Ø Source code Ø Files

Ø But how can we achieve the mapping... ?

  • Prof. U. Aßmann

Feature-driven SPLE 14

slide-15
SLIDE 15

Ex: Plugins have Features (in Eclipse)

  • Prof. U. Aßmann

Feature-driven SPLE 15

slide-16
SLIDE 16

31.2 PRODUCT-LINE CONFIGURATION WITH FEATURE MODELS

  • Prof. U. Aßmann

Feature-driven SPLE 16

slide-17
SLIDE 17

Different Approaches of Variant Selection Additive approach

Ø Map all features to model fragments (model snippets) Ø Compose them with a core model based on the presence of the

feature in the variant model Ø Pros: Ø conflicting variants can be modelled correctly Ø strong per-feature decomposition Ø Cons: Ø traceability problems Ø increased overhead in linking the different fragments

  • Prof. U. Aßmann

Feature-driven SPLE 17

slide-18
SLIDE 18

Different Approaches of Variant Selection (2) Subtractive approach

Ø Model all features in one model Ø Remove elements based on absence of the feature in the variant

model

Ø Pros: Ø no need for redundant links between artifacts Ø short cognitive distance Ø Cons: Ø conflicting variants can't be modelled correctly Ø huge and inconcise models

  • Prof. U. Aßmann

Feature-driven SPLE 18

slide-19
SLIDE 19

The Mapping Problem between Features and Solution Elements

  • Prof. U. Aßmann

Slide 19 Feature-driven SPLE

FeatureA FeatureC FeatureB FeatureE FeatureD Problem ¡Space Solu5on ¡Space D E A B F G

Creation Visualisation Validation Derivation

slide-20
SLIDE 20

Mapping Features to Models

Ø FeatureMapper - a tool for mapping of feature models to modelling

artefacts developed at the ST Group

Ø Screencast and paper available at http://featuremapper.org Ø Advantages:

Ø Explicit representation of mappings Ø Configuration of large product lines from selection of variants in feature trees Ø Customers understand Ø Consistency of each product in the line is simple to check Ø Model and code snippets can be traced to requirements

  • Prof. U. Aßmann

Feature-driven SPLE 20

slide-21
SLIDE 21

FeatureMapper

  • Prof. U. Aßmann

Slide 21 Feature-driven SPLE

slide-22
SLIDE 22

Mapping Features to Models

Ø We chose an explicit Mapping Representation in our tool FeatureMapper Ø Mappings are stored in a mapping model that is based on a mapping metamodel

  • Prof. U. Aßmann

Feature-driven SPLE Slide 22

FeatureA FeatureC FeatureB FeatureE FeatureD D FeatureC E FeatureC G FeatureE F FeatureC FeatureE Solu5on ¡Models Feature ¡Model Mapping ¡Model D E A B F G

slide-23
SLIDE 23

From Feature Mappings to Model Transformations

  • Prof. U. Aßmann

Feature-driven SPLE 23

slide-24
SLIDE 24

Visualisation of Mappings (1)

Ø Visualisations play a crucial role in Software Engineering

  • It’s hard to impossible to understand a complex system unless you look at it from

different points of view

Ø In many cases, developers are interested only in a particular aspect of the connection between a feature model and realising artefacts

  • How a particular feature is realised?
  • Which features communicate or interact in their realisation?
  • Which artefacts may be effectively used in a variant?

Ø Solution of the FeatureMapper: MappingViews, a visualisation technique that provides four basic visualisations

  • Realisation View
  • Variant View
  • Context View
  • Property-Changes View
  • Prof. U. Aßmann

Feature-driven SPLE Slide 24

slide-25
SLIDE 25

Realisation View

Ø For one Variant Model, the realisation in the solution space is shown

System

Rela5onship

FeatureB

Rela5onship Rela5onship

Feature ¡Model Mapping

  • Prof. U. Aßmann

Slide 25 Feature-driven SPLE

slide-26
SLIDE 26

Variant View

Ø The variant view shows different variant realisations (variant models) in parallel

System

Rela5onship Address Rela5onship Rela5onship

Feature ¡Model Mapping

Address Address

  • Prof. U. Aßmann

Slide 26 Feature-driven SPLE

slide-27
SLIDE 27

Context View

Ø The Context View draws the variants with different colors

  • Aspect-separation: each variant forms an aspect

System

Rela5onship Address ¡ Rela5onship Rela5onship

Feature ¡Model Mapping

Address Address Group Group Group

... ¡ ... ¡ ... ¡

  • Prof. U. Aßmann

Slide 27 Feature-driven SPLE

slide-28
SLIDE 28

Other ¡ Feature

Property-Changes View

System

Arbitrary ¡ Depth Arbitrary ¡ Depth

Feature ¡Model Mapping Recorded ¡change-­‑set ¡of ¡ changing ¡the ¡cardinality ¡of ¡the ¡ reflexive ¡associa5on ¡of ¡Group ¡to ¡ itself ¡from ¡1 ¡to ¡many

  • Prof. U. Aßmann

Slide 28 Feature-driven SPLE

slide-29
SLIDE 29

Textual Languages Support (1)

Ø Unified handling of modelling languages and textual languages by lifting textual languages to the modelling level with the help of EMFText Ø All >80 languages from the EMFText Syntax Zoo are supported, including Java 5 Ø http://emftext.org

  • Prof. U. Aßmann

Feature-driven SPLE Slide 29

slide-30
SLIDE 30

Textual Languages Support (2)

Ø Aspect-related color markup of the code

  • Prof. U. Aßmann

Feature-driven SPLE Slide 30

slide-31
SLIDE 31

Mapping-based Derivation of Transformations

Ø Transformations in the solution space build the product

  • Prof. U. Aßmann

Feature-driven SPLE Slide 31

FeatureA FeatureC FeatureB FeatureE FeatureD D FeatureC E FeatureC G FeatureE F FeatureC FeatureE Solu5on ¡Models Feature ¡Model Mapping ¡Model D E A B F G

Derivation Of Transformations <<in>> ¡ <<out>> ¡

FeatureA FeatureC FeatureB FeatureD Variant ¡Model D E A B

<<in>> ¡ <<in>> ¡

Variant

slide-32
SLIDE 32

31.3 MULTI-STAGE CONFIGURATION

  • Prof. U. Aßmann

Feature-driven SPLE 32

slide-33
SLIDE 33

FEASIPLE: A Multi-Stage Process Architecture for PLE

Ø Chose one variant on each level Ø Feature Tree as input for the configuration of the model weavings

  • Prof. U. Aßmann

Feature-driven SPLE 33

slide-34
SLIDE 34

FEASIPLE: A Multi-Stage Process Architecture for PLE

Ø Goal: a staged MDSD-framework for PLE where each stage

produces the software artefacts used for the next stage

  • Prof. U. Aßmann

Feature-driven SPLE 34

slide-35
SLIDE 35

Advantages of FEASIPLE

Ø Characteristic feature 1: Ø Variability on each stage

  • Prof. U. Aßmann

Feature-driven SPLE 35

slide-36
SLIDE 36

Advantages of FEASIPLE

Ø Characteristic feature 2: Ø Different modelling languages, component systems and

composition languages per stage

  • Prof. U. Aßmann

Feature-driven SPLE 36

slide-37
SLIDE 37

Advantages of FEASIPLE

Ø Characteristic feature 3: Ø Different composition mechanisms per stage

  • Prof. U. Aßmann

Feature-driven SPLE 37

slide-38
SLIDE 38

Advantages of FEASIPLE

Ø Characteristic feature 4: Ø Composition mechanisms are driven by variant selection

  • Prof. U. Aßmann

Feature-driven SPLE 38

slide-39
SLIDE 39

Multi-Staged Derivation of Transformations

Ø How do we compose transformations? Between different stages?

  • Prof. U. Aßmann

Feature-driven SPLE Folie 39

Variant ¡Independent ¡Model ¡ func)onal ¡ Feature ¡Model ¡ pla-orm ¡ Feature ¡Model ¡ context ¡ Feature ¡Model ¡

M2C Generators

PlaLorm ¡Specific ¡Code ¡

M2M Trafos M2M Trafos

Platform Independent Models Platform Independent Models PlaLorm ¡Independent ¡Models ¡ Platform Specific Models Platform Specific Models PlaLorm ¡Specific ¡Models ¡

VIM Mapping PIM Mapping PSM Mapping

slide-40
SLIDE 40

TraCo: A Framework for Safe Multi-Stage Composition of Transformations

Ø TraCo encapsulates transformations into composable components

  • Arranges them with composition programs of parallel and sequential transformation

steps (multi-threaded transformation

  • Prof. U. Aßmann

Feature-driven SPLE Folie 40

T1 M1 V1 SA1 SA2 T2 M2 V2 SA3 SA1* T1* M1* V1* SA2* … Tn Mn Vn SAn SAn-1

V1 Feature Selection M1 Mapping SA1 Solution Artefact T1 Transformation

Functional variant Platform variant Context variant

slide-41
SLIDE 41

Steps in Multi-Staged Derivation of Transformations

1. Transformations are represented as composable components 2. Definition and Composition of Transformation Steps

  • A Composition System is needed (course CBSE): Allows for reuse of arbitrary existing transformation

techniques

3. Validation of each transformation and composition step

  • Type-checking
  • Invariant- and constraint-checking
  • Correctness of port and parameter binding
  • Static and dynamic analysis

4. Execution of composition program

  • Prof. U. Aßmann

Feature-driven SPLE Slide 41

Component Adapter Actual Transformation Code

references

Component instances Connectors Constant value

slide-42
SLIDE 42

Multi-Staged Derivation of Transformations

Ø Implemented in our tool TraCo

  • Component Model,
  • Composition Language,
  • Composition Technique
  • Prof. U. Aßmann

Feature-driven SPLE Slide 42

slide-43
SLIDE 43

Composition Programs can be Configured (Metacomposition)

„Anything you can do, I do meta“ (Charles Simonyi) Ø The composition program shown in the last slide can be subject to transformation and composition Ø If we build a product line with TraCo, platform variability can be realised by different transformation steps Ø A TraCo composition program can be used with FeatureMapper

  • Multi-Staged transformation steps
  • Even of composition programs

Ø More about metacomposition in CBSE course

  • Prof. U. Aßmann

Feature-driven SPLE Folie 43

slide-44
SLIDE 44

January 2011 Florian Heidenreich - Feature-driven SPLE Folie 44

Load Domain Model Load Actions Model Load ApplicationState Model Load User Interface Model Load Navigation Model VIM to VSM Domain Model to UML Attributes to Properties UML to Java Add EJB Semantics VIM to VSM Actions Model to SimpleImpl UML Actions Model to SimpleDelegateUML UML to Java UML to Java Actions to EJB UML Actions to EJB Delegate UML Add EJB Persistence Semantics Add Local Memory Semantics UML to Java UML to Java VIM to VSM ApplicationState Model to UML Attributes to Properties UML to Java VIM to VSM Ensure Control IDs SWT User Interface JSP User Interface VIM to VSM Navigation Model to Java Navigation Model to JSP Presentation SWT JSP Business Logic Java EJB Persistence Mixed In-Memory EJB Persistence EJB + In-Memory EJB + EJB Persistence Domain Actions Application State User Interface Navigation Loading Functional Variability Platform Variability

slide-45
SLIDE 45

The final frontier: Ensuring Well-formedness of SPLs

Ø Motivation: Make sure that well-formedness of all participating models is ensured

  • Feature Model
  • Mapping Model
  • Solution Models

Ø Well-formedness rules are described using OCL Ø Constraints are enforced during mapping time

  • Prof. U. Aßmann

Slide 45 Feature-driven SPLE

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.
slide-46
SLIDE 46

Case Studies with FeatureMapper, TraCo, and FEASIPLE

Ø Simple Contact Management Application Software Product Line

  • FeatureMapper used to map features to UML2 model elements
  • Both static and dynamic modelling

Ø Simple Time Sheet Application Software Product Line

  • FeatureMapper used to tailor ISC composition programs
  • ISC used as a universal variability mechanism in SPLE
  • Meta Transformation

Ø SalesScenario Software Product Line

  • FeatureMapper used to tailor models expressed in Ecore-based DSLs
  • was developed in project feasiPLe (http://www.feasiple.de)

Ø TAOSD AOM Crisis Management System

  • Prof. U. Aßmann

Feature-driven SPLE Slide 46

slide-47
SLIDE 47

Summary

Ø Configuration of product lines with mapping of feature models to solution spaces Ø Mapping of Features to models in Ecore-based languages using FeatureMapper Ø Visualisations of those mappings using MappingViews

  • Realisation View
  • Variant View
  • Context View
  • Property-Changes View

Ø Derivation of solution models based on variant selection and mapping Ø Multi-Staged derivation using TraCo Ø Ensuring well-formedness of SPLs

http://featuremapper.org

  • Prof. U. Aßmann

Slide 47 Feature-driven SPLE

slide-48
SLIDE 48

The End

  • Prof. U. Aßmann

Feature-driven SPLE 48