Use Case
Use Case
Use case
Use case are written stories to fulfill some stakeholders goals
in order to discover and record functional requirements
It must provide an observable user value
In simple
A use case is one usage of the system
Actor appears, interacts, goes away
Unification 2
Use case Modeling
Unification 3
Elements of Use case
Scenario
Actors
System
Goal
Unification 4
Scenario
Unification 5
Actor
An external entity (person or machine) that interacts with
or uses the system
Things that the project cannot control
An actor is external to a system, interacts with the system,
may be a human user or another system, and has goals
and responsibilities to satisfy in interacting with the system.
Actors address the question of who and what interacts with
a system.
In the UML, an actor is shown as a "stick figure" icon.
Process Sale
Unification 6
Organisation
(Accounts Receivable
Tax Agency Device
Kitchen) (Drink
Dispenser
Cash Register
Role Door Lock)
(Employee
Customer
Guest) System
(Accounting Package
Product Inventory
Bar System)
Unification 7
Types of Actors
Primary Actor
To whom System provides services. (Customer)
Secondary Actor
Who help the System to provide the services.
(system Administrator or cash loader of ATM).
Offstage Actor
A stakeholder with interest in the outcome that
must be satisfied, but who is not playing an active
role in the use case. (Supplier)
Unification 8
System
System
Everything that the project has control over
System Boundary
System boundary can be a computer system, organization
boundary, or department boundary. The system functions
and actor may change depending on the system boundary
location.
Understand the System
Understand the limitations of the system
Identify the relation of the actor with the system
Unification 9
Goals
Goal
Systems are built to meet certain stakeholder needs or goals;
these define what the system is supposed to do different tasks.
Unification 10
Finding Primary Actors, Goals,
and Use cases
Unification 11
Procedure
Unification 12
Step 1: System Boundary
Organization Perspective:
Understand the organization structure, behavior, business
processes and rules.
System Perspective:
Try to focus on what is in the scope of the system or what is
outside the scope of system
Identify external and supporting actors
Business Processes
Customer External
System
Software/ Engineer
Hardware
Employee Manager
Business Supplier
Management
Unification 13
Team
Step 2&3: Find primary actors and Goals
Unification 14
Step 4: Define Use cases
Unification 15
Types of Use case
Use cases are written in different formats
depending on the need. Such as
Use case in function context
Primary
Secondary
Use case in Detail level context
High level/Black box use cases
Expanded/White box use cases
Use case in Description level context
Essential
Concrete/ Real
Use case in Formality context
Brief
Casual
Fully dressed
One column
Two column
Unification 16
Cont…
Unification 17
Cont…
Unification 18
Cont…
Unification 19
Cont…
Use case in Formality context
Brief
One paragraph summary usually of main success
scenario
Casual
Multiple paragraphs that covers various scenarios
Fully dressed
All steps and variants are written in detail, along
with supporting sections
One column: System
Unification 20
Unification 21
Use case
Writing Requirements
in Context
Unification 22
Elevator problem
A product is to be installed to control elevators in a building within 8 floors.
The problem concerns the logic required to move elevators between floors
according to the following constraints. Visitor have to pass through a security
system, in which he has to enter a card to get authenticate before entering
the elevator. There is only one elevator in the building.
Each floor , except the first floor and the top floor, has two buttons, one to
request an up elevator and one to request a down elevator. These
illuminates when pressed. The illumination is cancelled when an elevator
visits the floor and then moves in the desired direction
Each elevator has a set of m buttons, one for each floor. These illuminates
when pressed and cause the elevator to visit the corresponding floor. The
illumination is cancelled when corresponding floor is visited by the elevator
There is a display window that shows the current floor being visited by the
elevator
When an elevator has no request, it remains at its current floor with its door
closed
Unification 23
Identify Actor, Goals, Use cases
Elevator
Goals
•He get
Get authenticate authentication and
pass the security
system
•He visits the
Start elevator elevator and wants
to move to the
destination floor
Visitor without interruption
Visit Floor
Unification 24
Fully Dressed Example
Use case name
Use case UC1: Start Elevator
Primary Actor
Who calls on system services to fulfill a goal
user: visitor
Stakeholders and Interests
Interacting with system, and have specific interests in
the system operation
Visitor: he visits the elevator and wants to get in side
without interruption
Elevator boy: he helps people in navigation and
elevator operation when asked
Electrician: he solve elevator functionality related
problems
Unification 25
Preconditions
What must always be true before beginning of
a scenario, they are not tested in use case but
are considered true before hand
Visitor is authenticated and is identified
Success Guarantees (Post condition)
What must be true on success completion of
the use case
Visitor presses the button and get inside the
elevator and elevator door close's
Unification 26
Main success Scenario
Describes typical success path, it stores three
record,
interaction between actors
A validation
A state change
1. Visitor A authenticate himself
2. Visitor A presses the Up floor button at floor 3
to request an elevator, he wishes to go to
floor 7
3. The up floor button turned on
4. An elevator arrives at floor 3
5. The up floor button turn off
6. The elevator doors open
7. The timer starts
8. Visitor A enters the elevator
9. The elevators door close after the time out
Unification 27
Extensions (Alternative Flow)
They indicates all the other scenarios or branches,
both success and failures
An extension has two parts; the condition and the
handling
At the end of the extension handling the scenario
merges back with the main scenario
1a. Unauthorized Visitor
Special requirements
Any non functional requirement specific to use case
under consideration
Language internationalization on the text display
Unification 28
Technology and Data Variations list
Technology constraints of customer
Visitor identification by card system
Open Issues
Any other relevant information
Department laws
Unification 29
Case study: Rent a car
In order to rent a car first of all customer provides the start
date and finish date for the rental and his personal details
(name, address and credit card number) as well. All rentals
are paid via cash.
Company also provides a facility that if a car is stolen proper
assistance and help should be provided to the customer; in
this regard they issue a notice that a car is stolen. A clerk
may alert the system that a car is now considered to be
stolen.
Each week, the clerk will provide a list of the rentals, which
have been initiated the previous week, as report to the
manager who monitors the over all system flows.
Clerks can also add cars to the system when new cars are
purchased by the Company. Store Managers are allowed to
delete cars from the system as well. A car is deleted from the
Unification 30
system when sold or destroyed in an accident
Use case diagram views
Unification 31
System/Business level use case
diagram
Show system level or black box use
cases
Usually captured in Inception
Supermarket System
Unification 33
Include Relationship
Extract a common sequence of events or partial behaviour that
is common across several use cases
From multiple use cases
Create a new inclusion use case
Modify the base use cases to include the inclusion
Avoid repetition
<<include>> <<include>>
Unification 35
Actor Generalization/Specialization
Buy Goods
Customer
Returns Goods
Request
Saver Card
Registered
Customer Unification
Return 36
Saver Card
“The most important characteristic of
a good use case is that the stake
holders understand it.
Unification 37
Diagramming suggestions
<<include>>
Select Items
Buy Goods
Customer
<<Role>> <<extend>>
Unification
Buy Goods with Store Card
38
Show computer system actors with an
alternate notation than a stick figure
Put primary actor on left and supporting
actors on right
Unification 39
References
Class Assignments
Applying UML and Patterns by Craig Larman
Chapter 6, Chapter 25
Unification 40