1 of 49

�USE CASES

How do we specify the use cases of a system?

Lecture 10

2 of 49

Announcements/Reminders

  • HW4 due tonight 11:59pm
  • HW4 peer eval (optional) closes Friday 11:59pm
  • EXAM #2 Tuesday

Text questions to (562) 684-8307

2

3 of 49

Canvas Quiz

Lecture 10: Lecture 9 Review

Text questions to (562) 684-8307

3

4 of 49

Summary – What RE process do we follow?

  • There is no “one size fits all” RE process
    • Many influencing factors exist
  • An RE process can be configured based on three facets: time (linear/iterative), purpose (prescriptive/explorative), and target (customer/market)
  • Some typical RE process configurations are participatory, contractual, and product-oriented

Text questions to (562) 684-8307

4

5 of 49

Today’s Lecture – How do we specify the use cases of the system?

  • Actors and Use Cases
  • Relationships
  • Scenarios
  • From Scenarios to Use Cases
  • Use Case Descriptions
  • EXAM #2 study guide

Text questions to (562) 684-8307

5

6 of 49

Use Case Model

Consists of:

  • Use case diagrams (one or more):
    • Actors (agents)
    • Use cases
    • Relationships
    • System boundary
  • Use case descriptions
    • Sometimes using a template

Text questions to (562) 684-8307

7 of 49

How are Use Cases Developed?

Iterative, discussion-based process involving the developers and the customers (and/or end users)

  • Defining the system
  • Finding the actors/use cases
  • Describing the use cases
  • Defining relationships between use cases
  • Validating the model

Text questions to (562) 684-8307

8 of 49

Today’s Lecture – How do we specify the use cases of the system?

  • Actors and Use Cases
  • Relationships
  • Scenarios
  • From Scenarios to Use Cases
  • Use Case Descriptions
  • EXAM #2 study guide

Text questions to (562) 684-8307

8

9 of 49

Actors

  • Represent external entities that interact with the system
    • Human
    • Hardware
    • External software
  • A use case is initiated by an actor to invoke a certain functionality in the system
  • A use case is a dialogue between actors and the system

Text questions to (562) 684-8307

Symbolic representation of an actor within a use case diagram

10 of 49

Identifying Actors (I)

  • Actors are discovered
    • by reading system documents
    • by talking with customers and domain experts
  • Useful questions for identifying actors:
    • Who uses the system?
    • Who starts up the system?
    • Who shuts down the system?
    • What other devices and external systems work directly with the system?

Text questions to (562) 684-8307

11 of 49

Identifying Actors (II)

  • Additional questions for identifying actors are:
    • Who gets information from this system?
    • Who provides information to the system?
    • Who is interested in a certain requirement?
    • Where in the organization is the system used?
    • Who will benefit from the use of the system?
    • Does the system use an external resource?
    • Does one person play several different roles?
    • Do several people play the same role?
    • Does the system interact with a legacy system?

Text questions to (562) 684-8307

12 of 49

Actor Brainstorming

  • Go to www.menti.com and enter code 1792 0643

Text questions to (562) 684-8307

12

13 of 49

Use Case

  • Set of actions defining interactions between an actor and the system to achieve a goal
  • A use case is within the boundaries of the system and is connected to one or more actors

Use case name

Symbolic representation of a use case within a use case diagram

14 of 49

Use Case Characteristics

  • A use case provides value to an actor (observable use case results)
  • Use case name should describe functionality (in a few words)

Text questions to (562) 684-8307

15 of 49

Identifying Use Cases – Useful Questions

  • What functions will each actor want from the system?
  • Does the system store information? What actors will create, read, update, or delete (CRUD) that information?
  • Which use cases are involved in each usage scenario?
  • What objectives do each external entity in the context diagram want to achieve with the system?

Text questions to (562) 684-8307

16 of 49

Example Use Cases (I)

Text questions to (562) 684-8307

16

Application

Sample use cases

Chemical tracking system

Request a Chemical

Print Material Safety Data Sheet

Change a Chemical Request

Check Order Status

Generate Chemical Usage Report

Airport check-in kiosk

Check in for Flight

Print Boarding Passes

Change Seats

Check Luggage

Purchase an Upgrade

17 of 49

Example Use Cases (II)

Text questions to (562) 684-8307

17

Application

Sample use cases

Accounting system

Create Invoice

Reconcile Account Statement

Enter Credit Card Transaction

Print Vendor Tax Form

Search for Transaction

Online bookstore

Update Customer Profile

Search for Item

Purchase Item

Track Package

Cancel Order

18 of 49

Use Cases and User Stories

18

Application

Sample use case

Corresponding user story

Chemical tracking system

Request a Chemical

As a chemist, I want to request a chemical so that I can perform experiments.

Airport check-in kiosk

Check in for Flight

As a traveler, I want to check in for a flight so that I can fly to my destination.

Accounting system

Create Invoice

As a small business owner, I want to create an invoice so that I can bill a customer.

Online bookstore

Update Customer Profile

As a customer, I want to update my customer profile so that future purchases are billed to a new credit card number.

19 of 49

Today’s Lecture – How do we specify the use cases of the system?

  • Actors and Use Cases
  • Relationships
  • Scenarios
  • From Scenarios to Use Cases
  • Use Case Descriptions
  • EXAM #2 study guide

Text questions to (562) 684-8307

19

20 of 49

Association Relationship

  • Use cases are connected to actors through Associations
    • shown as solid lines
  • Associations show which actors the use case communicates with, including the actor that initiates the execution of the use case

Text questions to (562) 684-8307

Register for course

Student

21 of 49

Example of Association

An ATM user withdraws/deposits/transfers money

ATM

Withdraw money

Deposit money

Transfer money

ATM User

Bank System

(human)

(external software)

22 of 49

Canvas Quiz

Lecture 10: Use Case Diagram

Text questions to (562) 684-8307

22

23 of 49

Today’s Lecture – How do we specify the use cases of the system?

  • Actors and Use Cases
  • Relationships
  • Scenarios
  • From Scenarios to Use Cases
  • Use Case Descriptions
  • EXAM #2 study guide

Text questions to (562) 684-8307

23

24 of 49

Scenarios

  • Story of use with the new product
    • User has a certain motivation and specific goal in mind
  • Shows the goal of the user, setting of usage, some of the steps
  • Humans easily understand and relate to stories

Text questions to (562) 684-8307

25 of 49

Scenario 1: Joining MyFlix

While Blake is searching the Internet to find out if there are any local theaters playing a newly released independent film, he finds the profile page for the film which is also released on MyFlix. Excited that he can watch it and similar films in the comfort of his apartment, he creates an account and begins paying the regular monthly fee. He accesses his account from his TV’s browser and is able to stream the movie.

Source: https://launchschool.com/books/agile_planning/read/myflix_scenarios

Text questions to (562) 684-8307

26 of 49

Scenario 2: Discovering Content

Blake has some pretty specific tastes in films and TV shows. At work he browses through various categories on the MyFlix website and reads the reviews on some films in the categories he likes. Reading several summaries and recommendations that match his preferences, he adds these films to his ever growing queue, so later he can quickly pick something to watch.

Source: https://launchschool.com/books/agile_planning/read/myflix_scenarios

Text questions to (562) 684-8307

27 of 49

Today’s Lecture – How do we specify the use cases of the system?

  • Actors and Use Cases
  • Relationships
  • Scenarios
  • From Scenarios to Use Cases
  • Use Case Descriptions
  • EXAM #2 study guide

Text questions to (562) 684-8307

27

28 of 49

Use Cases and Scenarios

  • Typically scenarios model instances of the interactions between the users/actors and the system use cases
  • Use cases can be identified by analyzing scenarios for the different functions provided by the system

Step 1: identify a single scenario/instance

Step 2: develop use cases that specify all possible instances/paths/scenarios

29 of 49

Example: Warehouse Fire Scenario

  • Field Officer Bob, driving down main street in his patrol car, notices smoke coming out of a warehouse.
  • His partner, Alice, reports the emergency from their car. She enters the address of the building, a brief description of its location, and an emergency level of 4. In addition to a fire unit, she requests several paramedic units on the scene given that the area appears to be relatively busy. She confirms her input and waits for an acknowledgment.
  • John, the Dispatcher, is alerted to the emergency by a beep of his workstation. He opens an incident, reviews the information submitted by Alice and acknowledges the report.
  • John allocates a fire unit and two paramedic units to the Incident site and sends their estimated arrival time (ETA) of 5:34pm to Alice.
  • Alice receives acknowledgment and the ETA.

Text questions to (562) 684-8307

30 of 49

Review of Scenario: Warehouse Fire

  • Concrete scenario
    • Describes a single instance of reporting a fire incident
    • Does not describe all possible situations in which a fire can be reported
  • Participating actors
    • Bob, Alice and John
  • What’s relevant from the system point of view?
    • simplify the scenario relevant to system

Text questions to (562) 684-8307

31 of 49

Warehouse Fire: �Simplified and Organized

  • Field Officer Bob notices smoke coming out of a warehouse.
  • His partner Alice reports the emergency.
    • She enters the address of the building, a brief description of its location, and an emergency level. In addition to a fire unit, she requests several paramedic units.
  • John, the Dispatcher, is alerted to the emergency by a beep of his workstation. He opens an incident, reviews the information submitted by Alice and acknowledges the report.
  • John allocates appropriate resources and sends their estimated arrival time (ETA) to Alice.
  • Alice receives acknowledgment and the ETA.

Text questions to (562) 684-8307

32 of 49

Warehouse Fire: �Derive Incident Management Use Cases

  • Identify Use Cases that specify all possible instances (keep in mind the system boundary) �- for example:
    • “Report Emergency “ in the first paragraph of the scenario is a candidate for a use case
    • “Open Incident”
    • “Allocate Resources”
  • Describe these use cases in more detail
  • Identify the actors by generalizing the concrete names – for example:
    • Field Officer (Bob and Alice in the Scenario)
    • Dispatcher (John in the Scenario)
  • … other details may be relevant (later)

33 of 49

Use Case Diagram for Incident Mgmt

Text questions to (562) 684-8307

ReportEmergency

FieldOfficer

Dispatcher

OpenIncident

AllocateResources

34 of 49

Today’s Lecture – How do we specify the use cases of the system?

  • Actors and Use Cases
  • Relationships
  • Scenarios
  • From Scenarios to Use Cases
  • Use Case Descriptions
  • EXAM #2 study guide

Text questions to (562) 684-8307

34

35 of 49

What is a Use Case Description?

  • A textual description of a set of actions defining interactions between an actor and the system to achieve a goal
  • Includes
    • Basic functionality/goal
    • Any precondition
    • Flow of events
    • Any postcondition
    • Any error condition and/or alternative flow
  • Does not include: specific UI interactions

Text questions to (562) 684-8307

36 of 49

Flows

  • Flow = a sequence of steps describing an interaction between a “user” and a “system”
  • A use case describes a set of flows that together accomplish a specific user “goal”

Text questions to (562) 684-8307

37 of 49

Types of Flows

  • Basic Flow: “Happy day” scenario
    • Required for every use case
  • Alternative Flow: The goal is achieved, but in an alternate way
    • Optional
  • Exception Flow: The goal is not achieved
    • Optional

A use case should capture all possible flows—successful and unsuccessful ones

38 of 49

Example Use Case Description: Buy a Product

  • Basic Flow
    1. Customer browses catalog and selects items to buy
    2. Customer goes to check out
    3. Customer fills in shipping information
    4. System presents full pricing information, including shipping
    5. Customer fills in credit card information
    6. System authorizes purchase
    7. System confirms sale immediately
    8. System sends confirmation email to customer
  • Alternative Flow

3a. Customer is regular (repeat) customer

1. System displays current shipping, pricing, and billing information

2. Customer may accept or override defaults, returns to BF at step 6

Text questions to (562) 684-8307

39 of 49

Example Use Case: Add Item Deadline

  • Basic Flow
    1. User selects list item to which they want to add a deadline
    2. System presents detailed view of list item (name, completed/not completed, description)
    3. User selects the deadline field
    4. System presents user with a way to enter a date and time
    5. User enters date and time for deadline
    6. System shows item with new deadline
  • Alternative Flow

5a. User wants to add deadline to calendar

      • After adding deadline, user selects an option to post to calendar
      • System posts deadline to calendar, displays a confirmation to user
      • Return to BF at step 6
  1. Exception Flow

5a. Date/time is invalid

      • System notifies user that date/time is invalid, deadline not added to item

Text questions to (562) 684-8307

40 of 49

How to Build a Use Case

  • Name use case
  • Describe Basic Flow
  • Add variations, if applicable
    • Alternative Flows
    • Exception Flows

Text questions to (562) 684-8307

41 of 49

Inf 113 Use Case Template

  • See Canvas: Files -> Templates

Text questions to (562) 684-8307

42 of 49

Purpose of Use Cases

  • To decide and describe the functional requirements of the system
  • To clearly and consistently communicate the requirements to a wide variety of stakeholders
  • To serve as a basis for further design modeling/development and traceability between requirements and actual classes and operations in the system
  • To provide a basis for performing system tests later on

Text questions to (562) 684-8307

43 of 49

Audience of Use Cases

  • Customer (and/or end user)
  • Developers
  • Testers
  • Anyone involved in activities connected to the functionality
    • Marketing
    • Sales
    • Support
    • Documenters

Text questions to (562) 684-8307

44 of 49

Summary – How do we specify the use cases of the system?

  • A use case model shows dynamic interaction between system and context from a user’s perspective
    • Consists of use case diagram(s) and use case descriptions
  • Use case actors represent external entities that react with the system
  • A use case is a set of actions defining interactions between an actor and the system to achieve a goal
  • Scenarios capture ”stories of use” with the system under development

Text questions to (562) 684-8307

44

45 of 49

Homework 5

Text questions to (562) 684-8307

45

46 of 49

Today’s Lecture – How do we specify the use cases of the system?

  • Actors and Use Cases
  • Relationships
  • Scenarios
  • From Scenarios to Use Cases
  • Use Case Descriptions
  • EXAM #2 study guide

Text questions to (562) 684-8307

46

47 of 49

EXAM 2 (1)

  • Covers weeks 5-6
  • Lecture 7:
    • When full-fledged requirements are needed
    • Glossary purpose and what it contains
    • When to use formal specification languages
    • When to use more/less detail in RE
    • Qualities to strive for, including which are most important
  • Lecture 8:
    • How to rewrite poorly-written requirements
    • How to correctly write user stories

47

48 of 49

EXAM 2 (2)

  • Lecture 9:
    • Process facets
    • Facet combinations
    • Typical process configurations
    • Processes in agile development
    • Characteristics of an “ideal” RE process
    • RE problems
  • Lecture 10:
    • Actors
    • Use cases
    • Relationships between actors and use cases
    • Purpose/use of scenarios
    • Different flows of use cases
  • Also: Review all canvas participation quizzes, kahoots, and homeworks

48

49 of 49

For Next Time

  • Complete Lecture 11 Pre-Work: Requirements Change

49