Software Requirements and Use Cases Reading: A. Cockburn
Software Requirements and Use Cases Reading: A. Cockburn
Software Requirements and Use Cases Reading: A. Cockburn
Reading:
Writing Effective Use Cases
A. Cockburn
These lecture slides are copyright (C) Marty Stepp, 2007, with significant content taken from slides
written by Valentin Razmov. They may not be rehosted, sold, or modified without expressed
permission from the author. All rights reserved.1
Software requirements
requirements: specify what to build
tell "what" and not "how"
tell the system design, not the software design
tell the problem, not the solution (in detail)
5
Classifying requirements
A classic way to classify requirements:
functional: map inputs to outputs
nonfunctional: other constraints
performance, dependability, reusability, safety
6
Functional requirements
Examples of functional requirements:
The user shall be able to search either all of the
initial set of databases or select a subset from it.
7
Non-functional requirements
Examples of non-functional requirements:
It shall be possible for all necessary communication
between the APSE and the user to be expressed in
the standard ASCII character set.
8
Use cases
use cases: written descriptions of user's interaction
with the software product to accomplish a goal
(in a business system): "A sequence of transactions in a
system whose task is to yield a result of measurable value to
an individual actor of the business system"
(in an information system): "A behaviorally related sequence
of transactions performed by an actor in a dialogue with the
system to provide some measurable value to the actor"
(Jacobson 1995)
9
Benefits of doing use cases
The list of goal names provides executives:
Shortest summary of what system will contribute
Project planning skeleton (priorities & timing)
summary goal
user goal
subfunction
13
Goals and levels, examples
What level are these goals at?
Withdraw money from an ATM
Purchase a book from the online store, and have it
shipped to the user; can be cancelled while in transit
Purchase shares of stock online using a "stock trap."
Update user's balance after a deposit.
Answers:
user goal, summary goal,
summary goal, subfunction
14
Qualities of a good use case
A good use case:
starts with a request from an actor to the system
ends with the production of all the answers to the
request
defines the interactions (between system and actors)
related to the function
takes into account the actor's point of view, not the
system's
focuses on interaction, not internal system activities
doesn't describe the GUI in detail
has 3-9 steps in the main success scenario
is easy to read
15
Use cases vs. internal features
consider software to run a cell phone:
16
Do use cases capture these?
Which of these requirements should be
represented directly in a use case?
Order cost = order item costs * 1.06 tax.
Promotions may not run longer than 6 months.
Customers only become Preferred after 1 year.
A customer has one and only one sales contact.
Response time is less than 2 seconds.
Uptime requirement is 99.8%.
Number of simultaneous users will be 200 max.
18
1. Actor / goal list
It can be useful to create a list or table of
actors and their "goals" (use cases they start):
open account
customer
20
Use case summary diagram
21
Use case summary diagram 2
Control System
Scan
Set limits
Liaison Physicist
Take profile
Experimental
Physicist
Calibrate
Hardware Specialist
22
Use case summary diagram 3
<<uses>>
Track sales
and inv. data
Produce
mgt. reports
23
2. Informal use case
informal use case: written as a paragraph
describing the scenario
Example:
Customer Loses a Tape
The customer reports to the clerk that he has lost a
tape. The clerk prints out the rental record and asks
customer to speak with the manager, who will
arrange for the customer to pay a fee. The system
will be updated to reflect lost tape, and customer's
record is updated as well. The manager may
authorize purchase of a replacement tape.
24
Formal use case example
25
Formal use case elements
(level of goal [summary, user, subfunction])
(goal of primary actor)
(primary actor)
"Place an order" (User goal / Clerk)
(action steps:
Main scenario: full sentences showing
who takes the action!
1. Clerk identifies customer, item and quantity. 3 - 9 steps long.)
2. System accepts and queues the order.
Extensions:
2a. User wants a web site PAF does not support:
2a1. System gets new suggestion from user, with option to cancel use case.
3a. ...
27
Use case tables
Formal use cases can also be written as a table:
USE CASE NAME Submit Promotion Order
ACTOR Club Member
DESCRIPTION Describes the process when a club member submits a club promotion
order to either indicate the products they are interested in ordering or
declining to order during this promotion
Normal Course 1. This use is initiated when the club member submits the promotion
order to be proceeded
2. The club member's personal information such as address is validated
against what is currently recorded in member services
3. The promotion order is verified to see if product is being ordered
4. The club member's credit status is checked with Accounts Receivable
to make sure no payments are outstanding
5. For each product being ordered, validate the product number
6. For each product being ordered, check the availability in inventory
and record the ordered information which includes "quantity being
ordered" and give each ordered product a status of "open"
7. Create a Picking Ticket for the promotion order containing all ordered
products which have a status "open"
8. Route the picking ticket to the warehouse
PRECONDITION Use case send club promotion has been processed
POST CONDITION Promotion order has been recorded and the picking ticket has been
routed to the warehouse
ASSUMPTIONS
28
One method to do use cases
Now that we know the syntax for doing use
cases, what 4 steps does Cockburn
recommend when actually brainstorming and
writing our use cases?
30
Identify actors/goals example
Exercise:
Together, let's identify some major actors and
their goals for software for a video store kiosk
system.
The software can be used for looking up movies and
actors by keywords, as well as usable to check out
movies from the kiosk to known customers, without
a cashier present.
A customer can check out up to 3 movies at a time,
for up to 5 days each.
If a movie is returned late, late fees can be paid at
the time of return or time of next checkout.
31
2. Write the success scenario
Main success scenario is the preferred "happy"
case
example: customer=good credit and item=in stock
easiest to read and understand
everything else is a complication on this
con:
they show only the functional reqs
35
User stories (usage narratives)
user story: narrative told from user's perspective, describing
his/her usage of the system
Example:
Bill is a marine biologist who wants to see an article about fish. He
selects "Article or journal" from the menu. He chooses topic "fish"
from the subsequent list shown. The system returns articles to Bill
about his chosen topic. The annotated list designates the physical
location of articles. Bill clicks articles of interest to him. Abstracts
of each flagged article are displayed. Bill makes a final selection of
articles based on abstracts. The abstracts are printed, and Bill
retrieves them from the printer.
36
How do use cases fit in?
"Hub and spokes" model puts use cases as central to all
requirements
Adolph's "Discovering" Requirements in New Territory
What do you think?
37
Use case exercises
Consider the case of a video store that wants a
kiosk with intelligent software that can replace
human checkout workers. A customer with an
account can simply use their membership and
credit card with a reader at the kiosk to check
out a video.
38