Use Case Diagram Use Case Scenario
Use Case Diagram
& Use Case
Scenario
Business process model
• Business process model describe the different activities that when
combined together support a business process
• Business process typically cut across functional departments cut
across multiple objects (from oo perspective)
• Business process models are powerful tool for communication the
analyst’s current understanding of requirements with the user.
• Activity diagram or flow chart as a means to build business process
model
Use Case Diagram
• Actor
• Refers to a particular role of a user of the system
• Similar to external entities; they exist outside of the system
• Use case symbols
• An oval indicating the task of the use case
• Connecting lines
• Arrows and lines used to diagram behavioral relationships
2-3
Four Types Of Behavioral Relationships And The Lines Used To Diagram Each
2-4
Some components of use case diagrams showing actors, use cases, and relationships
for a student enrollment example
2-5
Developing the Use Case Scenarios
• The description of the use case
• Three main areas:
• Use case identifiers and initiators
• Steps performed
• Conditions, assumptions, and questions
2-6
A Use Case Scenario Is Divided into Three Sections
Use case name: Register for Conference
Area:
Conference Planning
Actor(s):
Participant
Stakeholder
Conference Sponsor, Conference Speakers
Level
Blue
Description:
Allow conference participant to register online for the conference using a secure Web site.
UniqueID: Conf RG 003
Triggering Event: Participant uses Conference Registration Web site, enters userID and password, and clicks the logon button.
Trigger type:
External
Temporal
Steps Performed (Main Path)
Information for Steps
1.
userID, Password
Participant logs in using the secure Web server
More steps included here…
12.
Successful Registration Confirmation Web page is sent to the participant
Registration Record Confirmation Number
Preconditions:
Participant has already registered and has created a user account.
Postconditions:
Participant has successfully registered for the conference.
Assumptions:
Participant has a browser and a valid userID and password.
Success Guarantee:
Participant has registered for the conference and is enrolled in all selected sessions.
Minimum Guarantee:
Participant was able to logon.
Requirements Met:
Allow conference participants to be able to register for the conference using a secure Web site.
Outstanding Issues:
How should a rejected credit card be handled?
Priority:
High
Risk:
Medium
2-7
Alternative Scenarios
• Extensions or exceptions to the main use case
• Number with an integer, decimal point, integer
• Steps that may or may not always be used
2-8
Four Steps Used to Create Use Cases
• Use agile stories, problem definition objectives, user requirements, or
a features list (as result of requirement gathering –last lecture)
• Ask about the tasks that must be done
• Determine if there are any iterative or looping actions
• The use case ends when the customer goal is complete
2-9
Major Steps in Writing Use-Case Description and Usecase Diagrams
• Step 1. Identify the major use-cases
• Step 2. Expand the major use-case
• Step 3. Confirm the major use-cases
• Step 4. Create the use-case diagram
Step 1. Identifying the Major Use-Cases
1.
2.
3.
4.
5.
Review the activity diagram or flow chart described business process
Identify the system’s boundaries
List the primary actors and their goals
Identify and write the major use-cases
Carefully review use-cases and revise as needed
Application
Example:
Internet Order System – Functional requirements:
1.
Maintain CD Information
1.1……1.2….. 1.3…..
2.
Maintain CD marketing information
2.1…. 2.2….
3.
2.3….
Place CD Orders
3.1 Search CDs from “CD Selection” web site; 3.2 Place orders;
3.3……
4.
Maintain Orders
4.1….. 4.2…
4.3 Place Instore Hold: If ordered CDs are available in a near store, the CDs are on hold and to be picked up in
the store
4.4. Place Special Order: If ordered CDs is not available in a near store, the ordered CDs will be sent to a near
store and email to the customer when it is available in the near store
Step 1. Identifying the Major Use-Cases - Example
Review activity diagram of
Internet order System:
Place CD
Order
Maintain
CD Order
Maintain CD
marketing
information
Maintain CD
Information
Step 1. Identifying the Major Use-Cases - Example
Identify and write the major (overview) use-cases
Use case name
Primary
actor
Relationship
Maintain marketing
information
Vendor
Vendor
Maintain CD
information
Distribution
system
Distribution
system
Place order
Customer
Customer
Maintain order
Customer
Association
Include
Maintain order
Exclude
Step 2. Expand the Major Use-Cases
6.
Choose one major use-case to expand
7.
Fill in details on the use-case template
8.
Fill in the steps of the normal flow of events
9.
Normalize the size of each step (i.e., if the normal flow of events is too complex or
long, decompose into subflows or introduce a new use case)
10.
Describe alternate or exceptional flows
11.
For each alternate or exceptional flow, list how the actor and/or system should react
Step 2. Expand the Major Use-Cases - Example
Step 2. Expand the Major Use-Cases - Example
Step 2. Expand the Major Use-Cases - Example
New use case
Step 2. Expand the Major Use-Cases - Example
New use case
Step 2. Expand the Major Use-Cases - Example
• Expand the major use-case
• By writing down the detailed use cases, it is identified that 3 new use
cases are needed
• As shown in the last slide, one “include” use case “Check out” for Place Order
use case
• Similarly, Two “extend” use cases “Place instore hold” and “Place special order”
for Maintain Order use case
Step 3. Confirm the Major Use Cases
12. Review the current set of use case, revise as needed
•
•
Consider semantics and syntax
Helpful to involve the users
13. Iterate the entire set of steps until all use cases are defined
Step 4. Create the Use-Case Diagram
1.
2.
3.
4.
Draw the system boundary
Place the user cases on the diagram (better to put them in order to be easy
to read)
Place the actors on the diagram
Draw the associations (such as connecting actors to use cases by lines etc)
Exercise: Draw use-case diagram
Question. Suppose that 7 major use cases have been identified as below, draw the
corresponding use-case diagram
Use case name
Primary actor
Relationship
Association
Include
Maintain
marketing
information
Vendor
Vendor
Maintain CD
information
Distribution
system
Distribution
system
Place order
Customer
Customer
Check out
Maintain
order
Check out
Customer
Customer, Credit
Centre
Maintain
order
Maintain order
Customer
Place Instore hold
Place special order
Place Instore hold Customer
Store
Place special order
Store
Customer
Exclude
Solution:
Maintain CD
marketing information
Credit
Card
Centre
Place CD
order
Check out
Maintain CD
order
Place instore hold
>
Place special order
Distribution
System
Maintain CD
information
Store
Case Study - ATM
• Model only the transactions
• Customer accounts assumed to exist
• Opening and closing of accounts is handled by another portion of the system
• Include operations “deposit”, withdraw”, “check balance”, “transfer”
• If balance is zero or less than the amount to be withdrawn, then withdrawal
should fail
Login
Logout
Deposit
customer
Withdraw
Check balance
Database
Transfer
All dependency relationships are of type
Use case narratives - ATM
• Deposit
• Using this functionality, a user will be able to add some money to
his/her account
• Account identification and amount to be deposited must be input
• Upon completion, the balance in the account will be updated to
include the additional amount
• Check balance
• A user can check the balance in an account using this functionality
• Account identification must be input and the balance in the account will be
output
• The account remains unchanged upon completion
Login
Logout
Deposit
Validate
account
customer
Withdraw
Update account
Check balance
Database
Transfer
All dependency relationships are of type
Use case diagram for ATM - revisited
Case Study – Restaurant System
• Functional Requirement:
1.
2.
3.
4.
5.
Receptionist produce restaurant table chart
A customer can request table before going to restaurant
A customer place an order
A waiter will collect the order
An external system manage menu & order so customer can place an order and
collected by waiter
6. A customer can pay bill through three ways; by cash, by credit card, or by cheque
7. The cashier will collect money based on billing system information produced by
external system
8. The cashier can update account based on billing system information produced by
external system
Task: draw the use case diagram based on those requirement
Case Study –
Travel Agency
Tasks:
1. Complete
(arrow) the
Use Case
Diagram
correctly
2. Make Use Case
Scenario for
each use case
& Use Case
Scenario
Business process model
• Business process model describe the different activities that when
combined together support a business process
• Business process typically cut across functional departments cut
across multiple objects (from oo perspective)
• Business process models are powerful tool for communication the
analyst’s current understanding of requirements with the user.
• Activity diagram or flow chart as a means to build business process
model
Use Case Diagram
• Actor
• Refers to a particular role of a user of the system
• Similar to external entities; they exist outside of the system
• Use case symbols
• An oval indicating the task of the use case
• Connecting lines
• Arrows and lines used to diagram behavioral relationships
2-3
Four Types Of Behavioral Relationships And The Lines Used To Diagram Each
2-4
Some components of use case diagrams showing actors, use cases, and relationships
for a student enrollment example
2-5
Developing the Use Case Scenarios
• The description of the use case
• Three main areas:
• Use case identifiers and initiators
• Steps performed
• Conditions, assumptions, and questions
2-6
A Use Case Scenario Is Divided into Three Sections
Use case name: Register for Conference
Area:
Conference Planning
Actor(s):
Participant
Stakeholder
Conference Sponsor, Conference Speakers
Level
Blue
Description:
Allow conference participant to register online for the conference using a secure Web site.
UniqueID: Conf RG 003
Triggering Event: Participant uses Conference Registration Web site, enters userID and password, and clicks the logon button.
Trigger type:
External
Temporal
Steps Performed (Main Path)
Information for Steps
1.
userID, Password
Participant logs in using the secure Web server
More steps included here…
12.
Successful Registration Confirmation Web page is sent to the participant
Registration Record Confirmation Number
Preconditions:
Participant has already registered and has created a user account.
Postconditions:
Participant has successfully registered for the conference.
Assumptions:
Participant has a browser and a valid userID and password.
Success Guarantee:
Participant has registered for the conference and is enrolled in all selected sessions.
Minimum Guarantee:
Participant was able to logon.
Requirements Met:
Allow conference participants to be able to register for the conference using a secure Web site.
Outstanding Issues:
How should a rejected credit card be handled?
Priority:
High
Risk:
Medium
2-7
Alternative Scenarios
• Extensions or exceptions to the main use case
• Number with an integer, decimal point, integer
• Steps that may or may not always be used
2-8
Four Steps Used to Create Use Cases
• Use agile stories, problem definition objectives, user requirements, or
a features list (as result of requirement gathering –last lecture)
• Ask about the tasks that must be done
• Determine if there are any iterative or looping actions
• The use case ends when the customer goal is complete
2-9
Major Steps in Writing Use-Case Description and Usecase Diagrams
• Step 1. Identify the major use-cases
• Step 2. Expand the major use-case
• Step 3. Confirm the major use-cases
• Step 4. Create the use-case diagram
Step 1. Identifying the Major Use-Cases
1.
2.
3.
4.
5.
Review the activity diagram or flow chart described business process
Identify the system’s boundaries
List the primary actors and their goals
Identify and write the major use-cases
Carefully review use-cases and revise as needed
Application
Example:
Internet Order System – Functional requirements:
1.
Maintain CD Information
1.1……1.2….. 1.3…..
2.
Maintain CD marketing information
2.1…. 2.2….
3.
2.3….
Place CD Orders
3.1 Search CDs from “CD Selection” web site; 3.2 Place orders;
3.3……
4.
Maintain Orders
4.1….. 4.2…
4.3 Place Instore Hold: If ordered CDs are available in a near store, the CDs are on hold and to be picked up in
the store
4.4. Place Special Order: If ordered CDs is not available in a near store, the ordered CDs will be sent to a near
store and email to the customer when it is available in the near store
Step 1. Identifying the Major Use-Cases - Example
Review activity diagram of
Internet order System:
Place CD
Order
Maintain
CD Order
Maintain CD
marketing
information
Maintain CD
Information
Step 1. Identifying the Major Use-Cases - Example
Identify and write the major (overview) use-cases
Use case name
Primary
actor
Relationship
Maintain marketing
information
Vendor
Vendor
Maintain CD
information
Distribution
system
Distribution
system
Place order
Customer
Customer
Maintain order
Customer
Association
Include
Maintain order
Exclude
Step 2. Expand the Major Use-Cases
6.
Choose one major use-case to expand
7.
Fill in details on the use-case template
8.
Fill in the steps of the normal flow of events
9.
Normalize the size of each step (i.e., if the normal flow of events is too complex or
long, decompose into subflows or introduce a new use case)
10.
Describe alternate or exceptional flows
11.
For each alternate or exceptional flow, list how the actor and/or system should react
Step 2. Expand the Major Use-Cases - Example
Step 2. Expand the Major Use-Cases - Example
Step 2. Expand the Major Use-Cases - Example
New use case
Step 2. Expand the Major Use-Cases - Example
New use case
Step 2. Expand the Major Use-Cases - Example
• Expand the major use-case
• By writing down the detailed use cases, it is identified that 3 new use
cases are needed
• As shown in the last slide, one “include” use case “Check out” for Place Order
use case
• Similarly, Two “extend” use cases “Place instore hold” and “Place special order”
for Maintain Order use case
Step 3. Confirm the Major Use Cases
12. Review the current set of use case, revise as needed
•
•
Consider semantics and syntax
Helpful to involve the users
13. Iterate the entire set of steps until all use cases are defined
Step 4. Create the Use-Case Diagram
1.
2.
3.
4.
Draw the system boundary
Place the user cases on the diagram (better to put them in order to be easy
to read)
Place the actors on the diagram
Draw the associations (such as connecting actors to use cases by lines etc)
Exercise: Draw use-case diagram
Question. Suppose that 7 major use cases have been identified as below, draw the
corresponding use-case diagram
Use case name
Primary actor
Relationship
Association
Include
Maintain
marketing
information
Vendor
Vendor
Maintain CD
information
Distribution
system
Distribution
system
Place order
Customer
Customer
Check out
Maintain
order
Check out
Customer
Customer, Credit
Centre
Maintain
order
Maintain order
Customer
Place Instore hold
Place special order
Place Instore hold Customer
Store
Place special order
Store
Customer
Exclude
Solution:
Maintain CD
marketing information
Credit
Card
Centre
Place CD
order
Check out
Maintain CD
order
Place instore hold
>
Place special order
Distribution
System
Maintain CD
information
Store
Case Study - ATM
• Model only the transactions
• Customer accounts assumed to exist
• Opening and closing of accounts is handled by another portion of the system
• Include operations “deposit”, withdraw”, “check balance”, “transfer”
• If balance is zero or less than the amount to be withdrawn, then withdrawal
should fail
Login
Logout
Deposit
customer
Withdraw
Check balance
Database
Transfer
All dependency relationships are of type
Use case narratives - ATM
• Deposit
• Using this functionality, a user will be able to add some money to
his/her account
• Account identification and amount to be deposited must be input
• Upon completion, the balance in the account will be updated to
include the additional amount
• Check balance
• A user can check the balance in an account using this functionality
• Account identification must be input and the balance in the account will be
output
• The account remains unchanged upon completion
Login
Logout
Deposit
Validate
account
customer
Withdraw
Update account
Check balance
Database
Transfer
All dependency relationships are of type
Use case diagram for ATM - revisited
Case Study – Restaurant System
• Functional Requirement:
1.
2.
3.
4.
5.
Receptionist produce restaurant table chart
A customer can request table before going to restaurant
A customer place an order
A waiter will collect the order
An external system manage menu & order so customer can place an order and
collected by waiter
6. A customer can pay bill through three ways; by cash, by credit card, or by cheque
7. The cashier will collect money based on billing system information produced by
external system
8. The cashier can update account based on billing system information produced by
external system
Task: draw the use case diagram based on those requirement
Case Study –
Travel Agency
Tasks:
1. Complete
(arrow) the
Use Case
Diagram
correctly
2. Make Use Case
Scenario for
each use case