Use Cases Yonglei Tao Typical Commercial Applications 300-600 entries in model dictionary 20-100...
-
Upload
matthew-gilbert -
Category
Documents
-
view
217 -
download
0
Transcript of Use Cases Yonglei Tao Typical Commercial Applications 300-600 entries in model dictionary 20-100...
Use Cases
Yonglei Tao
Typical Commercial Applications 300-600 entries in model dictionary 20-100 use cases 5-20 activities per use case 100-500 domain classes 1 to 12 operations per class
3
AcquiringRequirements
Software architecture
Use Cases
Deriving Use Cases from Requirements
Allocating Use Cases & Subsystemsto Iterations
Business goals& needs
Current situation
Preliminary requirements
Abstract & high level use cases, use case diagrams
Use case-iteration allocation matrix
(a) Planning Phase (b) Iterative Phase – activities during each iteration
Actor-System Interaction Modeling
Domain Modeling
AccommodatingRequirements Change
Behavior Modeling &Responsibility Assignment
Deriving Design ClassDiagram
Test Driven Development, Integration, & Deployment
Customer feedback
Iteration use cases
Domain model
Expanded use cases & UI design
Behavior models
Design class diagram
Domain model
Use case-iteration allocation matrix
Producing an Architecture Design
4
A Use Case Diagram
Checkout Document
Return Document
Search for Document
Library System
Patron
5
Simplify with Use of Inheritance
Startup
Shutdown
Admin
Library System
Checkout a Document
Patron Return a Document
6
Simplify with Use of Inheritance
Login
Logout
SAMS/Search Program
SAMSEnd User
SAMSAdmin
SAMSStaff
This is OK. Login
Logout
SAMS/Search Program
SAMSEnd User
SAMSAdmin
SAMSStaff Better
7
Are These Use Cases? Why? Check authorization / check authentication Enter a password Process data Open a file Click on a menu item Traverse a linked list. Start a system
8
Use Case Diagram – Overly Complex
Log In
Log Out
Start Up
SAMS
SAMSEnd User
SAMSStaff User
SAMSAdmin
Add Program
Delete Program
Edit Program
Create User
Delete User
Update User
Search for Programs
Display ProgramDetail
Apply OnlineShutdown
9
Create User
Delete User
Update User
SAMS/User Mgmt
SAMSAdmin
Add Program
Delete Program
Edit Program
SAMS/Program Mgmt
SAMSStaff
Search for Programs
Display ProgramDetail
Apply Online
SAMS/End User
SAMSEnd User
Start Up
Shutdown
Login
Logout
SAMS/Authentication
SAMSEnd User
SAMSAdmin
SAMSStaff
Software engineeringprinciple applied:• separation of concerns• divide and conquer
10
Verify the Use Cases Identified Ask questions about each use case:
(1) Is it a business process? (2) Is it initiated by an actor? (3) Does it end with the actor? (4) Does it accomplish something useful for
the actor? All the answers to above questions must
be “yes”
11
Example: Library System Requirements of a library system:
R1. The library system must allow a
patron to
check out documents.
R2. The library system must allow a
patron to
return documents.
use case actorsystem
Use CaseBusiness Process?
Begin w/ Actor?
End w/ Actor?
Useful Task for Actor?
Use Case? Actor System
R1 Checkout Document Y Y Y Y Y Patron Library
System
R2 Return Document Y Y Y Y Y Patron Library
System
12
Example: Oversea Exchange ProgramR1. The web-based application must provide a
search capability for overseas exchange programs using a variety of search criteria.
R2. The web site must provide a hierarchical display of the search results to facilitate user navigation from a high level summary to details about an overseas exchange program.
SystemActorUse
Case?
Useful Task for
Actor?End w/ Actor?
Begin w/
Actor?
Business
Process?Use Case
R1 Search for Programs Y Y Y Y Y User Web
App.
R2 Display Program Details
Y Y Y Y Y User Web App.
13
Requirements Use Case Tractability Will the system satisfy all the
requirements? Are any use case missing? Are any use case not needed? Which requirements are more important
than the other? Which use cases should the developer
focus on timely delivery?
14
Requirements-Use Case Traceability Matrix
R1
R2
R3
R4
R5
R6
UC1 UC2 UC3 UC4 UC5 UC6PriorityWeight
Score
3
2
2
1
1
1
X
X
X
X
X
XX
X
X
5 5
X
1 1 3 1
15
Project Planning by Use Cases
1) Identify dependencies between the use cases: use cases are business processes business processes depend on each other
2) Compute a partial order to develop the use cases according to the dependencies.
3) Schedule the development according to the partial order begin with higher priority use cases (risky,
high-value, architecturally significant, and executable)
time-boxed iterations
16
Project Planning with Use Cases
A planning tool to let the development team know• which use cases to be developed by what time• which use cases are ready for integration and system testing• what is the status or configuration of the project
1 2 3 4 5 6 7 8 9 10 11 12UC1UC2
UC3
UC4UC5
UC6
UC7
UC29UC30
X
X
X X
X
X
X
X
X
.
.
.
.
.
.
XX
17
Actor-System Interaction Modeling Specify how the system interacts with the
actors to carry out the use cases. to identify what is expected from the system
In an expanded use case
18
Actor: Caller System: Telco1.the caller picks up the handset from the phone base.
2. the system generates a dial tone.
3. the caller dials each digit of the phone number.
4. the system responds with a DTMF tone for each digit dialed.
5. the caller finishes dialing.
6. he system produces the ring tone.
7. the caller hears the ring tone.
Expanded Use Case – Initiate a Call
system response
actor input &actor action
19
Domain Model and Use Cases
Part of Domain Model
Programnametypedepartmentinstitutionsubjectregioncountrylanguageterm
Student
Staff
Application
student_nametermyearlanguagedate_appliedstatus
manage
1..** *
1..**
withname, type, department, ...
20
Expanded Use Case – Add Program
Actor: Staff User System: SAMS
0. System displays the staff main page.1. TUCBW the staff user clicks the “Add Program” button.
2. System displays the Add Program page.3. The staff user enters
program detail and clicks the ”submit" button.
4. System checks the submitted info and shows a confirmation message if no error is found.
5. TUCEW the staff user clicks the “OK” button on the confirmation page.
Precondition: Staff User has logged into System and Staff Main Page is shown
Postcondition: The added program is immediately available for search.
21
Showing User Interface Prototypes Showing user interface prototypes with
expanded use case specification is extremely useful to obtain user feedback early in the lifecycle.
These user interface prototypes may be reused in the preparation of the user’s manual, which can take place concurrently with the development effort.
22
(7) TUCEW staff member is shown a message that the program has been successfully added.
(6) The System updates the database with the new program details and displays a success message.
(5) User fills the form and clicks on submit button.
(4) System shows the Add Program Form
(3) Staff member clicks on Add Program link.
(2) System shows the submenu consisting of various operations that a staff user can do under Program Management.
(1) TUCBW staff member clicks on Program Management link on welcome page.
System : SAMSActor : Staff User
Showing UI Prototypes w/ Expanded Use Case
23
Video Store Use Case DiagramVideo Store
Information System
Administrator
ManageInventory
ManageMemberships
Clerk
Customer
«actor»Credit
AuthorizationService
Pay Fines
Rent Items
Log In
Manage Users
Banking System Use Case Diagram
Validate PIN Use Case
Withdraw Funds Use Case
27
Class ExerciseWhat are the use cases for the Vending
Machine?
28
Class Exercise: The Vending Machine
The Vending Machine has a display, an alphanumeric keypad, a coin insertion slot, and an item dispenser. The display shows the vending items like chocolates, candies, potato chips, Coke, sprite, etc. Each type of item has a price and a label consisting of a letter A, B, C, ... and a digit 1, 2, ... A customer inserts coins through the coin slot. Each time a coin is inserted an LCD displays the total amount. The customer can press a letter and a digit to enter his selection after enough coins have been inserted. If the total amount is greater than or equals to the item selected, the vending machine dispenses the item and returns the change to the customer. A customer can change his mind and request that the coins be returned by pressing the return button.