Chapter 5
1
Systems Analysis and Design in a Changing World, 7th Edition - Chapter 1
©2016. Cengage Learning. All rights reserved.
Chapter.5 Use Case Modeling
Chapter 5 Outline
• Use Case Descriptions
©201
Systems Analysis and Design in a Changing World, 7th e
• Activity Diagrams for Use Cases
• The System Sequence Diagram—Identifying Inputs and Outputs
• SSD Notation
6. Cengage Learning. All rights reserved.
• Use Cases and CRUD
• Integrating Requirements Models
dition – Chapter 5
3
Learning Objectives
• Write fully developed use case descriptions
• Develop activity diagrams to model flow of activities
©201
Systems Analysis and Design in a Changing World, 7th e
• Develop system sequence diagrams
• Use the CRUD technique to validate use cases
6. Cengage Learning. All rights reserved.
• Explain how use case descriptions and UML diagrams work together
to define functional requirements
dition – Chapter 5
4
Overview
• Chapters 3 and 4 identified and modeled the two primary
aspects of functional requirements: use cases and domain
classes
©201
Systems Analysis and Design in a Changing World, 7th e
• This chapter focuses on detail modelling for use cases to
document the internal steps within a use case
6. Cengage Learning. All rights reserved.
• Fully developed use case descriptions provide information
about each use case, including actors, stakeholders,
preconditions, post conditions, the flow of activities and
exceptions conditions
dition – Chapter 5
• Activity diagrams (first shown in Chapter 2) can also be
used to show the flow of activities for a use case
5
Overview (continued)
• System sequence diagrams (SSDs) show the
inputs and outputs for each use case as
messages
©201
Systems Analysis and Design in a Changing World, 7th e
• CRUD analysis, which correlates problem domain
classes and use cases, is an effective technique
6. Cengage Learning. All rights reserved.
to double check that all required use cases have
been identified
• Not all use cases are modelled at this level of
dition – Chapter 5
detail. Only model when there is complexity and
a need to communicate details
6
• Write
Use Case Descriptions
Chapter 3 for most use cases.
a brief description as shown in
Systems Analysis and Design in a Changing World, 7th e
7
dition – Chapter 5 ©201
6. Cengage Learning. All rights reserved.
Use Case Descriptions
• Write a fully developed use case description for more complex use
cases
©201
Systems Analysis and Design in a Changing World, 7th e
• Typical use case description templates include:
Use case name
Scenario (if needed)
6. Cengage Learning. All rights reserved.
Triggering event
Brief description
Actors
Related use cases (<<includes>>)
dition – Chapter 5
Stakeholders
Preconditions
Postconditions
Flow of activities
Exception conditions
8
n
Fully
Create
account
customer
Use case:
Use Case
Descriptio
Developed
Systems Analysis and Design in a Changing World, 7th e
9
dition – Chapter 5 ©201
6. Cengage Learning. All rights reserved.
Create customer account (part 1 )
Fully Developed Use Case Description
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
10
6. Cengage Learning. All rights reserved.
Create customer account (part 2 )
Fully Developed Use Case Description
Systems Analysis and Design in a Changing World, 7th e
11
dition – Chapter 5 ©201
6. Cengage Learning. All rights reserved.
Use Case Description
Details
• Use case name
Verb-noun
©201
Systems Analysis and Design in a Changing World, 7th e
• Scenario (if needed)
A use case can have more than one scenario (special case or
6. Cengage Learning. All rights reserved.
more specific path)
• Triggering event
Based on event decomposition technique
dition – Chapter 5
• Brief description
Written previously when use case was identified
• Actors
One or more users from use case diagrams 12
Use Case Description
Details
• Related use cases <<includes>>
If one use case invokes or includes another
©201
Systems Analysis and Design in a Changing World, 7th e
• Stakeholders
Anyone with an interest in the use case
• Preconditions
What must be true before the use case begins
6. Cengage Learning. All rights reserved.
• Post conditions
What must be true when the use case is completed
Use for planning test case expected results
• Flow of activities
dition – Chapter 5
The activities that go on between actor and the system
• Exception conditions
Where and what can go wrong
13
Use case
Ship items
Example
Use Case
Developed
Description
Another Fully
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
14
6. Cengage Learning. All rights reserved.
Ship items (part 1 )
Fully Developed Use Case Description
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
15
6. Cengage Learning. All rights reserved.
Ship items (part 2 )
Fully Developed Use Case Description
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
16
6. Cengage Learning. All rights reserved.
•
only
Case
Account
UML Activity
Create Customer
flow of activities
Diagram for Use
Note: this shows
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
17
6. Cengage Learning. All rights reserved.
•
for
Note:
Case
bar for loop
Ship Items Use
Activity Diagram
Synchronization
Decision diamond
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
18
6. Cengage Learning. All rights reserved.
•
relationship
Use Case
use case with
<<includes>>
Diagram for
Note: this shows
UML Activity
Fill shopping cart
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
19
6. Cengage Learning. All rights reserved.
System Sequence Diagram
(SSD)
• A UML sequence diagram
©201
Systems Analysis and Design in a Changing World, 7th e
• Special case for a sequence diagram
Only shows actor and one object
The one object represents the complete system
6. Cengage Learning. All rights reserved.
Shows input & output messaging requirements for a
use case
• Actor, :System, object lifeline
dition – Chapter 5
• Messages
20
System Sequence Diagram (SSD) Notation
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
21
6. Cengage Learning. All rights reserved.
Frame
with Loop
Examples
SSD Message
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
22
6. Cengage Learning. All rights reserved.
Message Notation for SSD
• [true/false condition] return-value := message-name (parameter-
list)
©201
Systems Analysis and Design in a Changing World, 7th e
An asterisk (*) indicates repeating or looping of the message
Brackets [ ] indicate a true/false condition. This is a test for that message only.
6. Cengage Learning. All rights reserved.
If it evaluates to true, the message is sent. If it evaluates to false, the message
isn’t sent.
Message-name is the description of the requested service written as a verb-
noun.
Parameter-list (with parentheses on initiating messages and without
dition – Chapter 5
parentheses on return messages) shows the data that are passed with the
message.
Return-value on the same line as the message (requires :=) is used to describe
data being returned from the destination object to the source object in
response to the message.
23
•
•
(if-else)
Alt Frame
SSD Message Examples
Opt Frame (optional)
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
24
6. Cengage Learning. All rights reserved.
Steps for Developing SSD
1. Identify input message
See use case flow of activities or activity diagram
Describe the message from the external actor to the
©201
Systems Analysis and Design in a Changing World, 7th e
2.
system using the message notation
Name it verb-noun: what the system is asked to do
Consider parameters the system will need
6. Cengage Learning. All rights reserved.
3. Identify any special conditions on input messages
Iteration/loop frame
Opt or Alt frame
dition – Chapter 5
4. Identify and add output return values
On message itself: aValue:= getValue(valueID)
As explicit return on separate dashed line
25
account Use case
SSD for Create customer
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
26
6. Cengage Learning. All rights reserved.
SSD for Ship
items Use Case
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
27
6. Cengage Learning. All rights reserved.
Use Cases and CRUD
• CRUD technique –
Create
Read/Report
©201
Systems Analysis and Design in a Changing World, 7th e
Update
Delete
6. Cengage Learning. All rights reserved.
• A good cross-check against the existing set of
use cases. Used in database context
Ensure that all classes have a complete “cover” of use
cases
dition – Chapter 5
• Not for primary identification of use cases
28
Verifying use cases for Customer
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
29
6. Cengage Learning. All rights reserved.
CRUD Analysis
Steps
1. Identify all domain classes
2. For each class verify that use cases exist to
©201
Systems Analysis and Design in a Changing World, 7th e
Create a new instance
Update existing instances
Reads or reports on information in the class
6. Cengage Learning. All rights reserved.
Deletes or archives inactive instances
3. Add new use cases as required. Identify responsible
stakeholders
dition – Chapter 5
4. Identify which application has responsibility for each
action: which to create, which to update, which to use
30
Sample CRUD Matrix
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
31
6. Cengage Learning. All rights reserved.
Extending and Integrating
Requirements Models
• Use cases
Use case diagram
Use case description
Activity diagram
System sequence diagram (SSD)
• Domain Classes
Domain model class diagram
State machine diagram
Systems Analysis and Design in a Changing World, 7th edition – Chapter 5
©2016. Cengage Learning. All rights reserved. 32
Integrating Requirements
Models
Systems Analysis and Design in a Changing World, 7th edition – Chapter 5
©2016. Cengage Learning. All rights reserved. 33
Summary
• Chapters 3 and 4 identified and modeled the two
primary aspects of functional requirements: use cases
©201
Systems Analysis and Design in a Changing World, 7th e
and domain classes
• This chapter focuses on models to provide details of
use cases
6. Cengage Learning. All rights reserved.
• Fully developed use case descriptions provide
information about each use case, including actors,
stakeholders, preconditions, post conditions, the flow of
activities and exceptions conditions
dition – Chapter 5
• Activity diagrams (first shown in Chapter 2) can also be
used to show the flow of activities for a use case
34
Summary (continued)
• System sequence diagrams (SSDs) show the inputs
and outputs for each use case as messages
©201
Systems Analysis and Design in a Changing World, 7th e
• CRUD analysis serves to verify that all domain
classes are fully supported by the new system, i.e.
have use cases to fully process all required actions
6. Cengage Learning. All rights reserved.
• Not all use cases and domain classes are modelled
at a detailed level. Only model when there is
complexity and a need to communicate details.
dition – Chapter 5
• All of the models must be consistent and integrate
together to provide a complete picture of the
requirements and specification.
35
RTGM System Use Cases
Systems Analysis and Design in a Changing World, 7th e
dition – Chapter 5 ©201
36
6. Cengage Learning. All rights reserved.