a use case based approach to feature models’ construction bo wang, wei zhang, haiyan zhao, zhi...

27
A Use Case Based Approach to Feature Models’ Construction Bo Wang , Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software Technology Ministry of Education of China Institute of Software, School of EECS Peking University

Upload: tabitha-janel-morris

Post on 14-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

A Use Case Based Approach toFeature Models’ Construction

Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei

Key Laboratory of High Confidence Software Technology Ministry of Education of China

Institute of Software, School of EECSPeking University

Page 2: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

2

Agenda

Background

Outline of our approach

Details of our approachTwo metamodelsA semi-automatic approach

Conclusion and Future Work

Page 3: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

3

BackgroundThe construction of feature models

requires analysts’ good knowledge and experience on the domain.

involves quantitative analysis of various documents.

Use Cases

Req Spe

User’s Book

Feature ModelAnalyze

AnalystsUse Cases

Page 4: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

4

Agenda

Problems and Motivation

Outline of our approach

Details of our approachTwo metamodelsA semi-automatic approach

Conclusion and Future Work

Page 5: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

5

Outline of Our Approach

AFMs

Adjusted-AFMs

Adjust AFMs

Merge Adjusted-AFMs

DFM

No conflicts

Has conflicts

Use Cases

LegendActivity

Artifact

Construct AFMs

Input

Outputs

AFM : Application Feature Model

DFM : Domain Feature Model

Step 1 Step 2

Step 3

Page 6: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

6

Outline of Our Approach : An Example

UC1

UC2

UCn

System 1 :

System 2 :

System n :

AFM1

AFM2

AFMn

System 1 :

System 2 :

System n :

DFM

AAFM2

AAFMn

Web Store Domain

System 2 :

System n :

AAFM1System 1 :

UC1—UCn : Describe how to place an order in a web store.DFM : Represents partial characteristics of the domain which is related to placing an order

Construct AFMs

MergeAFMs

Adjust AFMs

Web Store Domain

Web Store DomainWeb Store Domain

Page 7: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

7

Agenda

Problems and Motivation

Outline of our approach

Details of our approachTwo metamodelsA semi-automatic approach

Conclusion and Future Work

Page 8: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

8

The Metamodel of Use Cases

Use CaseNamePreconditionPostcondition

Flow

Condition

Action

Method Operation Object

Basic Flow

Alternative FlowUser Operation

System Operation

System Output

1

*

1

*

1

1 *

11

*

1

*1* Sub Flow

Page 9: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

9

The Metamodel of Use Cases

. . .. . .. . .

. . .. . .. . .

Name: Place an order

Postcondition: The order is submitted.

User Operation System Operation System Output

Basic Flow

(Update)operation the (quantity)object.(S1)(Calculate)operation the (total price)object.

(Update)operation the (total price)object. (Display)operation all the (products) object.

. . .. . .. . .

. . .. . .. . .

Name: Place an order

Postcondition: The order is submitted.

User Operation System Operation System Output

Basic Flow

(Update)operation the (quantity)object.(S1)(Calculate)operation the (total price)object.

(Update)operation the (total price)object. (Display)operation all the (products) object.

Page 10: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

10

The Metamodel of Feature Models

A Feature Model = Features + Relationships

Refinements + Constraints

Feature

nameoptionality

Refinement

Specialization

Characterization

Require

+parent +child

requirer+

requiree+

1 1

* 0..1

11*

*

Constraint* 2Exclude

Decomposition

Page 11: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

11

The Metamodel of Feature Models

Legend

Feature

Characterization

Specialization

DecompositionEdit order Submit order

Order status notification

Notification method

SMS Email Instant massager

Order products

Page 12: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

12

Step 1 : Construct AFMs

AFMs

Adjusted-AFMs

Adjust AFMs

Merge Adjusted-AFMs

DFM

No conflicts

Has conflicts

Use Cases

LegendActivity

Artifact

Construct AFMs

AFM : Application Feature Model

DFM : Domain Feature Model

Step 1Input

Output

Page 13: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

13

Step 1 : Construct AFMs

Identify features relationships between features

from a use case by applying a set of heuristic rules.

Heuristic rules:Two feature discovery rulesSix relationship discovery rules

Page 14: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

14

Feature Discovery Rules

The operation on each object in an action is regarded as a feature.

The method of an operation is regarded as a feature.

Open cartOpen cart(Open)operation the (cart)object.

By popping up a dialog box

By popping up a dialog box

(Display)operation the (shipping address error message)object (by popping up a dialog box)method.

Page 15: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

15

Relationship Discovery Rules

Discover decomposition relationships by identifying features whose names reference the same object.

Place an order

Edit the order Submit the order

Place an order

Edit the order Submit the order

Features containing object “order”:

1. Edit the order.

2. Submit the order.

Page 16: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

16

Relationship Discovery Rules

Discover decomposition relationships by identifying the “Is-a” relationship between objects.

Manage bank card

Manage visa Mange debit card

Manage bank card

Manage visa Mange debit card

Features:

1. Manage visa.

2. Mange debit card.

Page 17: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

17

Construct AFMs

Place an order

Open cart

Display products

Update quantity

Select product Enter quantity Calculate total price Update total price

??+gift certificate

Enter claim code Enter security code

Enter gift certificate Redeem gift certificate

Check validity of the gift certificate Update total PriceEnter claim code Enter security code

Enter gift certificateEnter gift certificate Redeem gift certificate

Check validity of the gift certificate Update total Price

Enter promo code Apply promo code

??+ promo code

Check validity of the promo code Update total price

Enter shipping addressEnter shipping address

Enter first name Enter MI Enter last name Enter city Enter address Check validity of shipping addressEnter zip code Enter state Enter phone

Display payment method selection window

??+payment method

Choose mail payment Choose credit card Choose PayPal

Display payment method

Display shipping method selection window

??+payment method

Submit order Display submit success message Display login window

Display shipping address error message

??

??+order

??+product

??+product Choose shipping method

Choose FedEx

Calculate shipping charge Update total price

Display shipping method

?? + shipping method Display promo code error message

Check login status

Display gift certificate error message

By popping up a dialogue box

Legend

Feature

Characterization

Specialization

Decomposition

?? Choose UPS ??

Page 18: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

18

Step 2 : Adjust AFMs

AFMs

Adjusted-AFMs

Adjust AFMs

Merge Adjusted-AFMs

DFM

No conflicts

Has conflicts

Use Cases

LegendActivity

Artifact

Construct AFMs

AFM : Application Feature Model

DFM : Domain Feature Model

Step 2Input

Output

Page 19: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

19

Step 2 : Adjust AFMs

Adjust the AFMs to eliminate improper features and relationships with the help a set of heuristic rules.

Three primitive adjusting operations:AcceptRejectCreate

Heuristic rules:Six adjusting suggestion rulesFour conflicts checking rules

Page 20: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

20

Help analyst adjust AFMs by applying six adjusting suggestion rules.

Adjust AFMs

AFM1

AFM2

AFMm

A

A

A

AFMn

A

Adjusted-AFMs

B

C

B

C

B

C

B

C

√C

√C

√C

√C

Page 21: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

21

Adjust AFMsCheck the conflicts among AFMs by applying four

conflicts checking rules.

AFM1

AFM2

AFMm

A

A

A

AFMn

A

Adjusted-AFMs

×

Page 22: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

22

Update quantityEnter shipping addressEnter shipping address Pay

Choose mail payment Choose credit card

Submit order

Display shipping address error message

Display method

Edit order

Ship the commodity

Choose FedEx

By popping up a dialogue box

Payment MethodShipping method Choose UPS

Choose gift certificate Choose promo codeChoose PayPal

Place an order

Adjust AFMs

Legend

Feature

Characterization

Specialization

Decomposition

The adjusted AFM is show as follows:

Page 23: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

23

Step 3 : Merge Adjusted-AFMs

AFMs

Adjusted-AFMs

Adjust AFMs

Merge Adjusted-AFMs

DFM

No conflicts

Has conflicts

Use Cases

LegendActivity

Artifact

Construct AFMs

AFM : Application Feature Model

DFM : Domain Feature Model

Step 3

Input

Output

Page 24: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

24

Merge Adjusted-AFMs

The commonality and variability between the applications are found in the process of merging.

The merging algorithm is based on our previous work Chen [RE 05].

Page 25: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

25

Merge Adjusted-AFMs

Place an order

Update quantityEnter shipping addressEnter shipping address Pay

Choose mail payment Choose credit card

Submit order

Display shipping address error message

Display method

Edit order

Ship the commodity

Choose FedEx

By popping up a dialogue box

Shipping methodChoose UPS

Choose gift certificate Choose promo codeChoose PayPal

Choose DHL

Payment Method

Legend

Feature

Characterization

Specialization

Decomposition

The DFM is shown as follows:

Page 26: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

26

Conclusion & Future Work

Contributions:Two rules to identify features from use casesSix rules to identify relationships from use casesTen rules to help adjust AFMsA semi-automatic process

Future work:Find more rules to identify features and relationshipsApply the approach to more domains

Page 27: A Use Case Based Approach to Feature Models’ Construction Bo Wang, Wei Zhang, Haiyan Zhao, Zhi Jin, Hong Mei Key Laboratory of High Confidence Software

27

Thank you!