Modeling System Behavior

advertisement
Modeling System Behavior
1
State Transition Diagrams
• A state transition diagram is a model that depicts a
system’s states and the events that cause the system to
change states.
• A state is any observable mode of behavior for the system.
• The state transition diagram also shows what actions are
taken as a consequence of an event
• Such models are often called finite state machine models
2
State Transition Diagrams – An
Example
Following is a state transition diagram for software controlling
a printer. In this simplified model, we’ve identified five
distinct states: idle, ready, printing, jammed, out_of_paper.
The arrows represent transitions from one state to another.
Along each arrow we note the event triggering the state
change (above the horizontal rule) and the action taken in
response to the event (below the horizontal rule).
3
State Transition Example (cont’d)
trigger
action
print request
ready new job
idle
job complete
stop printing
new job
initiate print
ready
resume job
initiate print
printing
jammed
display jam msg
paper loaded
ready resume job
no paper
display paper msg
out_of_paper
jam corrected
ready resume job
jammed
4
State Transition
Diagram for ATM
Activity
Consider the software that controls the functions of a cruise
control device on an automobile. Work with your team to create a
state transition diagram for this system.
The particular device we’re working has the usual cruise control
functions, plus the following enhanced ones: 1) if your vehicle pulls
within 50 feet of a vehicle in front of you, an active cruise control
device will turn itself off if it is set for more than 45 mph; 2) when
you tap the brake once, the cruise control speed is suspended, but
may be reinstated by pressing the resume button; 3) if you tap the
brake more than once or if you hold the brake down for more than 2
seconds, the cruise control device will turn itself off in which case
the speed setting is cancelled and will have to be reset when you
re-engage the device.
6
Dialog Maps
• User interfaces can often be regarded as a finite
state machine model
• Thus, state transition diagrams can be used to
model these
• Such state transition diagrams are referred to as
dialog maps (also sometimes called site maps when
used with Web development)
7
Dialog Maps as Finite State Machines
• Each dialog element (menu, screen, dialog box, etc.)
can be viewed as a state
• The user can then navigate to another dialog
element (i.e. change states)
• The possible elements and the navigation paths
between them can be modeled as a state transition
diagram
8
Dialog Maps – An Example
1 start
transaction
terminated
request to
access
cancel registration denied
Error
Message Displayed
cancellation
data
invalid
try again
Registration
Information
Accessed
cancellation
request
cancellation
confirmed
cancellation
not allowed
Cancellation
Performed
Cancellation
Denied
update submitted
update not
allowed
Route
Request
Modeling User Interaction to Cancel a Seminar
Registration in the Seminar Registration System we
worked on earlier.
9
Dialog Maps – An Example
1 start
transaction
terminated
request to
access
cancel registration denied
Error
Message Displayed
cancellation
data
invalid
try again
Registration
Information
Accessed
cancellation
request
cancellation
confirmed
cancellation
not allowed
Cancellation
Performed
Cancellation
Denied
update submitted
update not
allowed
Route
Request
Possible Application for a Decision Tree/Table
Modeling User Interaction to Cancel a Seminar
Registration in the Seminar Registration System we
worked on earlier.
10
Another Version
of a Dialog Map
Activity
Consider the Seminar Management System we’ve been working on.
Work with your team to create a dialog map that models the
seminar administrator’s interactions with the system in obtaining an
instructor for a seminar.
Refer to the Context for this system on the next slide to refresh your
memory about it if needed.
12
Print
Vendor
eval_request
Email Sys
Attendee
seminar_notification
request_for_eval
Selected
Venue
instructor_reserved
no_instructor_available
booking_denied
instructor_request
venue_request
venue_reserved
venue_options
Seminar
Administrator
venue_choice
no_venue_avail
Proposed
Seminar
Management
System
SMS
venue_pmt_info
instructor_pmt_info
final_roster
Instructor Info
venues_available
Accounts
Payable
Seminar
Registration
System
inst_dates
dates_avail
email_address
Venues Info*
roster_sign-in
Instructor
final_roster
Attendee Info*
* Transfer/Maintenance TBD
Dialog Maps as Abstraction of User
Interface
• Dialog maps can be viewed as high-level
abstractions of user interfaces
• Show the dialog elements and navigational links
among them
• They do not reveal, or even take into account,
detailed screen designs or data field definitions
14
Dialog Maps and Prototypes
• A dialog map makes a good preliminary model to
use before beginning the construction of a
prototype
• Provides vehicle for a high-level discussion with
users about the interface functionality -- without
getting bogged down in screen appearance and
data definition details
• Excellent model for discovering missing
requirements and misunderstood requirements
relative to user interactions
15
Download