Title: Use Case Diagrams
1 Use Case Diagrams
2Agenda
- Use Case Principles
- Use Case Notation
- Use Case Elaboration
- Lab 3 Use Case Example
- www.usecases.org
3Use Case Principles
- Describes required functionality in terms of the
user system - Identifies external actors
- Identifies system boundary
- Describes scenarios of use (Stories of how system
meets user goals) - Describes pre/post conditions
- Describes variants/exceptions
- Two Parts The picture, the description
- Black box style descriptions What not how
4Use Case Notation (Basic)
System Boundary (often implied)
Use Case
Participates-In Association
5Use Case (Basic) Example
Credit Card System
Perform Card Transaction
Process Customer Bill
Manage Account
6Remember
- Use Case description in format verb direct
object - Use Cases are in multiple levels
- Context Level shows most general
- Limit context level use cases to what you would
put on functionality slide - In language of user
- Actor names represent the role they perform in
the use case.
7Use Cases (Advanced)
Specialized Use Case
General Use Case
8Use Case (Advanced) Example
9Use Case Descriptions (Fully Dressed)
- Primary Actor
- Stakeholders and Interests/Goals
- Preconditions
- Postconditions
- Main Success Scenario
- Extensions / Exceptions
- Special Requirements
- Technology and Data Variations List
- Frequency of Occurrence
- Open Issues
Text, page 68
10Use Case Descriptions
USE CASE UC1 Process Sale Primary Actor
Cashier Stakeholders and Interests - Cashier
Wants accurate, fast entry, no payment errors -
Salesperson Wants commissions updated -
Customer Wants purchase and fast service. Wants
proof Preconditions Cashier is identified and
authenticated (UC27) Postconditions Sale is
saved. Tax correctly calculated. Accounting and
inventory are updated. Commissions recorded.
Receipt is generated. Payment authorizations are
recorded. Main Success Scenario 1. Customer
arrives at POS checkout with goods/services to
buy 2. Cashier starts a new sale. 3.
Cashier enters item identifier. 4. System
records sale item and presents item description,
price, and running total. Price calculated from
a set of price rules.
11Use Case Description (Contd)
Cashier repeats steps 3-4 until indicates
done 5. System presents total with taxes
calculated. Extensions / Exceptions a. At
any time, System fails To support recovery
and correct accounting, ensure all transaction
sensitive state and events can be recovered from
any step of the scenario. 1. Cashier
restarts System, logs in, and requests recovery
of prior State Restart System. 2.
System reconstructs prior state. 3a. Invalid
Identifier 1. System signals error and
rejects entry. Special Requirements - Touch
screen UI on large flat panel monitor, Text
visible from 1 meter - Credit authorization
response within 30 seconds, 90 of time.
12Use Case Description (Contd)
- Technology and Data Variation List
- 3a. Item identifier entered by bar code laser
scanner (if bar code present) or by keyboard. - 3b. Item identifier is either UPC, EAN, JAN,
or SKU encoding. - Frequency of Occurrence May be continuous
- Open Issues
- Explore recovery state
- Tax Law variations?
- Can customer directly use card reader?
13Use Case Hints
- Use language of user
- Avoid implementation constraints
- Get good scenarios
- Names single, identifiable and reasonably atomic
behavior - Describes flow of events clearly enough so
outsider can follow
14Use Case Hints
- Factor common behavior by pulling it from other
use cases that it includes - Factor variants by pushing such behavior into
other use cases that extend it. - Show only use cases that are important to
understand system - Show only actors that relate to use cases
15Use Case Hints
- Specify actor names by specific roles
- Use top level diagram to show context
- Decompose top-level use cases to show
requirements - Group common use cases into packages
16Lets snoop on CS2340
- What is the relationship between Use Cases in UML
and scenarios????? - Lets look at someones scenario
- HA HAA HAAAAA
171. The user selects a node.2. If the node is
completely empty, the system prints an
errormessage.3. The user asks the system to
auto-complete missing information fromthe
following lista. Birth date and locationb.
Death date and locationc. Address or phone
number where lived (or lives)d. Marriage(s)e.
Child (or children)4. The user selects the
databases which should be searched.5. The user
selects missing information to be
auto-completed.6. If any of the databases cannot
be contacted the system prints anerror
message.7. If the data from the databases cannot
be parsed, the system printsan error message.8.
If any of the missing information cannot be
found, the systemprints an error message.9. If
the database(s) return multiple possible values
for the missinginformation, the user can select
a value from a list.10. If the database(s)
return a single value for the missinginformation,
the information is automatically added to the
node.11. The system prints a status message.
18Class Exercise Lab 3 Use Cases