The Role of Feature Modeling in Software Product Line Engineering

The Role of Feature Modeling g in Software Product Line Engineering Hassan Gomaa Dept. of Computer Science George g Mason Universityy Fairfax, Virgin...
Author: Ashlyn Atkins
8 downloads 0 Views 728KB Size
The Role of Feature Modeling g in Software Product Line Engineering

Hassan Gomaa Dept. of Computer Science George g Mason Universityy Fairfax, Virginia, USA [email protected]

16th CREST Open Workshop Provenance and Product Lines November 2011 Copyright © 2011 Hassan Gomaa

Software Product Line Engineering • Software Product Line (SPL) – Family F il off products d t / systems t (Parnas, P W i Weiss, SEI) • Software Product Line Engineering – Software engineering for a family of products • Software Variability – Keyy p problem in software p product line engineering g g – Need to differentiate among common and variable software requirements and components • Feature Modeling – Widely used in SPLs for specifying commonality/variability in requirements Copyright 2011 H. Gomaa

2

Software Modeling and Design for SPL • Software Modeling and Design for Single Systems – COMET method – From Use Case Models to Software Architecture – H. Gomaa, Software Modeling and Design: UML, Use Cases, Patterns, and Software Architectures, Cambridge University Press, February 2011

• Software Modeling and Design for SPL (PLUS method) – Model commonality and variability among SPL members – Integrate Feature Modeling with UML • Unifying View of Multiple-View Modeling Approach – H. Gomaa, “Designing Software Product Lines with UML”, y, 2005 Addison Wesley, Copyright 2011 H. Gomaa

3

Evolutionary Process Model for Software Product Lines

Copyright 2011 H. Gomaa

4

Model-driven Development in Product Line Engineering

Copyright 2011 H. Gomaa

5

Software Product Line Requirements Modeling What should SPL Modeling Method provide?

• Support variability in use case modeling • Kernel, optional, alternative use cases • Integrate g feature modeling g with other UML views Requirements Modeling Analysis Modeling

Design Modeling Incremental Component Implementation

Software Testing

Copyright 2011 H. Gomaa

6

Feature Modeling for SPL • Feature (Kang, SEI) – Function or characteristic that differentiates between members of the software product line • Feature modeling in PLUS – PLUS integrates feature modeling with other UML views – Preciselyy represent p dependencies p in variability y – Determine features from use cases and variation points – Concentrate on modeling variability

Copyright 2011 H. Gomaa

7

Feature Modeling with UML • Use meta-modeling notation – Meta-classes depict features, feature groups, • Associations depict feature dependencies requires

Copyright 2011 H. Gomaa

8

Microwave Oven Feature Model «optional feature» MinutePlus

requires

«optional feature» Light

«exactly-oneof feature group» Display Unit

requires

{mutually exclusive feature}

«alternative feature» Multi-line Display mutually includes «optional feature» TOD Copyright 2011 H. Gomaa Clock

requires «common feature» Microwave Oven Kernel

requires

«default feature» One-line Display

«optional feature» Turntable

requires «optional feature» Beeper requires «exactly-oneof feature group» Heating Element

{mutually exclusive feature} «default feature» One-level Heating

«alternative feature» Multi-level Heating

9

Software Product Line Analysis Modeling What should SPL Design Method provide?

– Support variability and evolution - Static Modeling - Dynamic Interaction Modeling - Dynamic State Machine Modeling

Copyright 2011 H. Gomaa

10

Evolutionary Development for SPL • Kernel First Approach – Develop D l kkernell off SPL – Kernel is similar to single system • Evolutionary Development Approach – Consider evolution as an iteration in software development • Model-based evolution – Feature-based Impact Analysis – Consider impact of optional and alternative features on kernel • Emphasis on dynamic modeling • Interaction diagrams, state machines Copyright 2011 H. Gomaa

11

Kernel Communication Diagram for Cook Food use case «external input device» device : Keypad «product line system» : MicrowaveOvenSystem

6.1: Start

«state dependent control» : MicrowaveOvenControl

«external output device» Copyright: 2011 H. Gomaa One-levelHeatingElement

8.1: Decrement Cooking Time

«timer» timer : OvenTimer

8.2: 8 2: Finished

«entity» : OvenData

6.2: Start Cooking 8.4 : Stop Cooking

6.3: Start Cooking Output 8.5 : Stop Cooking Output

8: Timer Event

6: Start Key Input «input» : KeypadInterface

«output» : One-levelHeatingElement Interface

«external timer» : Clock Cl k

6.2a: Start Timer «output» : One-lineDisplay Interface

8 3a 3: End Prompt 8.3a.3: «external output 12 device» : One-lineDisplay

8.3: Timer Expired 8.3a: Display End prompt

Kernel statechart for Microwave Oven Control

• Incoming message to object-> input event on statechart • Output event on statechart -> > outgoing message from object Copyright 2011 H. Gomaa

13

Evolutionary Development for SPL • Feature Based Impact Analysis – Impact of optional/alternative features on interaction diagrams and statecharts • Feature dependent state transition – Use feature condition as guard on state transition • Event [Feature Condition] – Feature F t condition diti is i True T if ffeature t Selected S l t d • Example – Optional feature: Minute Plus – Consider impact on objects – Consider impact on statechart Copyright 2011 H. Gomaa

14

Impact Analysis of Minute Plus feature Impact on Communication diagram for Cook Food use case «external input device» : Keypad K d 4M[minuteplus]: Minute Plus Input

«product line system» : MicrowaveOvenSystem

«timer» timer : OvenTimer

«input» : KeypadInterface 4M.3a: Set Minute Cooking

4M.1 4M 1 [minuteplus]: Minute Pressed «state dependent control» : MicrowaveOvenControl

«entity» : OvenData

4M.2a: Start Cooking «output» : One-levelHeatingElement Interface

4M.2a.1: Start Cooking Output «external output device» Copyright 2011 H. Gomaa : OnelevelHeatingElement

4M.2: Start Minute

«output» : One-lineDisplay Interface 4M.3: Update Cooking Time Display

4M.4: Display Time «external output 15 device» : One-lineDisplay

Impact on Statechart for Microwave Oven Control

Feature dependent transition: Minute Pressed [minuteplus]

Copyright 2011 H. Gomaa

16

Feature Based Impact Analysis • Feature dependent action • Action A ti iis only l executed t d if F Feature t C diti iis T Condition True – Action [Feature Condition] • Switch On [light] [light], Switch Off [light] – Feature condition is • True if feature Selected • Example – Optional features: Light, Beeper – Consider impact on objects – Consider impact on statechart Copyright 2011 H. Gomaa

17

Feature-Based Impact Analysis • Impact Analysis of Beeper and Light optional features - 2 optional objects added - Impact on control object • Feature dependent messages

Copyright 2011 H. Gomaa

18

Feature Based State Machine Feature conditions: [light], [beeper] Feature dependent actions: Switch On [light], Switch Off [light], Beep [beeper]

Copyright 2011 H. Gomaa

19

Software Product Line Design Modeling What should SPL Design Method provide? • Software Architectural Patterns

• Evolutionary Component-Based Software Architectures

Copyright 2011 H. Gomaa

20

Develop Kernel Software Architecture (Example based on Centralized Control Pattern ) «input component» DoorComponent

– One control component • Executes E ec tes statechart – Receives sensor input from input components – Controls external environment via output components

«input component» WeightCompone nt

«input component» KeypadCompone nt

«control component» MicrowaveControl

K Key Copyright 2011 H. Gomaa

«output component» HeatingElement Component

«output t t component» MicrowaveDispl 21 ay

Design of Optional Components IBeeper

- Feature dependent interfaces & components PBeeper «interface» IBeeper {{feature = Beeper} p } initialize () beep ()

ILamp

PLamp «interface» ILamp {feature = Lamp} initialize () switchOn () switchOff () Copyright 2011 H. Gomaa

22

Feature-based Microwave Oven Architecture «product line system» MicrowaveOvenSystem

«kernel» «input component» DoorComponent

«default» «input component» BooleanWeightComponent

RMWControl

«kernel-param-vp» «input component» KeypadComponent

RMWControl

RMWControl

• Feature dependent components, connectors and messages • Role and reuse UML stereotypes

PMWControl

«kernel» «control component» MicrowaveControl

RHeater

PHeater

«default» «output t t component» t One-levelHeatingElementComponent

Copyright 2011 H. Gomaa

RLamp

PLamp

«optional» «output t t component» t LampComponent

RBeeper

RDisplay

PBeeper

«optional» «output t t component» t BeeperComponent

PDisplay

«variant» «output t t component» t Multi-lineMicrowaveDisplay

23

Application Engineering

Copyright 2011 H. Gomaa

24

Software Application Engineering • Software Application – Member of software product line • Software Application Engineering – Derive application pp architecture from SPL architecture • Select application features subject to – Feature dependencies and relationships • Derive software application architecture – Kernel components always selected – Optional O ti l and d variant i t components t correspond d tto features selected

Copyright 2011 H. Gomaa

25

Microwave Oven Application Feature Model «optional feature» MinutePlus

requires

requires

«common feature» Microwave Kernel

requires

«optional feature» Light

«exactly-one-of feature group» DisplayUnit

«alternative feat re feature» Multi-lineDisplay

«optional feature» Beeper requires

requires

requires

«default f t feature» One-lineDisplay

«exactly-one-of feature group» HeatingElement

«default feature» OnelevelHeating

mutually includes «optional feature» Copyright 2011TODClock H. Gomaa

«optional feature» Turntable

26

«alternative feature» Multi-levelHeating

Microwave Oven Application architecture «product line system» MicrowaveOvenSystem

«kernel» «input component» DoorComponent

«default» «input component» BooleanWeightComponent

RMWControl

«kernel-param-vp» «input component» KeypadComponent

RMWControl

RMWControl

PMWControl

«kernel» «control component» MicrowaveControl

RHeater

PHeater

«default» «output t t component» t One-levelHeatingElementComponent

Copyright 2011 H. Gomaa

RLamp

PLam p

RBeeper

RDisplay

PBeeper

«optional» «output t t component» t LampComponent

27

«optional» «output t t component» t BeeperComponent

PDisplay

«variant» «output t t component» t Multi-lineMicrowaveDisplay

Conclusions • Software Product Line Engineering – Software engineering for a family of products • Software Variability – Key problem in software product line engineering • Feature F t modeling d li – Unifying view in multiple view SPL – Feature relationships with other views explicitly depicted • Evolutionary development – Kernel first approach for new SPL – Reverse SPL engineering from existing systems – Use feature modeling to model evolution of requirements Copyright 2011 H. Gomaa

Related Research • Multiple-view modeling and meta-modeling for SPL (with L. O’Hara, M. Shin, M. Abu-Matar) • Software process modeling and SPL (with L. Kerschberg) • Tool support for SPL development and product derivation (with V V. Sugumaran, Sugumaran M. M Shin Shin, M M. Abu Abu-Matar) Matar) • Model-based SPL Testing (with E. Olimpiew) Aspect-oriented oriented modeling and SPL (with M M. Shin) • Aspect • Executable Architectural Patterns for RT SPLs (with J. S. Fant) • Feature Modeling & Variability Modeling in Serviceoriented SPL (with M. Abu-Matar)

Copyright 2011 H. Gomaa

29

Suggest Documents