Ch06 - Use Case Modeling
Ch06 - Use Case Modeling
2 / 21
Requirement Modelling
• The requirements of a system describe
– What the user expects from the system
– What the system will do for the user
• When defining the requirements of a system
– The system should be viewed as a black box. Only
the external characteristics of the system are
considered
– Both functional and nonfunctional requirements
need to be considered
• Requirements modeling consists of requirements
analysis and requirements specification
3 / 21
Requirement Modelling
Requirements Analysis
6 / 21
Use Cases
The use case model describes the functional requirements of the
system in terms of the actors & use cases
• The system is treated as a black box (dealing with what the
system does in response to the actor’s inputs)
• Functional requirements are described in terms of actors, which
are users of the system, and use cases
A use case (UC) defines a sequence of interactions between one
or more actors and the system
• A use case always starts with input from an actor
• Typically consists of a sequence of interactions between the
actor and the system
• Each interaction consists of an input from the actor followed by
a response from the system
An actor provides inputs to the system and the system
provides
7 / 21 responses to the actor
Use Cases
Simple banking example
9 / 21
Use Cases
What are actors?
10 / 21
Use Cases
Sample actors
• Users
– Homeowners are actors on HOLIS system
– Authors are actors on a word processing system
• Other systems or applications
– HOLIS Control Switch is an actor on the HOLIS
Central Control Unit
• A device
– Lights
– Printer
11 / 21
Use Cases
Identifying actors
12 / 21
Use Cases
Primary vs secondary actors
13 / 21
Identifying Use Cases
• A use case (UC) describes a sequence of interactions
between a system and an external actor that results in
the actor being able to achieve some outcome of value
• In this way, the functional requirements of the system
are described in terms of the UCs, which constitute
functional specification of a system.
• To determine the UCs in the system, it is useful to start
by considering the actors and the interactions they have
with the system.
• When developing UCs, it is important to avoid a
functional decomposition in which several small UCs
describe small individual functions of the system rather
than describe a sequence of events that provides a
useful result to the actor
14 / 21
Identifying Use Cases
Use case considering and naming
• Questions to consider when identifying use cases
– What will the actor use the system for?
– Will the actor create, store, change, remove, or read data
in the system?
– Will the actor need to inform the system about external
events or changes?
– Will the actor need to be informed about certain
occurrences in the system?
• The names of use cases are always written in the
form of a verb followed by an object.
• Select strong, descriptive names to make it evident
from the name that the use case will deliver
something valuable for some user.
15 / 21
Identifying Use Cases
Simple Banking Example
• In addition to withdrawing cash from the ATM, the
ATM Customer actor is also allowed to query an
account or transfer funds between two accounts.
• Because these are
distinct functions
initiated by the customer
with different useful
results, the query and
transfer functions should
be modeled as separate
UCs, rather than being
part of the original UC
16 / 21
Documenting Use Cases
UC Spec
• Use case name
• Summary
• Dependency
• Actors
• Preconditions
• Main sequence
• Alternative
sequences
• Postcondition
17 / 21
Documenting Use Cases
Use Case Relationships
UC Relationships
• Generalization
• Include: mandatory
• Extend: optional
18 / 21
Activity Diagrams 1/2
An activity diagram can be
used to represent the
sequential steps of a UC,
including the main sequence
and all the alternative
sequences
• Depicting the flow of control &
sequencing among activities
• Shows the sequence of
activities, decision nodes,
loops, and even concurrent
activities
19 / 21
Activity Diagrams 2/2
• An activity node can be used
to represent one or more
sequential steps of the UC
• To depict a use case, a subset
of the activity diagram
capabilities is sufficient
• Activity diagrams can also be
used to depict sequencing
among UCs.
20 / 21