Use Case Modelling
Use Case Modelling
Use Case Modelling
◼ Typical steps
▪ Find a candidate system boundary
▪ Find actors and goals
▪ Find Use cases
▪ Specify the Use cases
▪ Identify Key alternative flows
▪ Iterate until use cases, actors, and system boundary are stable
System Boundary
◼ The System boundary defines the border between the solution and
the real world that surround the solution
◼ Our system
◼ Things that interact with our system
◼ What is inside and what is outside?
System
boundary
I/O
Our Solution
Other
I/O Systems
An Actor
◼ Is not part of the system
◼ Is a role a user of the system can play
◼ Can represent a human, a machine, or another system
◼ Can actively interchange information with the system
◼ Can be a giver of information
Actor
Actors - stakeholders
Three kind of Actors - Stakeholders
Primary actor
a user whose goals has to be fulfilled by the system by using services of the
System under description e.g a cashier
importance: define user goals
Primary Actors Initiate the Use Case.
Supporting actor
provides a service (e.g information) to system under description
Secondary actors do not initiate the Use Case.
Actors - stakeholders
Offstage actor
It has an interest in the behavior of the use case, but is not primary or supporting
(e.g., a government tax agency).
importance: ensure all interests (even subtle) are identified
and satisfied
Example of Actors - stakeholders
Q what are the primary secondary and offstage actors in a criminal record system
made for police
Example of Actors - stakeholders
E.G For a criminal record system made for police
Primary actors: The Employees who use the system
Secondary or supporting actor: The nadra system which may give input
offstage actor: The government of Pakistan and higher officials of police and other
defence departments as well as the citizens of Pakistan are the offstage actor
Who Is the Actor?
Who is pressing the keys (interacting with the system)?
User-goal level:
the sea level perspective i.e. goal of primary actor in doing something
Sub functions
underwater perspective i.e. those required to carry out user goals.
Use Case Goals and levels
w ?
Ho Sub function
Example of user goals and levels
Actor has the goal of achieving the service
We name the use case for this goal
Alternate scenarios
UML use case diagrams
open account
customer
Use cases vs. internal features
System boundary
Case Study – The NextGen POS System
Computerized application used to record sales and handle payments and is Used
in retail store
It includes hardware and software
It also interfaces to other applications, such as a third-party tax calculator and
inventory control and system should work even if access to external services is
down (i.e. at least allow checkout with cash if credit card processing software goes
down)
Needs to support Multiple clients-side interfaces i.e. web browser , touch screen
and wireless phone etc
Commercial POS
4. Define Use cases for user goals
system boundary NextGen POS communication
«actor»
Cash In Accounting
System
Manager
«actor»
«actor» Analyze Activity
HR System
Sales Activity
System
Manage Security
e.g
(Process my Email): A student can login, see the headers of Email messages and
then read, delete, reply to, and forward a message.
Use Case Formats (verbal description)
2. Casual
Informal, multiple paragraphs that cover various scenarios.
Name short name
(Main Success A student can register with the system by giving certain details, supplying a system id
Scenario): user name and a password(twice). The system responds by reflecting the information
back to the student (but not the password). The student confirms the data and is allowed
access to it via the usual login.
(Alternative If the user name is already in use the student is asked to change their user name .
scenario 1):
(Alternative If the two passwords are not equal the student must re-input them.
scenario 2):
Fully dressed use case example
System Online shopping system
Use case name UC12:Validate credit card
Brief description In the online shopping system the customer provides a credit card and it is
validated
Scope This system has a great future scope .It provides security with the use of login id
and password so that any un-authorized users cannot use your account to do
shopping. The authorized will only have access to do online shopping
Alternative In step 2 if credit card company rejects card, system sends rejection message to user
scenario 2a
Alternative In step 2 if the credit card company does not respond within 10 seconds
scenario 2b 1. Tell the user of delay
2. repeat verifying the card
Alternative *a In any step, if the client does not respond after 30 seconds, cancel the transaction
Alternative *b In any step, if there is a power failure, turn off the system
Assumptions User has a credit card
Special Security – no way for customer data to be sniffed
requirements
Detail a use case
Specify use cases you have identified:
Example “Create Sales Order”
Name: Create Sales Order
Summary: Customer creates and saves a Sales Order
System: SMS
Actor: Customer
Pre Condition: Customer is logged in to SMS
Post Condition: Sales order completed and saved. Sales Item is accurate,
including quantities in stock and proposed delivery dates. Pricing is accurate
and complete.
Generalization:
◼ Actor generalization factors out behavior common to two or more actors into a
parent actor.
Generalization (cont..):
◼ Use case generalization factors out behavior common to one or more use
cases into a parent use case.
Use case: Find Book
ID: 7
Parent ID: 6
Brief Description: The customer searches for a book
Primary actors: Customer
Secondary actors: None
Preconditions: None
Main flow:
Overridden 1. (o1.) The Customer selects “find book”.
Overridden 2. (o2.) The system asks the Customer for book search criteria comprising author, title,
ISBN, or topic
Inherited w/o 3. (3.) The Customer enters the requested criteria
change :
:
6.2 (6.1) The system tells the Customer that no matching products could be found