














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
State transition testing, a black box testing technique based on the theory of finite state machines. It explains the concept of states and transitions, the importance of state transition testing, and how to design state transition diagrams and tables. The document also covers when to use state transition testing and provides examples of state transition diagrams and tables for various systems.
Typology: Lecture notes
1 / 22
This page cannot be seen from the preview
Don't miss anything!















State Transition Testing
State Transition Testing – Important
Points
Different
States
Transaction
Valid States
Invalid States
Significance
To cover
sequence of
the states
Point 1 Point 2 Point 3
State Transition Testing – Important
Points
Example:
Analysis:
Event cause the software to transition from one state to another and
perform transitions
Conditions decide the transition path
Design State Transition
Two ways
State Transition Diagram
State transition table
When to use State Transition Testing?
Finite set of input values.
Sequence of events
Proper handling of a particular event
Real time systems
State Transition Table Example 1
Possible scenarios that need to be tested.
STT Example 2-Water
State transition diagram:
Invalid transition generally not shown in STD
Diagram with invalid transitions
STT Example 3-Dispensing machine
STT – Example 4
Example below is entering a Personal Identity Number (PIN) to a bank account. The states are
shown as circles, the transitions as lines with arrows and the events as the text near the
transitions.
States : S1:Start, S2:Wait for Pin, S3: 1st try, S4: 2nd Try, S5: 3rd Try, S6: access to account, S7:
eat card
Events: Event1:Card inserted, Event 2: enter Pin, Event 3: Pin OK, Event 4: Pin not OK
Actions : (not shown in the above example
Chow’s Coverage (Coverage of
tests)
Chow's switch coverage describes how you cover a state transition model
“Switch” here is state in between start and end state
0-switch coverage
-i.e. (no of exercised single-transitions in sequence ) x 100
(total no. of single-transitions in a sequence)
1-switch coverage
- coverage of transition pairs
-i.e (no of exercised two-transitions in sequence )* 100
(total no. of two-transitions in a sequence)
2-switch coverage
- coverage of transition triples
……….. N switch coverage.
STT-Testing Invalid Transitions
Example 4
-Invalid or Null Transitions are represented as ‘-‘ in red in the table above
Creating Test Cases
All events are triggered at least once
Note that the test cases that cover each event can be the same as those that
cover each state.
This is a weak level of coverage.
Creating Test Cases
All transitions are exercised at least once
Provides a good level of coverage
Generally the one recommended