2. 2
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
3. 3
Use Case (Cont.)
• Use cases do not model all the tasks, instead they are used
to specify user views of essential system behaviour
4. 4
Use Case (Cont.)
• Library use cases including borrowing a book, returning a
borrowed book, and paying a library fine
5. 5
Includes
l Includes
n You have a piece of behavior that is similar across many
use cases
n Break this out as a separate use-case and let the other
ones “include” it
n Examples include
u Valuation
u Validate user interaction
u Sanity check on sensor inputs
u Check for proper authorization
6. 6
Extends
l Extends
n A use-case is similar to another one but does a little bit
more
n Put the normal behavior in one use-case and the
exceptional behavior somewhere else
u Capture the normal behavior
u Try to figure out what can go wrong in each step
u Capture the exceptional cases in separate use-cases
n Makes it a lot easier to understand
7. 7
Comprehensive Use Cases
Steps to write a Comprehensive Use Case:
1.Identify actors and goals
2.Write the main success scenario
3.List the failure extensions
4.Describe failure-handling
8. 8
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
9. 9
Use Case
Use Case ID: #
Use Case Name: Write the use case name here.
Actors: Actors involve in this use case.
Description: What this use case going to do.
Pre-conditions: States/conditions before executing the use case.
Post-conditions: Condition/states after executing the use case.
Normal Flow: Success scenario.
Exit Condition: Condition/state on which the use case will end.
Exception:
10. 10
Use Case Example
Use Case ID: 06
Use Case Name: Compare Products
Actors: Customer/Guest
Description: Customer/Guest must be navigate to the Compare Products
Screen.
Pre-conditions: One product must be select before.
Post-conditions: Compare products screen must be visible to the
Customer/Guest.
Normal Flow: Customer/Guest must select one product and then should
click on the compare products button on the Product Details
Page.
Exit Condition: Successful Comparison.
Exception: Product is not available.
11. 11
Creating a Use Case Model
• Creating a use case model is an iterative
activity.
– identification of actors
– use cases
– relationships among use cases
• These activities are sort of parallel
12. 12
Relationship among Use Cases
• Use cases can be reused and extended in
two different fashions: extends and uses.
14. 14
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.