Use Case Model
Use Case Model
• Components
– Use cases
– Actors
– System
1
Use Case
•Components
– A large box: system boundary
– Stick figures outside the box: actors, both human and
systems
– Each oval inside the box: a use case that represents some
major required functionality and its variant
– A line between an actor and use case: the actor
participates in the use case
2
Use Case (Cont.)
• Use cases do not model all the tasks, instead they are used
to specify user views of essential system behaviour
3
Use Case (Cont.)
• Library use cases including borrowing a book, returning a
borrowed book, and paying a library fine
4
Includes
Includes
You have a piece of behavior that is similar across many
use cases
Break this out as a separate use-case and let the other
ones “include” it
Examples include
Valuation
Validate user interaction
Sanity check on sensor inputs
Check for proper authorization
5
Extends
Extends
A use-case is similar to another one but does a little bit
more
Put the normal behavior in one use-case and the
exceptional behavior somewhere else
Capture the normal behavior
Try to figure out what can go wrong in each step
Capture the exceptional cases in separate use-cases
Makes it a lot easier to understand
6
Comprehensive Use Cases
7
Comprehensive Use Cases
1. Identify actors and goals
What computers, subsystems, people will drive our system?
What does each actor need our system to do?
result: a list of use cases, a sketch of the system
2. Write the main success scenario
easiest to read; everything else is a complication on this
capture each actor's intent and responsibility
3. List the failure extensions
usually almost every step can fail (bad credit, out of stock...)
note failure condition separately, after main success scenario
4. Describe failure-handling
recoverable: back to main course (low stock + reduce quantity)
non-recoverable: fails (out of stock, or not a valued customer)
each scenario goes from trigger to completion
8
Use Case
9
Use Case Example
10
Creating a Use Case Model
11
Relationship among Use Cases
• Use cases can be reused and extended in
two different fashions: extends and uses.
12
13
Elaborated Use Cases
• An elaborated use case has the following components:
– Use Case Name
– Implementation Priority: the relative implementation priority of the
use case.
– Actors: names of the actors that use this use case.
– Summary: a brief description of the use case.
– Precondition: the condition that must be met before the use case
can be invoked.
– Post-Condition: the state of the system after completion of the use
case.
– Extend: the use case it extends, if any.
– Uses: the use case it uses, if any.
– Normal Course of Events: sequence of actions in the case of
normal use.
– Alternative Path: deviations from the normal course.
– Exception: course of action in the case of some exceptional
condition.
– Assumption: all the assumptions that have been taken for this use
case.
14