Lec 5 Use Case Modelling
Lec 5 Use Case Modelling
• Use cases are defined to satisfy the user goals of the primary actors.
Hence, the basic procedure is:
1. Choose the system boundary: Is it just a software application, the
hardware and application as a unit, that plus a person using it, or
an entire organization?
2. Identify the primary actors: those that have user goals fulfilled
through using services of the system.
3. For each, identify their user goals: Raise them to the highest user
goal level that satisfies the EBP guideline.
4. Define use cases that satisfy user goals: name them according to
their goal. Usually, user goal-level use cases will be one-to-one with
user goals, but there is at least one exception, as will be examined.
Reminder Questions to Find Actors and
Goals to find Missing use cases
• Who starts and stops the system?
• Who does user and security management?
• Is there a monitoring process that restarts the system if it fails?
• How are software updates handled? Push or pull update?
• Who does system administration?
• Is "time" an actor because the system does something in
response to a time event?
• Who evaluates system activity or performance?
• Who evaluates logs?
• Are they remotely retrieved?
Class Activity
• Answer the following questions as per ATM Case study:
• Who starts and stops the system?
• Who does user and security management?
• Is there a monitoring process that restarts the system if it fails?
• How are software updates handled? Push or pull update?
• Who does system administration?
• Is "time" an actor because the system does something in
response to a time event?
• Who evaluates system activity or performance?
• Who evaluates logs?
• Are they remotely retrieved?
Class Activity
• Find following actors and their goals from ATM
Case study:
• Primary Actors
• Secondary Actors
• Goals
• Use cases
• Use cases Instances (use case scenario)
Another approach to aid in finding actors,
goals, and use cases
• To identify external events:
• What are they?
• where from?
• and why?
• Often, a group of events belong to the same
Elementary Business Processes (EBP)-level goal or
use case. For example:
Difference b/w Primary and Supporting
Actors
• Primary actors have user goals fulfilled
through using services of the system. They call
upon the system to help them.
• Supporting actors provide services to the
system under design
The Actor-Goal List
The Sales Activity System is a remote application that will frequently request sales
data from each POS node in the network.
Class Activity
Draw The Actor-Goal List of ATM Case Study
Actor Goal Actor Goal
So Informally What is use case?
• Collection of related success and failure scenarios that describe
actors using a system to support a goal. E.g.
• Handle Returns of POS:
• Main Success Scenario: A customer arrives at a checkout with
items to return. The cashier uses the POS system to record each
returned item ...
• Alternate Scenarios: If the credit authorization is reject, inform
the customer and ask for an alternate payment method. If the
item identifier is not found in the system, notify the Cashier and
suggest manual entry of the identifier code (perhaps it is
corrupted). If the system detects failure to communicate with the
external tax calculator system, ...
Formally, What are Use Cases?
• Use cases are text documents, not diagrams,
• Use-case Modeling: Primarily an act of writing text,
not drawing.
• However, the UML defines a use case diagram to
illustrate the names of use cases and actors, and their
relationships.
• Some think use cases are "the system shall do...“ is not
only feasible, also known as “shall” statements
• Its basic use is to model features of existing old system.
Example of Brief Format Use Case:
• Process Sale: A customer arrives at a checkout
with items to purchase. The cashier uses the
POS system to record each purchased item.
The system presents a running total and line-
item details. The customer enters payment
information, which the system validates and
records. The system updates inventory. The
customer receives a receipt from the system
and then leaves with the items
Essence (Heart) of Use Case is:
• Discovering and Recording
functional requirements by
writing stories of using a
system to help fulfill various
stakeholder goals/dream
(vision)
Black-Box Use Cases and System
Responsibilities
Black-box style Not
The system records the sale. The system writes the sale to a
database. ...or (even worse): The system
generates a SQL INSERT statement for the
sale...
Types of Use Case Formats
• Brief: concise one-paragraph summary, usually of the
main success scenario. The prior Process Sale
example was brief.
• Casual: informal paragraph format. Multiple
paragraphs that cover various scenarios. The prior
Handle Returns example was casual.
• Fully Dressed: the most elaborate. All steps and
variations are written in detail, and there are
supporting sections, such as preconditions and
success guarantees and post conditions.
Use Case UC1: Process Sale
• Primary Actor: Cashier
• Stakeholders and Interests: - Cashier: Wants accurate, fast entry, and no payment
errors, as cash drawer short ages are deducted from his/her salary.
• Salesperson: Wants sales commissions updated.
• Customer: Wants purchase and fast service with minimal effort. Wants proof of
purchase to support returns. –
• Company: Wants to accurately record transactions and satisfy customer interests.
Wants to ensure that Payment Authorization Service payment receivables are recorded.
Wants some fault tolerance to allow sales capture even if server components (e.g.,
remote credit validation) are unavailable. Wants automatic and fast update of
accounting and inventory.
• Government Tax Agencies: Want to collect tax from every sale. May be multiple
agencies, such as national, state, and county. –
• Payment Authorization Service: Wants to receive digital authorization requests in the
correct format and protocol. Wants to accurately account for their payables to the store.
• Preconditions: Cashier is identified and authenticated. Success
Guarantee
• Postconditions: Sale is saved. Tax is correctly calculated.
Accounting and Inventory are updated. Commissions recorded.
Receipt is generated. Payment authorization approvals are
recorded.
• Main Success Scenario (or Basic Flow):
• 1. Customer arrives at POS checkout with goods and/or
services to purchase.
• 2. Cashier starts a new sale.
• 3. Cashier enters item identifier.
• 4. System records sale line item and presents item description,
price, and running total. Price calculated from a set of price
rules. Cashier repeats steps 3-4 until indicates done.
• 5. System presents total with taxes calculated.
• 6. Cashier tells Customer the total, and asks for
payment.
• 7. Customer pays and System handles payment.
• 8. System logs completed sale and sends sale and
payment information to the external Accounting
system (for accounting and commissions) and
Inventory system (to update inventory).
• 9. System presents receipt.