State Machines - Software Engineering - Lecture Notes, Study notes of Software Engineering

This course includes topics like software processes, requirements analysis and specification, design, prototyping, implementation, validation and verification, UML-based modeling, integrated development environments, and case studies. Key points of this lecture are: State Machines, Advanced State Machines, State Machine Diagrams, States, Transitions, Composite States, Submachine States, Submachine Communication, Activity Diagrams, Protocol State Machines

Typology: Study notes

2012/2013

Uploaded on 10/03/2013

abani
abani 🇮🇳

4.4

(34)

81 documents

1 / 29

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
State Machines &
Advanced State Machines
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download State Machines - Software Engineering - Lecture Notes and more Study notes Software Engineering in PDF only on Docsity!

State Machines &

Advanced State Machines

Outline

 State machines:

 Introduction

 State machine diagrams

 States

 Transitions

 Events

 Advanced state machines:

 Composite states

 Simple  Orthogonal

 Submachine states

 Submachine communication

 History

Introduction

 Reactive objects:

 Respond to external events

 May generate and respond to internal events

 Have a lifecycle modeled as a progression of

states, transitions and events

 May have current behavior that depends on past

behavior

 State machines are used to model behavior

of classifiers such as classes, use cases,

subsystems, systems

Introduction

 There are two types of state machines:

 Behavioral state machines

 Protocol state machines

 State machines are most commonly used to model

dynamic behavior of classes

 In UP, state machines can be used in: requirements,

analysis, design

 A significant challenge is testing state machines:

manual walkthrough, simulation, code generation +

test harnesses for state machines

States

Summary of UML state syntax, Fig.21.4 [Arlow & Neustadt 2005]

Transitions

Summary of UML syntax for transitions in behavioral state diagrams, Fig.21.5 [Arlow & Neustadt 2005] Where:  event(s)= internal or external occurrence(s) that trigger the transition  guardCondition = boolean expression, when true the transition is allowed  anAction = some operation that takes place when the transition fires

Transitions

A junction pseudo-state represents a point where transitions merge or

branch, e.g. Fig.21.7 [Arlow & Neustadt 2005]

Transitions

A junction pseudo-state may have more than one output transition

(protected by mutually exclusive guard conditions) e.g. Fig.21. [Arlow & Neustadt 2005]

Events

 Events can be of four types:

 Call event

 Signal event

 Change event

 Time event

Events

Example of a call event, Fig.21.11 [Arlow & Neustadt 2005]

Events

Change events are positive edge triggered. Example of a change event, Fig. 21.15 [Arlow & Neustadt 2005]

Events

Time events are indicated by the keywords when and after.

Example of a time event, Fig. 21.16 [Arlow & Neustadt, 2002]

Composite states

 A composite state

contains one or more nested state machines

( submachines), each

existing in its own

region, Fig 22.2 [Arlow

& Neustadt 2005].  The composition icon is shown in Fig. 22.

Simple composite states

 A superstate that contains a single region is called a simple

composite state, e.g. Fig 22.5 [Arlow & Neustadt 2005]