View
219
Download
0
Category
Preview:
Citation preview
7/26/2019 Use Case Overview
1/29
An Introduction to Use Cases
7/26/2019 Use Case Overview
2/29
Copyright 2002-2004 Serlio Software Development Corporation2
Outline
Why use cases?
What are actors and use cases?
How do we write use cases?
7/26/2019 Use Case Overview
3/29
Copyright 2002-2004 Serlio Software Development Corporation3
Unstable Requirements
Leading cause of runaway projects*
Most expensive errors to fix
Hardest errors to correct
User involvement is key
*Facts and Fallacies of Software Engineering, Robert L. Glass, 2003, Addison-Wesley
7/26/2019 Use Case Overview
4/29
Copyright 2002-2004 Serlio Software Development Corporation4
Software Project Success RateSource: Standish Group 1999
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
< $750k $750k -
$1.5M
$1.5M - $3M $3M - $6M $6M - $10M > $10M
Total Cost
7/26/2019 Use Case Overview
5/29
Copyright 2002-2004 Serlio Software Development Corporation5
Requirements Specifications
Easily misunderstood
Too large to comprehend
Hard to test for completeness
Provide no context
7/26/2019 Use Case Overview
6/29
Copyright 2002-2004 Serlio Software Development Corporation6
Why Use Cases?
The hard part: Build the rightthing
Describes behavior of the system
Easily understood by
Problem-oriented stakeholders
Solution-oriented stakeholders
Focus on actual system needs
7/26/2019 Use Case Overview
7/29
Copyright 2002-2004 Serlio Software Development Corporation7
Outline
Why use cases?
What are actors and use cases?
How do we write use cases?
7/26/2019 Use Case Overview
8/29
Copyright 2002-2004 Serlio Software Development Corporation8
What Is An Actor?
A role, not a person
Human or non-human Three essential traits
External to the system
Interactswith the systemTries to achieve a goal
Claims adjuster
7/26/2019 Use Case Overview
9/29
Copyright 2002-2004 Serlio Software Development Corporation9
Why Define Actors?
Establishes need for a requirement
Focus on how the system is used
Defines system boundaries
Determines completeness
Shows who knows requirements
7/26/2019 Use Case Overview
10/29
Copyright 2002-2004 Serlio Software Development Corporation 10
What Is a Use Case?
Describes one way to use thesystem
Essential traits:Centered around a goal
Describes stepsto achievethat goal
Written as a series of interactions
Yields a resultto the actor
7/26/2019 Use Case Overview
11/29
Copyright 2002-2004 Serlio Software Development Corporation 11
Use Case Simple Example
Name: Generate QuotePrimary Actor:Insurance QuoterBrief Description:Insurance Quoter creates an insurance quote for her automobile.
Primary Flow:The use case begins when Insurance Quoter asks the system fora quote. The system asks Insurance Quoter for her homeaddress. After Insurance Quoter gives her name and address, thesystem asks what vehicle they would like to insure. InsuranceQuoter identifies the vehicle to insure. The system then presents
a list of coverages and levels. Insurance Quoter selects herdesired coverage levels and asks for the quote. The systempresents the quote, including the premium for each coverage.
7/26/2019 Use Case Overview
12/29
Copyright 2002-2004 Serlio Software Development Corporation 12
Types of Requirements
Functional
Non-Functional
Usability Reliability
Portability
Supportability
+ (legal)
Terminology
The systemshould generate
insurance quotes. The system
should handle30,000 quote
requests perhour.
7/26/2019 Use Case Overview
13/29
Copyright 2002-2004 Serlio Software Development Corporation 13
Outline
Why use cases?
What are actors and use cases?
How do we write use cases?
7/26/2019 Use Case Overview
14/29
Copyright 2002-2004 Serlio Software Development Corporation 14
The Use Case Writing Process
1. Identify actors2. Identify use cases3. Prioritize use cases4. Write use case descriptions5. Review and revise6. Go to step 3
Capture non-functional requirements Capture terminology
7/26/2019 Use Case Overview
15/29
Copyright 2002-2004 Serlio Software Development Corporation 15
Identify Actors
Actor Name: Customer
Description:
A customer is an individual or business that currently has arelationship with the bank. For the purposes of the loanmanagement system, a customer is someone who holds anactive loan account or has been extended credit.
Goals:
Be informed of a payment due Make a loan payment
Check loan balance
7/26/2019 Use Case Overview
16/29
Copyright 2002-2004 Serlio Software Development Corporation 16
Identify Use Cases
A use case is an event
Not an information flow
Not a process flow
Use a short, verb-nouncombination
Describe theinteraction
Reflect the actors goal
Evaluate LoanApplication
Close Out Loan
Generate LateNotice
7/26/2019 Use Case Overview
17/29
Copyright 2002-2004 Serlio Software Development Corporation 17
Use Case Diagrams
Insurance Quoter
Generate Quote
Buy Coverage
Accounting System
7/26/2019 Use Case Overview
18/29
Copyright 2002-2004 Serlio Software Development Corporation 18
Formality Of Use Cases
Brief
PrimaryScenario
FullyDressed
7/26/2019 Use Case Overview
19/29
Copyright 2002-2004 Serlio Software Development Corporation 19
Detailing a Use Case
Name andBrief Summary
Primary Flow
(Interaction)
Alternate/Extension
Alternate/Extension
Alternate/ExtensionSupplementalInformation
PreconditionsSuccess guaranteeOther requirementsOpen issues
7/26/2019 Use Case Overview
20/29
Copyright 2002-2004 Serlio Software Development Corporation 20
Primary Flow
Cancel Order Use Case
Flow of Events
1. The use case begins when the customer rep asks
the system to cancel an order.2. The customer rep searches for the order by order ID.
3. The system presents the order.
4. The customer rep marks the order as cancelled.
5. The system cancels the order.
6. The system tells the accounting subsystem to creditthe customers account.
7/26/2019 Use Case Overview
21/29
Copyright 2002-2004 Serlio Software Development Corporation 21
Preconditions
Defines use case scopeand place
What has already happened?
Requiredstate of the system
Written in the present tense
7/26/2019 Use Case Overview
22/29
Copyright 2002-2004 Serlio Software Development Corporation 22
Precondition Examples
The broker is logged on.
The order status is
complete.
The quote is valid.
The divert location is in
service.
7/26/2019 Use Case Overview
23/29
Copyright 2002-2004 Serlio Software Development Corporation 23
Postcondition
A.K.A Success Guarantee
Requiredstate of the system
Written as an assertion, past tense
Describes the satisfied interests
7/26/2019 Use Case Overview
24/29
Copyright 2002-2004 Serlio Software Development Corporation 24
Postcondition Examples
The email was sent.
The file was saved.
The policy was cancelled.
The system credited the
customers account.
7/26/2019 Use Case Overview
25/29
Copyright 2002-2004 Serlio Software Development Corporation 25
Extensions
We know the main successscenario
The world doesnt work this way Software is no exception
We need a way to describe:
Failure conditionsAlternative/conditional steps in the
flow
7/26/2019 Use Case Overview
26/29
Copyright 2002-2004 Serlio Software Development Corporation 26
Extensions: Mechanics
Insertion point
Extension
condition
Alternate steps
7/26/2019 Use Case Overview
27/29
Copyright 2002-2004 Serlio Software Development Corporation 27
Extensions: Writing the Condition
Write as an assertion
That the system can detect
Identify the insertion point
Say what was detected
Replaces the insertion point step
7/26/2019 Use Case Overview
28/29
Copyright 2002-2004 Serlio Software Development Corporation 28
Extension Example
Pack Order:
5. The packing clerk scans the item and places it in the carton.
6. The system records that the item was packed and updates the
order.
Extensions:
*a. The order management system is unavailable.
1.
6a. The item does not belong on the order.1.
6b. The order was cancelled.
1.
6c. The item has been recalled.
7/26/2019 Use Case Overview
29/29
Copyright 2002-2004 Serlio Software Development Corporation 29
Summary
Why use cases?
What are actors and use cases?
How do we write use cases?
Recommended