a use case based approach to feature models’ construction bo wang, wei zhang, haiyan zhao, zhi...
TRANSCRIPT
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
2
Agenda
Background
Outline of our approach
Details of our approachTwo metamodelsA semi-automatic approach
Conclusion and Future Work
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
4
Agenda
Problems and Motivation
Outline of our approach
Details of our approachTwo metamodelsA semi-automatic approach
Conclusion and Future Work
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
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
7
Agenda
Problems and Motivation
Outline of our approach
Details of our approachTwo metamodelsA semi-automatic approach
Conclusion and Future Work
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
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.
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
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
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
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
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.
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.
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.
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 ??
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
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
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
21
Adjust AFMsCheck the conflicts among AFMs by applying four
conflicts checking rules.
AFM1
AFM2
AFMm
A
A
A
AFMn
A
Adjusted-AFMs
×
√
√
√
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:
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
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].
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:
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
27
Thank you!