150 likes | 301 Views
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.
E N D
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) idle trigger action print request ready new job job complete stop printing new job initiate print ready resume job initiate print paper loaded ready resume job printing out_of_paper no paper display paper msg jam corrected ready resume job jammed display jam msg jammed 4
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 start 1 request to cancel registration access denied transaction terminated cancellation confirmed cancellation not allowed Registration Information Accessed Error Message Displayed Cancellation Performed Cancellation Denied cancellation request update submitted update not allowed try again cancellation data invalid Route Request Modeling User Interaction to Cancel a Seminar Registration in the Seminar Registration System we worked on earlier. 9
Dialog Maps – An Example start 1 request to cancel registration access denied transaction terminated cancellation confirmed cancellation not allowed Registration Information Accessed Error Message Displayed Cancellation Performed Cancellation Denied update submitted update not allowed try again cancellation data invalid cancellation request 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
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 Attendee Email Sys seminar_notification completed_eval request_for_eval seminar_completed Selected Venue instructor_reserved booking_confirmation no_instructor_available booking_denied instructor_request Proposed Seminar Management System SMS booking_request venue_request Accounts Payable venue_pmt_info venue_reserved Seminar Administrator venue_options instructor_pmt_info venue_choice class_roster no_venue_avail available_instrs Seminar Registration System final_roster Instructor Info venues_available inst_scheduled inst_dates scheduled dates_avail Venues Info* email_address roster_sign-in Instructor * Transfer/Maintenance TBD final_roster Attendee Info*
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