Escolar Documentos
Profissional Documentos
Cultura Documentos
Spring 2005
Outline
Introduction
Use Case Diagrams
Writing Use Cases
Guidelines for Effective Use Cases
Actions
Outcome
Initiation
Business
documents
Requirements
Organized
documentation
Specification
Formal
specification
Design
Formal
Specification
Implementation documentation
Testable system
Testing &
Integration
Testing results,
Working sys
Maintenance
System
versions
Source of Requirements
Initial requirements come from the customer, by:
Documents, such as RFI/RFP
Meetings, reports
Design:
How the system
should do it
More detailed
Types of Requirements
Visible Functional Requirements
The system will deliver cash to the
customer
Cash will be delivered after card
was taken out
Qualitative Requirements
The authorization process will take
no more than 1 sec
The user interface will be easy to
use
Functional
Visible
Requirements
Hidden
Functional
Requirements
Qualitative
Requirements
Hidden Requirements
Database maintenance processes
will occur every night
Introduction | Diagrams | Writing | Guidelines
Use Cases
Register User
admin
Use case in diagram
Completeness
They should cater for all current demands of the system.
Consistency
Requirements should not conflict with each other. If there
are, tradeoffs must be detected and discussed.
Avoid design
Requirements should raise a need, not answer it. (Why?)
Customers
Designers
Users
10
Outline
Introduction
Use Case Diagrams
Writing Use Cases
Guidelines for Effective Use Cases
11
A Simple Example
Handle Message
Cellular Phone
Handle Call
External Phone
Company
Bill Management
Customer
System
boundary
Association
Use Case
Actors
Example
12
Finding Actors
External objects that produce/consume data:
Must serve as sources and destinations for data
Must be external to the system
Humans
Organizational Units
Introduction | Diagrams | Writing | Guidelines
Database
Printer
13
Perform Sale
Register Client
Sales Person
Perform
Business Sale
Institutional
Sales Person
Cancel Sale
Sales Manager
Example
14
Linking Use-Cases
Linking enables flexibility in requirements
specification
Isolating functionality
Enabling functionality sharing
Breaking functionality into manageable chunks
15
Use-Case Levels
Base Use Case:
Used directly by
the user
Perform
Sale
User goals
Sub-functionality
Choose
Products
Fill-in
billing info
16
Perform
Sale
<<include>>
Fill-in billing
info
Example
17
<<extend>>
Product is a gift
Perform Sale
After checkout
Gift wrap
Products
Example
18
Example: Amazon
Shopping Cart
Product Page
Review Writing
Introduction | Diagrams | Writing | Guidelines
19
Example contd
Rank
Supplier
extend
Search
Product
include
View
Product
Details
After
page
generation
Navigate
Deals
include
extend
extend
Write
Revie
w
Add to
cart
Customer
Checkou
t
include
extend
user is not
a member
Login
Handle Order
Status
Register
include
20
Handle Call
Handle Technical
Assistance Call
Tech Assistant
Representative
Example
21
Generalization Hazards
Combining generalizations of actors and usecases can be dangerous
Submit and Get
Grade
Submit Exam
Undergrad Student
Undergrad Student
Submit Exam
Submit Thesis
Graduate Student
Submit Thesis
Graduate Student
thesis
22
23
External Phone
Company
Handle Cell
Migration
<<include>>
Handle SMS
Message
<<include>>
Handle Call
while talking
Cellular Phone
Handle Voice
Call
Handle Video
Call
<<extend>>
<<extend>> {phone initiate call}
{incoming call}
Handle Multiple
Calls
Handle
Conference Call
3G Phone
24
Outline
Introduction
Use Case Diagrams
Writing Use Cases
Guidelines for Effective Use Cases
25
Post conditions
Success Scenario
Alternatives flows
Alistair Cockburn
Writing Effective
Use Cases
26
Triggers
What starts the use-case?
Examples:
Customer reports a claim
Customer inserts card
System clock is 10:00
27
Preconditions
What the system needs to be true before running
the use-case.
Examples
User account exists
User has enough money in her account
There is enough disk space
28
Post-Conditions
A post-condition is the outcome of the use-case.
Examples
Money was transferred to the user account
User is logged in
The file is saved to the hard-disk
Minimal guarantee
The minimal things a system can promise, holding even when
the use case execution ended in failure
Examples: Money is not transferred unless authorization is
granted by the user
Success guarantee
What happens after a successful conclusion of the use-case.
Examples: The file is saved; Money is transferred
29
Success Scenario
The success scenario is the main story-line of the
use-case
It is written under the assumption that everything is
okay, no errors or problems occur, and it leads
directly to the desired outcome of the use-case
It is composed of a sequence of action steps
Example:
Interaction
step
1.
2.
3.
Validation
System validates course code
Step
System adds the course to the db and shows a confirmation message
Internal Change
Step
(plus) Interaction
Step
30
System
Actor
31
Steps contd
Branches:
If the user has more than 10000$ in her account, the system
presents a list of commercials
Otherwise
Repeats:
1.
2.
3.
4.
5.
32
Complex diagram
No system
No actor
Too many user interface details
User types ID and password, clicks OK or hits Enter
33
Alternative Flows
Used to describe
exceptional
functionality
Examples:
Errors
Unusual or rare
cases
Failures
Starting points
Endpoints
Shortcuts
Starting points
Exceptions
Success Shortcuts
Scenario
Endpoints
34
Endpoints
The system detects no more open issues
Shortcuts:
The user can leave the use-case by clicking on the esc key
35
Writing Include
36
Writing Extend
Scenarios do not include direct references
Instead, they include extension points, such as:
User enters search string
System presents search results
Extension point: results presentations
OR
<extension point: results presentations>
37
Outline
Introduction
Use Case Diagrams
Writing Use Cases
Guidelines for Effective Use Cases
38
How to Model?
Bottom-up Process
Starting with throwing all
scenarios on the page, and
then combining them:
save
print
load
Bullets
format
Save
as
preview
Paragraph
format
Font
forma
t
Top-down Process
Starting with an overview of
the system, and then splitting
Use-cases
File
action
s
Formattin
g actions
Viewing
Actions
39
Combined
40
Combining Processes
Number Limit:
The diagram should have between 3 to 10 base use-case. No
more than 15 use cases (base + included + extending).
Abstraction:
All use-cases should be in similar abstraction levels.
Size:
Use cases should be described in half a page or more.
Interaction:
Use-cases which are carried out as part of the same interaction.
UC
UC
UC
41
Dividing Processes
Size:
If a use-cases takes more than a page, consider
include/extend
Weak dependency:
If the dependency between two parts of a use-case is weak,
they should be divided.
UC
42
More Guidelines
Factor out common usages that are required by
multiple use cases
If the usage is required use <<include>>
If the base use case is complete and the usage may be
optional, consider use <<extend>>
43
Scope
A good way to decide on the scope is by in/out lists:
Topic
In
Out
Backup of logs
44
Use Cases
Requirements
Introduction | Diagrams | Writing | Guidelines
45
Moving on
Data entering and exiting the system is represented
by data entities in structural diagrams.
Behavior induced by use cases can be captured in
behavioral diagrams.
Use Case 1
Class A
Class C
Use Case 3
Use Case 2
Class D
Class B
46
Summary
Introduction
to the Unified Modeling Language (UML)
To Use Case Diagram
47