Unit - 4
Unit - 4
state graph
E.RUPA
Assistant Professor
CSE Department
OVER VIEW
• A state graph and its associated
state table are useful models for
describing software (program)
behavior. The finite state machine
can be used as a functional
(behavioral) testing tool as well as
a tool for designing a testable
program.
state graph
• A state graph is a graphical representation of the
program (its FSM) in terms of states, transitions,
inputs and outputs (erroneous or normal). It has
one start state and usually, an end/destination/exit
state.
• Note => In the exam you may draw only 3 state
graph for simplicity.
• State graph in the above example is used to model
the behavior of the program that recognizes a string
occurrence at the input. It can be used to design,
implement and the testing of the program
A Property of a state graph
• State graphs are not dependent on time or temporal
behavior or the program. (Temporal behavior is
represented by some time sequence diagrams etc..)
The system changes state only when an event (with
an input sequence occurs or an epsilon symbol
representing no event appears at the input of a
transition).
• State graphs (FSM) are implemented as state tables
which are represented in software with definite data
structures and associated operations.
State table
Very big state graphs are difficult to follow as the diagrams get complicated
and links get entwined. It is more convenient to represent the state graph as
a table called state table or state transition table.
Each row represents the transitions from the originating state. There is one
column for each input symbol (erroneous input or normal input). The entry in
the table represents the new state to which the system transits to on this
transition and the output it prints on the target printer device or on the output
side.
A Property of a state graph
• A good state graph has at least two input symbols. With one
symbol only a limited number of useful graphs are possible.
• Bad state graphs contain states not reachable. It is not possible
to reach every state from every other state. It is not possible to
reach start state from itself.