Upload
elinor-heath
View
223
Download
2
Embed Size (px)
Citation preview
CSC450CSC450
1
Requirements Modeling using UML 2.0 Use Cases
CSC450CSC450
2
Requirements Engineering
Software Lifecycle Activities
System Engineering
Requirements Analysis
Software Design
Implementation
Testing
Deployment
Evolution
Define software features
CSC450CSC450
3
Example: Online HR System
Online HR System
LocateEm ployees
UpdateEm ployee
Profile
Update Benefits
Access TravelSystem
Access PayRecords
Em ployee
M anager
Healthcare Plan System
{if currentMonth = Oct.}
{readOnly}
Insurance P lan System
CSC450CSC450
4
Online HR System: Update Benefits Use Case
Actors: employee, healthcare plan system, insurance plan system Precondition:
· Employee has logged on to the system and selected ‘update benefits’ option
Basic course· System displays employee account· System asks employee to select medical plan type; include Update
Medical Plan.· System asks employee to select dental plan type; include Update
Dental Plan.· …· System asks user to select benefits options: benefit options
· reimbursement option selected: Elect Reimbursement for Healthcare
· stock option selected: Elect Stock Purchase
CSC450CSC450
5
Simple Use Case example
System Response
2. If customer is authenticated, then request rental items
4. Display calculated price.
6. Inform customer that payments is authorized
Actor Inputs
1. Customer submits identification information
3. Customer submits items to be rented
5. Customer pays.
Item Rental Use Case
CSC450CSC450
6
Relating Use Cases
Specializing/generalizing use cases Including use cases Extending use cases
CSC450CSC450
7
Construct Description Syntax
association The participation of an actor in a use case. i.e., instance of an actor and instances of a use case communicate with each other.
generalization A taxonomic relationship between a more general use case and a more specific use case.
extend A relationship from an extension use case to a base use case, specifying how the behavior for the extension use case augments (subject to conditions in the extension) the behavior defined for the base use case. The base use case does not depend on the extension use case. Compare: include.
include a relationship from a base use case to an inclusion use case, specifying how the behavior for the base use case contains the behavior defined for the inclusion use case. The base use case depends on the inclusion use case. Compare: extend.
Use Case Modeling: Core Relationships
<<extend>>
<<include>>
CSC450CSC450
8
Including Use Cases
A use case can include another use case at a specified location. Used to avoid writing the same flow
of events across a number of use cases.
The included use case must not be a stand-alone use case.
base inclusion
CSC450CSC450
9
Extension Points
A use cases may have extension points. An extension point is a point in the use case where its
behavior may be augmented with additional behavior. The additional behavior is specified by the extending
use case. The use case that is extended is called the base use
case. The extend relationship
The relationship between a base use case and an extending use case.
The extend relationship may be conditional
CSC450CSC450
10
Extending Use Cases
The base use case can act as a stand-alone use case.
The base use case can only be extended at extension points.
Often used to separate optional behavior from mandatory behavior.
Also used to model a separate flow that is executed under certain conditions.
base extension
On-Line Help
CSC450CSC450
11
Use Case DescriptionSystem Response
2. If customer is authenticated, then request rental items
4. Display calculated price.
6. Inform customer that payments is authorized
Actor Inputs
1. Customer submits identification information
3. Customer submits items to be rented
5. Customer pays.
Item Rental Use Case
Any of the numbered activities could serve as an extension point.
Extension point syntax:<extension point>::=<name>[:<explanation>]
CSC450CSC450
12
Fig. 3-54, UML Notation Guide
Use Case Relationships
additional requests :
OrderProduct
SupplyArrange
«include»«include»«include»
RequestCatalog
«extend»Extension points
PaymentCustomer Data
after creation of the order
Place Order
1 * the salesperson asks forthe catalog
CSC450CSC450
13
Example: Online HR System
Online HR System
LocateEm ployees
UpdateEm ployee
Profile
Update Benefits
Access TravelSystem
Access PayRecords
Em ployee
M anager
Healthcare Plan System
{if currentMonth = Oct.}
{readOnly}
Insurance P lan System
CSC450CSC450
14
Online HR System: Use Case Extension
Update Benefits______________Extension pointsbenefit options:
after required enrollmentsEmployee
ElectReimbursementfor Healthcare
Elect StockPurchase
<<extend>>employee requestsstock purchase option
<<extend>>employee requestsreimbursement option
extensioncondition
extension pointname andlocation
CSC450CSC450
15
Online HR System: Update Benefits Use Case with extension point
Actors: employee, healthcare plan system, insurance plan system Precondition:
· Employee has logged on to the system and selected ‘update benefits’ option
Basic course· System displays employee account· System asks employee to select medical plan type; include Update
Medical Plan.· System asks employee to select dental plan type; include Update
Dental Plan.· …· System asks user to select benefits options: benefit options
· reimbursement option selected: Elect Reimbursement for Healthcare
· stock option selected: Elect Stock Purchase
CSC450CSC450
16
Online HR System: Use Case relationships
Update M edicalP lan
Update DentalP lan
Update Benefits______________Extension pointsbenefit options:
after required enrollm ents
UpdateInsurance P lan
Em ployee
<<include>> <<include>> <<include>>
ElectReim bursem entfor Healthcare
Elect StockPurchase
<<extend>>em ployee requestsstock purchase option
<<extend>>em ployee requestsreim bursem ent option
extensioncondition
extension pointname andlocation
CSC450CSC450
17
Online HR System: Update Benefits Use Case
Actors: employee, employee account db, healthcare plan system, insurance plan system
Precondition:· Employee has logged on to the system and selected ‘update benefits’
option Basic course
· System displays employee account information· System asks employee to select medical plan type; include Update
Medical Plan.· System asks employee to select dental plan type; include Update
Dental Plan.· …
Alternative courses· If health plan is not available in the employee’s area the employee is
informed and asked to select another plan...
CSC450CSC450
18
Specializing Use Cases
Generalizing/specializing use cases A specialized use case inherits the
behavior (sequences of actions) of its parent(s).
A specialized use case can override some of the behavior of its parent(s). It can also add to the behavior.
A specialized use case can be used anywhere the general use case is expected.
CSC450CSC450
19
Example of Use Case Relationships
Open file by typing name
Open file by browsing
Open file
System Administrator
Browse for file
Ordinary User
Attempt to open file that does not exist
«extend» «include»
CSC450CSC450
20
Example description of a use case
Use case: Open file Related use cases: Generalization of: • Open file by typing name • Open file by browsing Steps:
Actor actions System responses 1. Choose ‘Open…’ command 2. File open dialog appears 3. Specify filename 4. Confirm selection 5. Dialog disappears
CSC450CSC450
21
Use case: Open file by typing name Related use cases: Specialization of: Open file Steps:
Actor actions System responses 1. Choose ‘Open…’ command 2. File open dialog appears 3a. Select text field 3b. Type file name 4. Click ‘Open’ 5. Dialog disappears
Example (continued)
CSC450CSC450
22
Use case: Open file by browsing Related use cases: Specialization of: Open file Includes: Browse for file Steps:
Actor actions System responses 1. Choose ‘Open…’ command 2. File open dialog appears 3. Browse for file 4. Confirm selection 5. Dialog disappears
Example (continued)
CSC450CSC450
23
Use case: Attempt to open file that does not exist Related use cases: Extension of: Open file by typing name
Actor actions System responses 1. Choose ‘Open…’ command 2. File open dialog appears 3a. Select text field 3b. Type file name 4. Click ‘Open’ 5. System indicates that file
does not exist 6. Correct the file name 7. Click ‘Open’ 8 Dialog disappears
Example (continued)
CSC450CSC450
24Organizing Use Cases I
CSC450CSC450
25
Organizing Use Cases II
CSC450CSC450
26
Summary What’s coming next class?
______________________Devon M. Simmonds
Computer Science Department
University of North Carolina Wilmington
_____________________________________________________________
Qu es ti ons?