Requirement Modelling: Use-Case Diagrams
Requirement Modelling: Use-Case Diagrams
□ Use-case diagrams
Users view
Use-case diagrams
OOAD
73
Software Development Activities
Requirements
Analysis Design
Gathering
Design the solution /
Define requirement Define the conceptual model
software plan
specification
Maintenance
Post-install review
Support docs
Active support
OOAD
74
Requirement
OOAD
75
Use-case diagram
UserManagement
add user
delete user
<<use>> find user
admin
modify user
OOAD
76
User-centred design
OOAD
77
Interest of user-centred design
OOAD
78
Determining users’ characteristics
□ Good questions
■ What are their goals?
■ How will they use the software?
■ What is their level of computer literacy?
■ What are their psychological characteristics?
■ What are their habits?
OOAD
79
Use-case diagrams
□ Graphical representation
« actor »
OOAD
80
System
□ The system can be any system, not only the software system
□ It defines the boundary of the system in a clear and precise manner
■ Not too ambitious
■ Only determine basic functionalities
■ Build a well defined architecture
■ Additional functionality can be added during development
OOAD
81
Use-case
OOAD
82
Use-case
□ A use-case needs to
■ always correspond to a high level objective
■ describe the interaction between the user and the system, not the
operations that the system should perform
■ cover all the steps to follow in performing a given task
■ be written, to the possible extent, independently of the user interface
■ include only the interactions with the system
OOAD
83
Use-case
OOAD
84
Use-case
OOAD
85
Use-case
□ Example (continue)
■ The answer is no
■ Since some interactions such as “confirm the amount” do not meet a
goal of the user
■ The goal of the user in this case is to withdraw money: this is a use-
case
OOAD
86
Actors
OOAD
87
Actors
identification
purchase
Cashier
refund
Customer
OOAD
89
Relations between the actors
Client
Individual Entreprise
OOAD
90
Use-case specification
□ Example
■ Use-case: purchase of products
■ Actors: Client, Cashier
■ Objective: describe a purchase of products by the customer with cash
payment
■ Description: The clients comes in the box with the selected products.
The cashier encodes products, announces the total. The customer
pays. The cashier registers the payments.
OOAD
91
Use-case specification
□ Example
■ Use-case: purchase of products
■ Actors: Client, Cashier
■ Objective: describe a purchase of products by the customer with cash
payment
■ References: R1.2, R3.4
■ Pre-conditions: the cashier is identified and authorised
■ Post-conditions: the purchased is registered, the payment is made,
the receipt is printed
■ Description: The clients comes in the box with the selected products.
The cashier encodes products, announces the total. The customer
pays. The cashier registers the payments.
OOAD
92
Use-case specification
OOAD
93
Use-case specification
• The
cashier
encodes
the
identifier
of
each
• The
cash
desk
displays
the
description
and
product
price
of
the
product
If
a
product
has
more
than
one
item,
the
This
number
is
displayed
cashier
inputs
the
number
of
items
• After
having
encoded
all
of
the
products,
the
• The
cash
desk
calculates
and
displays
the
cashier
signals
the
end
of
the
purchase total
amount
that
the
customer
has
to
pay
• The
cashier
announces
the
total
amount
to
the
customer
• The
customer
pays
• The
cashier
input
the
amount
of
money
paid
• The
cash
desk
displays
the
balance
by
the
customer
OOAD
94
Use-case specification
• The
cashier
gives
change
to
the
customer
• The
cash
desk
saves
the
purchase
and
the
receipt
• The
customer
leaves
the
cash
desk
with
the
bought
products
OOAD
95
Use-case specification
□ Remarks
■ The use-case’s specification format is only a proposal. Therefore, it is
not strict
■ The interactions are described in more detail for important use-cases
■ Use-case’s interaction can also be described using activity diagram,
state diagram or interaction diagram
OOAD
96
Use-cases identification techniques
□ Interview
OOAD
97
Use-cases identification techniques
■ Remarks
□ Don’t try to search for all the use-cases
■ Other use-cases can appear in the development process
OOAD
98
Relationships between use-cases
□ “extension” relationship
■ Used to specify the optional interactions
□ These are exceptional cases
■ The case where a use-case is similar to another but it includes
additional actions
■ The extending use-case must list all the actions in the main use-case
and also the supplementary actions
OOAD
99
Relationships between use-cases
□ “extension” relationship
■ Example: “purchase product with payment by credit card” use-case
□ Use-case: purchase products
□ Actors: Customer, Cashier
□ Objective: describe a purchase of
products by the customer with
payment by credit card
□ Description: The customer comes
to checkout with selected products.
The cashier encodes products, announces the total amount. The
customer gives his credit card. The cashier inserts the credit card
into the system. The customer types the PIN code. The system
verifies the card and then deducts the total of the card.
OOAD
100
Relationships between use-cases
□ “extension” relationship
■ “Purchase products with credit card payment” use-case is an extension
of the “Purchase products” use-case
■ Notation
extension
OOAD
101
Relationships between use-cases
□ “inclusion” relationship
■ describes a series of joint actions in several cases of different usages
■ if several use-cases share the same sequence of actions and this
common part is intended to meet a clearly defined goal then the part
is described in a separate use-case
■ helps to avoid repeating the same details in different use-cases
OOAD
102
Relationships between use-cases
• After
having
encoded
all
of
the
products,
the
• The
cash
desk
calculates
and
displays
the
cashier
signals
the
end
of
the
purchase total
amount
that
the
customer
has
to
pay
• The
cashier
announces
the
total
amount
to
the
customer
OOAD
103
Relationships between use-cases
□ “inclusion” relationship
■ Example (continue)
□ “encode products” use-case
■ Use-case: encode products
■ Actor: Customer, Cashier
■ Objective: describe the encoding of the products bought by a
customer
■ Description: The customer comes to checkout with the selected
products. The cashier encodes products, announces the total
amount to the customer.
□ Notation
Encode products
<< includes >>
OOAD
104
Building use-case diagrams
identification
purchase
Cashier
refund
Customer
OOAD
105
Classification of use-cases
A B D
Use-case
OOAD
106