0% found this document useful (0 votes)
5 views

SRE-Week-07-UseCase-05052023-114545pm

The document provides an overview of the use case technique in software requirements analysis, highlighting its definition, benefits, and appropriate applications. It discusses the importance of user-centric and task-centric approaches, as well as the elements and structure of use cases, including scenarios and user classes. Additionally, it outlines the relationship between use cases and functional requirements, providing examples and templates for effective use case documentation.

Uploaded by

Meesum Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

SRE-Week-07-UseCase-05052023-114545pm

The document provides an overview of the use case technique in software requirements analysis, highlighting its definition, benefits, and appropriate applications. It discusses the importance of user-centric and task-centric approaches, as well as the elements and structure of use cases, including scenarios and user classes. Additionally, it outlines the relationship between use cases and functional requirements, providing examples and templates for effective use case documentation.

Uploaded by

Meesum Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

The Use Case Technique:

An Overview

Sponsored by:

Karl Wiegers
Principal Consultant, Process Impact
www.processimpact.com
Source Books
◆ Software Requirements,2nd Ed., by Karl E. Wiegers
(Microsoft Press, 2003)

◆ More about Software Requirements, by


Karl E. Wiegers (Microsoft Press, 2006)

◆ Use Cases: Requirements in Context, 2nd Ed., by Daryl


Kulak and Eamonn Guiney (Addison-Wesley, 2003)

Sponsored By
Agenda

◆ Use cases defined


◆ Benefits of the use case approach
◆ User classes and actors
◆ Scenarios and use cases
◆ Use case elicitation workshops
◆ Elements of a use case
◆ Use cases and functional requirements

Sponsored By
Three Levels of Software Requirements
Business
Requirements

Vision and
Scope
Document
Business
Rules
User
Requirements
Quality
Attributes

Use Case Document


Functional External
Requirements InterfacesConstraints

Software Requirements Specification 6

Sponsored By
Eliciting Requirements Through Use Cases
◆ Use cases came from object-oriented world, apply to general
requirements analysis.
◆ Provides a method to capture user requirements.
◆ Focus on actual, but abstracted, usage scenarios.
◆ Ask users:
“Describe a goal you wish to accomplish with the system.”
not:
“What do you want the system to do?”
◆ Explore sequences of ‘actor’ actions and system responses.
◆ Derive functional requirements and tests from use cases.

Sponsored By
What Use Cases Are and Are Not
◆ Definition:
A description of a set of interaction sequences that
a system performs to provide a result of observable
or measurable value to one or more actors.
◆ Use cases describe:
✓ user goals
✓ the user’s view of the system
✓ a set of task-related activities
◆ Use cases do not describe:
✓ user interface designs
✓ technology solutions
✓ application architecture

Sponsored By
Benefits from the Use Case Approach
◆ User-centric: user’s terminology is applied
◆ Task-centric: reveals requirements to get
work done
◆ Helps analysts understand application
domain
◆ Helps avoid building unnecessary
functionality
◆ Permits early drafting of functional tests
◆ Helps set implementation priorities on functional
requirements

Sponsored By
Appropriate Use Case Applications
◆ Use cases work well for:
✓ end-user applications
✓ web sites
✓ devices with which users must interact

◆ Use cases aren’t as valuable for:


✓ batch processes
✓ event-driven real-time systems

10

Sponsored By
Examples of Use Cases
◆ QuickBooks “activities”:
✓ Write a Check ✓ Create an Invoice
✓ Enter Credit Card Charge ✓ Receive Payment
◆ Amazon.com options for an accepted order:
✓ Check Order Status ✓ Change Shipping Options
✓ Cancel Unshipped Items ✓ Track Package
◆ Buy a product online:
✓ Search Catalog
✓ Place Item in Shopping Cart
✓ Pay for Items in Shopping Cart

11

Sponsored By
Naming Use Cases
◆ Name properties:
✓ reflect the actor’s goal from the actor’s perspective
✓ describe a valuable transaction Hi! My
name is:
✓ be general enough to cover related scenarios
◆ Form: active verb + object
✓ “Generate Usage Report,” not “Usage Report Generation”
✓ use strong verbs and specific nouns

Good Examples: Not So Good Examples:


Reserve Rental Car Enter PIN
Print Invoice Submit Form 37
Check Flight Status Process Deposit

12

Sponsored By
User Classes and Actors
◆ User Classes: Distinct communities of users for the product.
◆ Actors: Entities outside the system that interact with it for
the purpose of completing an event.

User Classes Actors


Account Owner
Bank Customer Loan Applicant
Depositor
Chemist
Technician Chemical
Stockroom Staff Requeste
Lab Manager r

13

Sponsored By
Scenarios and Use Cases - 1
◆ A scenario is:
✓ one specific path through a use case, or
✓ a story about a specific instance of a use case execution,
perhaps with actual users identified and specific data
◆ Each use case typically includes multiple
scenarios.
✓ could be successful or could be failure modes

14

Sponsored By
Scenarios and Use Cases - 2
More
Abstract
Prepare a mailing label

Prepare a mailing label to


send a package by second-
day UPS.

Chris wants to send a 2.5-pound package by


Less second-day UPS from Portland, OR, to Rochester,
Abstract NY. She wants it insured for $75 and she wants a
return receipt. The package is marked fragile.
15

Sponsored By
Example Use-Case Diagram

A standard form of use case diagram is defined in the Unified Modeling


Language.
UML Notation for Use Case Modeling
UML Notation for Use Case Modeling
Actor/ Use Case Generalization
Used when you find 2 or more use cases that have
commonalities in behavior, structure and purpose.

A parent use case may be specialized into 1 or more


child use cases that represent more specific form of
the parent.

For example, suppose the ATM system can be


used to pay bills. Pay bills has two child use
cases: Pay Credit Card Bill and Pay Utility Bill
Actor/ Use Case Generalization
Include Relationship
Used when 2 or more use cases share some common
portion in a flow of events.

The common portion is grouped and extracted to form


an inclusion use case to be shared among the use
cases related

For example, in the ATM system example, such as


Withdraw Money, Deposit Money or Check Balance, all
share the inclusion use case Login Account
Include Relationship
Exclude Relationship
Extend relationship is used when 2 use cases are
similar, but one does a bit more than the other

The extension use case adds extra behavior to the


base use case

For example, Withdraw Money has an optional


behavior which handles withdrawal of an excess
amount
Exclude Relationship
Use Case Template
Use Case ID:
Use Case Name:
Created By: Last Updated By:
Date Created: Date Last Updated:
Actors:
Description:
Trigger:
Preconditions:
Postconditions:
Normal Flow:
Alternative Flows:
Exceptions:
Includes:
Priority:
Frequency of Use:
Business Rules:
Special
Requirements:
Assumptions:
Notes and Issues: 18

Sponsored By
Sample Use Case for an ATM - 1
Name: Withdraw Cash
Actor: Account
Owner Description:
The user withdraws
a specific amount of
cash from a
specified account.
Trigger: Account
Owner selects
Withdrawal action.
Preconditions:
1. The Account
Owner is logged
in to the ATM.
2. The Account
Owner has at 19
least one account
Sponsored By
with a positive
balance.
Sample Use Case for an ATM - 2

Normal Flow:
1. System displays user’s accounts.
2. Account Owner selects desired account.
3. System asks user to choose amount to withdraw
from a list.
4. Account Owner chooses amount to withdraw.
5. System dispenses cash.
6. Account Owner removes cash from dispenser.

20

Sponsored By
Sample Use Case for an ATM - 3
Alternative Flows:
✓ at step 3, actor can choose to enter a custom amount
✓ describe where the branch takes place, what
happens, and where the alternative flow rejoins the
main flow
Exceptions:
✓ amount is not a multiple of $20
✓ amount exceeds daily withdrawal limit
✓ amount exceeds account balance
✓ amount exceeds cash available in ATM
✓ indicate the step number where the exception
could take place and how the system handles
it 21

Sponsored By
Use Cases and Functional Requirements - 1
◆ Two schools of thought:
✓ Use cases are the functional requirements.
✓ Use cases reveal the functional requirements.

User View Developer


View

Use Cases Functional


Requirements
22

Sponsored By
Use Cases and Functional Requirements - 2
◆ Precondition
✓ “The system shall verify that the account is set up for
ATM withdrawals.”
◆ Steps in Flow
✓ “The system shall display a list of standard withdrawal
amounts. The user shall select one of these amounts or
‘Other’.”
◆ Postcondition
✓ “The system shall reduce the total cash remaining in the ATM
by the amount of the withdrawal.”
◆ Business Rule
✓ “The system shall print the available balance on the
receipt, unless the account is a business account.”
23
Sponsored By
Example – Use Case Description- Fully Dressed
Use Case: Enroll on a course
Write a fully dressed use case description of the above
use case
Example use case diagram

30
Example use case diagram 2
Control System

Scan

Set limits
Liason Physicist

Take profile
Experimental
Physicist

Calibrate

Hardware Specialist
31
Example use case diagram 3

Customer Order Food


Service Person

Applicant Hire Employee

<<uses>> Reorder Manager


Supplier supplies

<<uses>>
Track sales
and inv. data
Produce
mgt. reports

32
Q&A

27

Sponsored By

You might also like