SlideShare a Scribd company logo
1 of 23
CMSC 345, Version 9/07
S. Mitchell
Use Cases
Concepts, Specifications, and Diagrams
2
CMSC 345, Version 9/07
S. Mitchell
Introduction
 “Invented” by Ivar Jacobson in the late 1960’s
(where have we seen his name before?)
 Introduced to the OO community in the late
1980’s
 Alistair Cockburn has extended Jacobson’s
model
 Is a way to specify functional requirements
 Is notated using a use case specification
 Is not part of the Unified Modeling Language
(UML), but is many times used in conjunction
with it
3
CMSC 345, Version 9/07
S. Mitchell
What is a Use Case? (Cockburn)
 A use case captures a contract between the
stakeholders of a system about its behavior.
 Describes the system’s behavior under various
conditions as the system responds to a request from one
of the stakeholders called the primary actor.
1. The primary actor initiates some interaction with the system to
accomplish some goal.
2. The system responds, protecting the interests of all of the
stakeholders.
3. Different sequences of behaviors, or scenarios, can unfold,
depending on the requests and the conditions surrounding the
request. The use case gathers these scenarios together.
4
CMSC 345, Version 9/07
S. Mitchell
Use Case Specification: Natural Language Example
Use Case 1. Withdraw Money
The system displays the account types available to be
withdrawn from and the user indicates the desired type.
The system asks for the amount to be withdrawn and the
user specifies it. Next, the system debits the user’s
account and dispenses the money. The user removes
the money, the system prints a receipt, and the user
removes the receipt. Then the system displays a closing
message and dispenses the user’s ATM card. After the
user removes his card, the system displays the welcome
message.
5
CMSC 345, Version 9/07
S. Mitchell
Number
Name
Summary
Priority
Preconditions
Postconditions
Primary Actor(s)
Secondary Actor(s)
Trigger
Main Scenario Step Action
Extensions Step Branching Action
Open Issues
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
6
CMSC 345, Version 9/07
S. Mitchell
Number Unique use case number
Name Brief verb-noun phrase
Summary Brief summary of use case major actions
Priority 1-5 (1 = lowest priority, 5 = highest priority)
Preconditions
Postconditions
Primary Actor(s)
Secondary Actor(s)
Trigger
Main Scenario Step Action
Extensions Step Branching Action
Open Issues
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
7
CMSC 345, Version 9/07
S. Mitchell
Number
Name
Summary
Priority
Preconditions What needs to be true before the use case “executes”
Postconditions What will be true after the use case successfully “executes”
Primary Actor(s)
Secondary Actor(s)
Trigger
Main Scenario Step Action
Extensions Step Branching Action
Open Issues
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
Precondition: y != 0
Postcondition: x / y
double divide(double x, double y) {
return (x / y);
}
Precondition: None
Postcondition: if y==0 “Illegal”, else x / y
double divide(double x, double y) {
if (y == 0) cout << “Illegaln”;
else return (x / y);
}
8
CMSC 345, Version 9/07
S. Mitchell
Number
Name
Summary
Priority
Preconditions
Postconditions
Primary Actor(s) Primary actor name(s)
Secondary Actor(s) Secondary actor name(s)
Trigger
Main Scenario Step Action
Extensions Step Branching Action
Open Issues
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
Actor
• Anyone or anything with behavior
• May be a person or system
• Primary: The stakeholder who or
which initiates an interaction with the
system to achieve a goal. Is generally a
category of individuals (a role).
• Secondary: Provides a service to the
system. Is almost never a person.
9
CMSC 345, Version 9/07
S. Mitchell
Number
Name
Summary
Priority
Preconditions
Postconditions
Primary Actor(s)
Secondary Actor(s)
Trigger The action that caused the use case to be invoked
Main Scenario Step Action
Step # This is the “main success scenario” or “happy path”
Step # Description of steps in successful use case “execution”
Step # This should be in a “system-user-system, etc.” format
Extensions Step Branching Action
Open Issues
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
10
CMSC 345, Version 9/07
S. Mitchell
Number
Name
Summary
Priority
Preconditions
Postconditions
Primary Actor(s)
Secondary Actor(s)
Trigger
Main Scenario Step Action
Extensions Step Branching Action
Step # Alternative paths that the use case may take
Open Issues
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
Extension
• Could be an optional path(s)
• Could be an error path(s)
• Denoted in use case diagrams (UML)
by <<extend>>
11
CMSC 345, Version 9/07
S. Mitchell
Number
Name
Summary
Priority
Preconditions
Postconditions
Primary Actor(s)
Secondary Actor(s)
Trigger
Main Scenario Step Action
Extensions Step Branching Action
Open Issues Issue # Issues regarding the use case that need resolution
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
12
CMSC 345, Version 9/07
S. Mitchell
Number Unique use case number
Name Brief noun-verb phrase
Summary Brief summary of use case major actions
Priority 1-5 (1 = lowest priority, 5 = highest priority)
Preconditions What needs to be true before use case “executes”
Postconditions What will be true after the use case successfully “executes”
Primary Actor(s) Primary actor name(s)
Secondary Actor(s) Secondary actor name(s)
Trigger The action that causes this use case to begin
Main Scenario Step Action
Step # This is the “main success scenario” or “happy path.”
… Description of steps in successful use case “execution”
… This should be in a “system-user-system, etc.” format.
Extensions Step Branching Action
Step # Alternative paths that the use case may take
Open Issues Issue # Issues regarding the use case that need resolution
Use Case Specification Template*
*Adapted from A. Cockburn, “Basic Use Case Template”
13
CMSC 345, Version 9/07
S. Mitchell
Number 1
Name Withdraw Money
Summary User withdraws money from one of his/her accounts
Priority 5
Preconditions User has logged into ATM
Postconditions User has withdrawn money and received a receipt
Primary Actor(s) Bank Customer
Secondary Actor(s) Customer Accounts Database
Use Case Specification Template Example
Continued …
14
Trigger User has chosen to withdraw money
Main Scenario Step Action
1 System displays account types
2 User chooses account type
3 System asks for amount to withdraw
4 User enters amount
5 System debits user’s account and dispenses money
6 User removes money
7 System prints and dispenses receipt
8 User removes receipt
9 System displays closing message and dispenses user’s ATM card
11 User removes card
10 System displays welcome message
Extensions Step Branching Action
5a System notifies user that account funds are insufficient
5b System gives current account balance
5c System exits option
Open Issues 1 Should the system ask if the user wants to see the balance?
15
CMSC 345, Version 9/07
S. Mitchell
Specification Writing Guidelines
 No trace of design
 Describes what the use case will do, not
how it will do it (e.g., UI type is irrelevant)
 A dialogue between the user and the
system
 Complete, clear, and consistent
16
CMSC 345, Version 9/07
S. Mitchell
Use Case Diagrams
 A way of visualizing the relationships
between actors and use cases
among use cases
 “A graphical table of contents for the use
case set” (Fowler)
17
CMSC 345, Version 9/07
S. Mitchell
1
Withdraw
Money
2
Deposit
Money
3
Transfer
Money
4
Check
Balance
ATM System
Bank
Customer
Customer
Accounts
Database
primary actor
role
system name
system boundary
secondary actor
use case
<<Customer
Accounts
Database>>
alternative
actor notation
stereotype
association
18
CMSC 345, Version 9/07
S. Mitchell
Using Use Case Specifications
in Conjunction with Use Case Diagrams
 UML is a graphical modeling tool only.
 Use case specifications are not part of the
UML
 But, since each ellipse in a UML use case
diagram represents a functional
requirement, it may in turn have an
associated use case specification.
19
CMSC 345, Version 9/07
S. Mitchell
1
Withdraw
Money
2
Deposit
Money
3
Transfer
Money
4
Check
Balance
ATM System
Bank
Customer
Customer
Accounts
Database
Teller 5
View
Transaction
History
primary actor
Why can’t a Teller
do the things that a
Bank Customer can
do? Especially if he
is a customer?
He can. But he must
“step into” the role of
a Bank Customer.
20
CMSC 345, Version 9/07
S. Mitchell
1
Withdraw
Money
Bank
Customer
Customer
Accounts
Database
1b
Withdraw from
Savings
1a
Withdraw from
Checking
<<extend>>
<<extend>>
Sub-use Case Diagram
This is an extend dependency.
It indicates that use case 1b is part of
use case 1, but it may or may not be
invoked.
The same is true of use case 1a.
All dependencies are
extend unless
stereotyped otherwise.
note/comment
21
CMSC 345, Version 9/07
S. Mitchell
1
Withdraw
Money
Bank
Customer
Customer
Accounts
Database
1b
Withdraw from
Savings
1a
Withdraw from
Checking
Sub-use Case Diagram
generalization
22
CMSC 345, Version 9/07
S. Mitchell
3
Transfer
Money
Bank
Customer
Customer
Accounts
Database
3b
Update Account
Balances
3a
Select
Accounts
<<include>>
<<include>>
Sub-use Case Diagram
This is an include dependency.
It indicates that use case 3b is
“included” in use case 3 and will be
invoked.
The same is true of use case 3a.
23
CMSC 345, Version 9/07
S. Mitchell
References
 Cockburn, A., Writing Effective Use Cases. New York:
2001, Addison-Wesley.
 Cockburn, A., Resources for Writing Use Cases.
http://alistair.cockburn.us/index.php/Resources_for_writi
ng_use_cases, accessed 9/18/07.
 Cockburn, A., Basic Use Case Template. 1998, Humans
and Technology.
 Cockburn, Alistair, WWW home page,
http://alistair.cockburn.us/index.php/Main_Page
 Fowler, M., UML Distilled. 3rd ed. 2004, New York:
Addison Wesley.
 Fowler, M., WWW home page, http://martinfowler.com
 Jacobson, Ivar, WWW home page,
http://www.ivarjacobson.com/locales/ivars-corner.cfm

More Related Content

Similar to CMSC 345 Use Cases Guide

SELECT21.pptx
SELECT21.pptxSELECT21.pptx
SELECT21.pptxdevnasra1
 
Lecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptxLecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptxGracePeter10
 
27 pso business_requirements
27 pso business_requirements27 pso business_requirements
27 pso business_requirementsMarcelo Mesti
 
Sadcw 7e chapter05-done
Sadcw 7e chapter05-doneSadcw 7e chapter05-done
Sadcw 7e chapter05-doneLamineKaba6
 
ENGR 131 Elementary Computer ProgrammingTeam IN – Instructor
ENGR 131  Elementary Computer ProgrammingTeam IN – InstructorENGR 131  Elementary Computer ProgrammingTeam IN – Instructor
ENGR 131 Elementary Computer ProgrammingTeam IN – InstructorTanaMaeskm
 
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...saman zaker
 
OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptxanguraju1
 
Online property management system design document
Online property management system design documentOnline property management system design document
Online property management system design documentAbhilasha Lahigude
 
BoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docx
BoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docxBoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docx
BoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docxjasoninnes20
 
Software Requirements ElicitationRequirements specify a set of f.docx
Software Requirements ElicitationRequirements specify a set of f.docxSoftware Requirements ElicitationRequirements specify a set of f.docx
Software Requirements ElicitationRequirements specify a set of f.docxwhitneyleman54422
 
Use Cases A Comprehensive Look
Use Cases A Comprehensive LookUse Cases A Comprehensive Look
Use Cases A Comprehensive Looktelab
 

Similar to CMSC 345 Use Cases Guide (20)

SELECT21.pptx
SELECT21.pptxSELECT21.pptx
SELECT21.pptx
 
Lecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptxLecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptx
 
27 pso business_requirements
27 pso business_requirements27 pso business_requirements
27 pso business_requirements
 
Sadcw 7e chapter05-done
Sadcw 7e chapter05-doneSadcw 7e chapter05-done
Sadcw 7e chapter05-done
 
ENGR 131 Elementary Computer ProgrammingTeam IN – Instructor
ENGR 131  Elementary Computer ProgrammingTeam IN – InstructorENGR 131  Elementary Computer ProgrammingTeam IN – Instructor
ENGR 131 Elementary Computer ProgrammingTeam IN – Instructor
 
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
 
Use Case UML Diagram
Use Case UML DiagramUse Case UML Diagram
Use Case UML Diagram
 
Use Case
Use CaseUse Case
Use Case
 
OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptx
 
Online property management system design document
Online property management system design documentOnline property management system design document
Online property management system design document
 
3Requirements.ppt
3Requirements.ppt3Requirements.ppt
3Requirements.ppt
 
chapter_5_5.ppt
chapter_5_5.pptchapter_5_5.ppt
chapter_5_5.ppt
 
Week 5
Week 5Week 5
Week 5
 
BoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docx
BoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docxBoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docx
BoardSprintUser Story ScenarioDesignDevelopmentTestUAT Release1U .docx
 
Software Requirements ElicitationRequirements specify a set of f.docx
Software Requirements ElicitationRequirements specify a set of f.docxSoftware Requirements ElicitationRequirements specify a set of f.docx
Software Requirements ElicitationRequirements specify a set of f.docx
 
Use Cases A Comprehensive Look
Use Cases A Comprehensive LookUse Cases A Comprehensive Look
Use Cases A Comprehensive Look
 
Uml doc
Uml docUml doc
Uml doc
 
Atm Simulator
Atm SimulatorAtm Simulator
Atm Simulator
 
Atm Simulator
Atm SimulatorAtm Simulator
Atm Simulator
 
SADCW_7e_Chapter03.pptx
SADCW_7e_Chapter03.pptxSADCW_7e_Chapter03.pptx
SADCW_7e_Chapter03.pptx
 

More from ssuser4d4e5a

USAID_NetHope_ePayment_Toolkit_2016.pdf
USAID_NetHope_ePayment_Toolkit_2016.pdfUSAID_NetHope_ePayment_Toolkit_2016.pdf
USAID_NetHope_ePayment_Toolkit_2016.pdfssuser4d4e5a
 
student-problem-solutions.pdf
student-problem-solutions.pdfstudent-problem-solutions.pdf
student-problem-solutions.pdfssuser4d4e5a
 
software-engineering-project-management.pdf
software-engineering-project-management.pdfsoftware-engineering-project-management.pdf
software-engineering-project-management.pdfssuser4d4e5a
 
software_engineering_proyect.pdf
software_engineering_proyect.pdfsoftware_engineering_proyect.pdf
software_engineering_proyect.pdfssuser4d4e5a
 
8-steganography.ppt
8-steganography.ppt8-steganography.ppt
8-steganography.pptssuser4d4e5a
 
Economic_Role_of_MFI_26062013.pdf
Economic_Role_of_MFI_26062013.pdfEconomic_Role_of_MFI_26062013.pdf
Economic_Role_of_MFI_26062013.pdfssuser4d4e5a
 

More from ssuser4d4e5a (8)

USAID_NetHope_ePayment_Toolkit_2016.pdf
USAID_NetHope_ePayment_Toolkit_2016.pdfUSAID_NetHope_ePayment_Toolkit_2016.pdf
USAID_NetHope_ePayment_Toolkit_2016.pdf
 
student-problem-solutions.pdf
student-problem-solutions.pdfstudent-problem-solutions.pdf
student-problem-solutions.pdf
 
software-engineering-project-management.pdf
software-engineering-project-management.pdfsoftware-engineering-project-management.pdf
software-engineering-project-management.pdf
 
software_engineering_proyect.pdf
software_engineering_proyect.pdfsoftware_engineering_proyect.pdf
software_engineering_proyect.pdf
 
8-steganography.ppt
8-steganography.ppt8-steganography.ppt
8-steganography.ppt
 
Economic_Role_of_MFI_26062013.pdf
Economic_Role_of_MFI_26062013.pdfEconomic_Role_of_MFI_26062013.pdf
Economic_Role_of_MFI_26062013.pdf
 
EPSOITS.pdf
EPSOITS.pdfEPSOITS.pdf
EPSOITS.pdf
 
Chap 2_ans.pdf
Chap 2_ans.pdfChap 2_ans.pdf
Chap 2_ans.pdf
 

Recently uploaded

chapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendschapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendslemlemtesfaye192
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...yordanosyohannes2
 
Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfMichael Silva
 
(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)twfkn8xj
 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyTyöeläkeyhtiö Elo
 
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办fqiuho152
 
government_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfgovernment_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfshaunmashale756
 
Quantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector CompaniesQuantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector Companiesprashantbhati354
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojnaDharmendra Kumar
 
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...Amil Baba Dawood bangali
 
Current Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptxCurrent Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptxuzma244191
 
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...Amil Baba Dawood bangali
 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...Amil baba
 
212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technologyz xss
 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithAdamYassin2
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...Amil baba
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economiccinemoviesu
 
Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024Bladex
 

Recently uploaded (20)

Monthly Economic Monitoring of Ukraine No 231, April 2024
Monthly Economic Monitoring of Ukraine No 231, April 2024Monthly Economic Monitoring of Ukraine No 231, April 2024
Monthly Economic Monitoring of Ukraine No 231, April 2024
 
chapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendschapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trends
 
🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
 
Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdf
 
(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)
 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
 
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
 
government_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfgovernment_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdf
 
Quantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector CompaniesQuantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector Companies
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojna
 
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
 
Current Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptxCurrent Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptx
 
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
 
212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology
 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam Smith
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economic
 
Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024
 

CMSC 345 Use Cases Guide

  • 1. CMSC 345, Version 9/07 S. Mitchell Use Cases Concepts, Specifications, and Diagrams
  • 2. 2 CMSC 345, Version 9/07 S. Mitchell Introduction  “Invented” by Ivar Jacobson in the late 1960’s (where have we seen his name before?)  Introduced to the OO community in the late 1980’s  Alistair Cockburn has extended Jacobson’s model  Is a way to specify functional requirements  Is notated using a use case specification  Is not part of the Unified Modeling Language (UML), but is many times used in conjunction with it
  • 3. 3 CMSC 345, Version 9/07 S. Mitchell What is a Use Case? (Cockburn)  A use case captures a contract between the stakeholders of a system about its behavior.  Describes the system’s behavior under various conditions as the system responds to a request from one of the stakeholders called the primary actor. 1. The primary actor initiates some interaction with the system to accomplish some goal. 2. The system responds, protecting the interests of all of the stakeholders. 3. Different sequences of behaviors, or scenarios, can unfold, depending on the requests and the conditions surrounding the request. The use case gathers these scenarios together.
  • 4. 4 CMSC 345, Version 9/07 S. Mitchell Use Case Specification: Natural Language Example Use Case 1. Withdraw Money The system displays the account types available to be withdrawn from and the user indicates the desired type. The system asks for the amount to be withdrawn and the user specifies it. Next, the system debits the user’s account and dispenses the money. The user removes the money, the system prints a receipt, and the user removes the receipt. Then the system displays a closing message and dispenses the user’s ATM card. After the user removes his card, the system displays the welcome message.
  • 5. 5 CMSC 345, Version 9/07 S. Mitchell Number Name Summary Priority Preconditions Postconditions Primary Actor(s) Secondary Actor(s) Trigger Main Scenario Step Action Extensions Step Branching Action Open Issues Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template”
  • 6. 6 CMSC 345, Version 9/07 S. Mitchell Number Unique use case number Name Brief verb-noun phrase Summary Brief summary of use case major actions Priority 1-5 (1 = lowest priority, 5 = highest priority) Preconditions Postconditions Primary Actor(s) Secondary Actor(s) Trigger Main Scenario Step Action Extensions Step Branching Action Open Issues Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template”
  • 7. 7 CMSC 345, Version 9/07 S. Mitchell Number Name Summary Priority Preconditions What needs to be true before the use case “executes” Postconditions What will be true after the use case successfully “executes” Primary Actor(s) Secondary Actor(s) Trigger Main Scenario Step Action Extensions Step Branching Action Open Issues Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template” Precondition: y != 0 Postcondition: x / y double divide(double x, double y) { return (x / y); } Precondition: None Postcondition: if y==0 “Illegal”, else x / y double divide(double x, double y) { if (y == 0) cout << “Illegaln”; else return (x / y); }
  • 8. 8 CMSC 345, Version 9/07 S. Mitchell Number Name Summary Priority Preconditions Postconditions Primary Actor(s) Primary actor name(s) Secondary Actor(s) Secondary actor name(s) Trigger Main Scenario Step Action Extensions Step Branching Action Open Issues Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template” Actor • Anyone or anything with behavior • May be a person or system • Primary: The stakeholder who or which initiates an interaction with the system to achieve a goal. Is generally a category of individuals (a role). • Secondary: Provides a service to the system. Is almost never a person.
  • 9. 9 CMSC 345, Version 9/07 S. Mitchell Number Name Summary Priority Preconditions Postconditions Primary Actor(s) Secondary Actor(s) Trigger The action that caused the use case to be invoked Main Scenario Step Action Step # This is the “main success scenario” or “happy path” Step # Description of steps in successful use case “execution” Step # This should be in a “system-user-system, etc.” format Extensions Step Branching Action Open Issues Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template”
  • 10. 10 CMSC 345, Version 9/07 S. Mitchell Number Name Summary Priority Preconditions Postconditions Primary Actor(s) Secondary Actor(s) Trigger Main Scenario Step Action Extensions Step Branching Action Step # Alternative paths that the use case may take Open Issues Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template” Extension • Could be an optional path(s) • Could be an error path(s) • Denoted in use case diagrams (UML) by <<extend>>
  • 11. 11 CMSC 345, Version 9/07 S. Mitchell Number Name Summary Priority Preconditions Postconditions Primary Actor(s) Secondary Actor(s) Trigger Main Scenario Step Action Extensions Step Branching Action Open Issues Issue # Issues regarding the use case that need resolution Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template”
  • 12. 12 CMSC 345, Version 9/07 S. Mitchell Number Unique use case number Name Brief noun-verb phrase Summary Brief summary of use case major actions Priority 1-5 (1 = lowest priority, 5 = highest priority) Preconditions What needs to be true before use case “executes” Postconditions What will be true after the use case successfully “executes” Primary Actor(s) Primary actor name(s) Secondary Actor(s) Secondary actor name(s) Trigger The action that causes this use case to begin Main Scenario Step Action Step # This is the “main success scenario” or “happy path.” … Description of steps in successful use case “execution” … This should be in a “system-user-system, etc.” format. Extensions Step Branching Action Step # Alternative paths that the use case may take Open Issues Issue # Issues regarding the use case that need resolution Use Case Specification Template* *Adapted from A. Cockburn, “Basic Use Case Template”
  • 13. 13 CMSC 345, Version 9/07 S. Mitchell Number 1 Name Withdraw Money Summary User withdraws money from one of his/her accounts Priority 5 Preconditions User has logged into ATM Postconditions User has withdrawn money and received a receipt Primary Actor(s) Bank Customer Secondary Actor(s) Customer Accounts Database Use Case Specification Template Example Continued …
  • 14. 14 Trigger User has chosen to withdraw money Main Scenario Step Action 1 System displays account types 2 User chooses account type 3 System asks for amount to withdraw 4 User enters amount 5 System debits user’s account and dispenses money 6 User removes money 7 System prints and dispenses receipt 8 User removes receipt 9 System displays closing message and dispenses user’s ATM card 11 User removes card 10 System displays welcome message Extensions Step Branching Action 5a System notifies user that account funds are insufficient 5b System gives current account balance 5c System exits option Open Issues 1 Should the system ask if the user wants to see the balance?
  • 15. 15 CMSC 345, Version 9/07 S. Mitchell Specification Writing Guidelines  No trace of design  Describes what the use case will do, not how it will do it (e.g., UI type is irrelevant)  A dialogue between the user and the system  Complete, clear, and consistent
  • 16. 16 CMSC 345, Version 9/07 S. Mitchell Use Case Diagrams  A way of visualizing the relationships between actors and use cases among use cases  “A graphical table of contents for the use case set” (Fowler)
  • 17. 17 CMSC 345, Version 9/07 S. Mitchell 1 Withdraw Money 2 Deposit Money 3 Transfer Money 4 Check Balance ATM System Bank Customer Customer Accounts Database primary actor role system name system boundary secondary actor use case <<Customer Accounts Database>> alternative actor notation stereotype association
  • 18. 18 CMSC 345, Version 9/07 S. Mitchell Using Use Case Specifications in Conjunction with Use Case Diagrams  UML is a graphical modeling tool only.  Use case specifications are not part of the UML  But, since each ellipse in a UML use case diagram represents a functional requirement, it may in turn have an associated use case specification.
  • 19. 19 CMSC 345, Version 9/07 S. Mitchell 1 Withdraw Money 2 Deposit Money 3 Transfer Money 4 Check Balance ATM System Bank Customer Customer Accounts Database Teller 5 View Transaction History primary actor Why can’t a Teller do the things that a Bank Customer can do? Especially if he is a customer? He can. But he must “step into” the role of a Bank Customer.
  • 20. 20 CMSC 345, Version 9/07 S. Mitchell 1 Withdraw Money Bank Customer Customer Accounts Database 1b Withdraw from Savings 1a Withdraw from Checking <<extend>> <<extend>> Sub-use Case Diagram This is an extend dependency. It indicates that use case 1b is part of use case 1, but it may or may not be invoked. The same is true of use case 1a. All dependencies are extend unless stereotyped otherwise. note/comment
  • 21. 21 CMSC 345, Version 9/07 S. Mitchell 1 Withdraw Money Bank Customer Customer Accounts Database 1b Withdraw from Savings 1a Withdraw from Checking Sub-use Case Diagram generalization
  • 22. 22 CMSC 345, Version 9/07 S. Mitchell 3 Transfer Money Bank Customer Customer Accounts Database 3b Update Account Balances 3a Select Accounts <<include>> <<include>> Sub-use Case Diagram This is an include dependency. It indicates that use case 3b is “included” in use case 3 and will be invoked. The same is true of use case 3a.
  • 23. 23 CMSC 345, Version 9/07 S. Mitchell References  Cockburn, A., Writing Effective Use Cases. New York: 2001, Addison-Wesley.  Cockburn, A., Resources for Writing Use Cases. http://alistair.cockburn.us/index.php/Resources_for_writi ng_use_cases, accessed 9/18/07.  Cockburn, A., Basic Use Case Template. 1998, Humans and Technology.  Cockburn, Alistair, WWW home page, http://alistair.cockburn.us/index.php/Main_Page  Fowler, M., UML Distilled. 3rd ed. 2004, New York: Addison Wesley.  Fowler, M., WWW home page, http://martinfowler.com  Jacobson, Ivar, WWW home page, http://www.ivarjacobson.com/locales/ivars-corner.cfm