42
From Stakeholder Goals to High Variability Designs Yijun Yu, John Mylopoulos, Alexei Lapouchnian, Sotirios Liaskos, Julio Cesar Sampaio do Prado Leite The technical report is at ftp://ftp.cs.toronto.edu/csri-technical-reports/509/variability.pdf @ The Early Requirements Seminar Mar 29, 2005

From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

From Stakeholder Goals to High Variability Designs

Yijun Yu, John Mylopoulos, Alexei Lapouchnian, Sotirios Liaskos, Julio Cesar Sampaio do Prado Leite

The technical report is at ftp://ftp.cs.toronto.edu/csri-technical-reports/509/variability.pdf

@ The Early Requirements SeminarMar 29, 2005

Page 2: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Agenda

• Problem domain: Variability in goal models• Solution domain: Variability in designs

– Feature model: configuration variability– Statecharts: behavioural variability

– Components-connector: structural variability

• Patterns, algorithms and implementations• Case study: meeting scheduler• Summary

Page 3: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

1. Background

• Why variability? Manage the complexity in software configurations and design customizable software that supports variabilities– High-level: stakeholder policies, various user

preferences, evolving capabilities– Low-level: configuration items, external changes

• Variability representations– Requirements: stakeholder goal models– Design:

• Feature models• Statecharts• Software architectures• And so on … (aspects, web services, … )

Page 4: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

1.1 Variability in goal models

• OR goals: various alternatives• Softgoals: variable satisficing labels• OR/XOR: various combinations• AND goals: various controls• Goal/agent delegation: various boundary

among system/non-system goals• And so on … the more design

considerations, the more variabilities

Page 5: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

OR++ + - --

XOROR ANDANDA AB BAND

A B

By system By environment (NOP)

……A

AA

A A

A

A A

A

OR

Page 6: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

A goal model example

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

Page 7: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

VP1VP2

VP3

Some variation points

Page 8: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

1.2 Variability in Feature Models

• Feature model is the primary representation for the product-line family

• There are four kinds of feature compositions:– Mandatory versus Optional– Alternative versus Inclusive OR

• A feature graph is basically a tree• Feature Tradeoffs:

– Constraints: select feature A => not select feature B– Dependencies: select feature A => select feature B

Page 9: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

An example of feature model -- captain feature 0.1

MANDATORY OPTIONAL

ALTERNATIVEINCLUSIVE-OR

Page 10: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Feature model example���������

����

�������

�������

�������

��������

������� ����������

�����������

� ���

������

���������

!���������"�����������������#

!���������"�����������������#

�����

������

��������

��������

��� ���

���

DEPENDENCIES

Page 11: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

1.3 Variability in Statecharts

• Statecharts captures system behaviour more concisely than state machines– States– Transitions: event [condition] / action– + Super/sub states: hierarchical

• Behavioural variability in statecharts– AND/XOR decomposition of a superstate– Parallel versus Sequential substates (with/out

swimlanes)– Multiple entry, multiple exit

Page 12: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Swim-lane: AND/XOR decomposition of a superstate

�$ �%�$

�%

Page 13: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Statecharts example�������������

����������&�������

'''

"(�)*%#�����

������

"(�$*$#+��,������

���������������

"(�%*$#+�������

"(�%#*%+����������

�������

"(�)*$#+��������� ���

Page 14: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

1.4 Variability in software architectures

• Software architectures use component/connectors to abstract the structural relations

• Architecture definition languages are proposed to represent architecture styles

• The bindings allows various connections between (interface) compatible components

• “Switch” in Koala/Darwin ADL

Page 15: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Software architecture exampleSWITCH

Page 16: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

2. From problem to solutions

• What’s common in the above-mentioned variability representations?– Hierarchical refinements

• Goal model: AND/OR decomposition of goals• Feature model: AND/OR/XOR/optional decomposition of features• Statechart: AND/XOR decompositions of states• Software architecture: Decomposition of compound components

– Abstract views• Goal model: requirements• Feature model: configurations• Statechart: behaviours• Software architecture: structures

• Can one generate variability design views from the most abstract goal models?

Page 17: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

How to generate feature model?

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

���������

����

�������

�������

�������

��������

������� ����������

�����������

� ���

������

���������

!���������"�����������������#

!���������"�����������������#

�����

������

��������

��������

��� ���

���

Page 18: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

How to generate statecharts?

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

Page 19: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

How to generate software architecture?

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

Page 20: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

2.1 Enrichments

Enrichment is neededLight-weight enrichment is desired• What are missing in goal models for

– Feature models? • Mandatory or Optional: System/Non-System boundary (in i*

notations, decide whether an actor is system actor or not)• Inclusive or Alternatives: OR/XOR

– Statecharts?• If one knows data dependencies among leaf goals, control is

either sequential (;) or parallel (||).– Software architecture?

• Data bindings for inputs and outputs (corresponds to goal topics, cf. types)

Page 21: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Configuration enrichment example

���������

����

�������

�������

�������

��������

��������� ������� �������� ����������

�����

��������������

��������

�� �� ����

��� ���

��� ���

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� ���

-.�-.� �

��� ���

���

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

NONSYSTEM GOALS

ALTER-NATIVE

Page 22: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Control enrichment example

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

���������

����

�������

������� �������

��������

���

������

���

������������ ����������

�����

��������������

��������

�� ������

��� ���

��� ���

�����������

�����

�����������

� ���

����

-.�-.�

���

���

���

��

SEQUENTIAL

Page 23: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Data enrichment example

���������

����

�������

�������

�������

��������

��������� �������

�������� ����������

�������

�����

����������

�����

������ �

�����

������������

��������

�������

��������

�����

�����������

�����

������

��������

��������

����

����

���

���

���

���

��� ���

���

���

� ���

��

�����������

�����

�����������

� ���

����

�������

���������

������

����������

� �

��

���������

�����

�������

���������

�������

���������

���

��

���������

���

�����

����������

���������

����������

���������

���

����������

/���������

�������

���

���������

������

���

����������+�

�������

��������

����

��������

���0������

��������

��

����

������������

������� ��

������

������

���������

���

�����������

������� ��

����

���������

�������� ��

��������������

�������

������� ��

����������������

���������

�������� ��

��������������

�������������� ��

��������������

��������������

��������������

��������������

��������������

����

������������������

������� ���������

0����

����� ��

1���

����

������������������

����������������������

����

��������

.������

&����������

�����2����

��������

�����2����

��

��

��

��������������

��������������

��������������

��������������

��������������

��������������

��

��

Page 24: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

2.2 Transformation patterns

Patterns are used to conduct the systematic transformations from enriched goal models

• Feature model generation patterns• Statecharts generation patterns• Component-connector generation patterns

Page 25: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

2.2.1 From goal to feature

�$

�% �)

�$

�%

�$

�% �)

�$

�% �)

������� ������� ��������� ��

$

% )

��� ���

$

% -.�

�� ��

$

% )

�� ��

$

% )

�� ��3

4�5 4�5 4�5 4 5

Page 26: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

2.2.2 From goal to state

1. Defining states 2. Transforming hierarchies

3. Treating dependencies 4. Simplifying leaf statecharts

Page 27: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

2.2.3 From goal to interfaces

Page 28: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

3. Algorithms and implementations

The process is semi-automatic: (1) Enrichment has to be done by designers(2) Transformations can be done automatically (3) The results are initial design, which allow designers to

make suitable changes based on design choicesDesign and implementations1. We designed the meta-model for enriched goals 2. We designed three algorithms using part of the

enriched goal model3. What’s New! We implemented the feature generation

algorithm in OpenOME

Page 29: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

The meta model generates Java programs in Eclipse Modeling Framework

• ftp://ftp.cs.toronto.edu/csri-technical-reports/509/goal.mdl

enriched goal model

generated design views

Page 30: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Algorithm 1. Feature model

Page 31: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Algorithm 2. Statecharts

Page 32: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Algorithm 3. Components-connectors

view

Page 33: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Enrichment in OpenOME (q7)

Page 34: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Generating Feature model into CaptainFeature

Page 35: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

4. Case study: Meeting Scheduler

Page 36: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

4.1 Enriched goal model

Page 37: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

4.2 Feature model generated

Page 38: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

4.3 Statecharts generated

Page 39: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

4.4 S/w architecture generated

Page 40: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

5. Summary and future work

• Comparing with formal definition of goals, the enriching annotations are light-weight, thus the variability decompositions are mostly inherited from the goal models

• The generated software design views provide a starting point of the high-variability design

• The traceability between requirements and designs can be maintained in the model-driven development

Future work• Support more variability views such as aspects and web

services• Generating commented code from goal models (Q7)• Use goal models as the core knowledge in autonomic

elements

Page 41: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The
Page 42: From Stakeholder Goals to High Variability Designs · 2005. 3. 29. · models • The generated software design views provide a starting point of the high-variability design • The

Major References• On Goal models in goal-oriented requirements engineering

– L. Chung, B.A. Nixon, E. Yu, J. Mylopoulos. Non-functional requirements in software engineering. Kluwer Academic Press. 1999.

– A. van Lamsweerde. “From systems goals to software architectures”. FSE. 2004.

• On Feature oriented (generative) programming and product-line family:– K. Czarnecki et al. Generative Programming: Methods, Tools, and

Applications. Addison-Wesley, 2000.– D. Batory et al. “Scaling Stepwise Refinements”. ICSE 2003.

• On Statecharts– D. Harel. “The STATEMATE Semantics of Statecharts”. TOSEM

5(4):293—333.• On Software architectures and ADL

– L. Bass et al. Software Architecture in Practice, 2nd Ed. Addison-Wesley, 1998.