Showing posts with label state transition testing. Show all posts
Showing posts with label state transition testing. Show all posts

Tuesday, 30 July 2013

State transition diagram in testing

State Transition Testing Technique:
Steps for using state transition testing are:
STEP 1: Understand the various states that the system , user, or object can be in, including the initial and final states. Examples of states can be 'User raising a purchase order' or 'leave request is accepted'.  State are represented as,

STEP 2: Identify transitions, events, conditions, and actions that can and can't apply in each state.

STEP 3: Use a graph or table to model the system. This graph or table also serves as an oracle to predict correct system behavior along with a requirement specification.

STEP 4: For each event and condition (i.e each transition) verify that the correct action and next state occurs.

STEP 5: Create test cases in such a way that all states are visited at least once, all events are triggered at least once and all paths are executed at least once. (i.e all transitions in the system are tested at least once).

Example for using state transition testing:

What is State Transition Testing

State Transition Testing:
State-Transition diagrams are an excellent tool to capture certain types of system requirements and to document internal system design. These diagrams document the events that come into and are processed by a  system as well as the system's responses. When a system must remember what happened before or when valid and invalid orders of operation exist, then state transition testing could be used. It is useful in situations when workflow modelling or dataflow modelling has been done, which mean that the system moves from one state to another.

State Transition diagrams uses states, events, actions and transitions of the system to be tested. Together with all these components, they represent how a system interacts with the outside world and process them.

Some of the terms use din state transition testing are:
State: A state is a condition in which a system is waiting for one or more events. States remember inputs the system has received in the past and define how the system should respond to subsequent events when they occur. These events may cause state transitions and or initiate actions. The state is generally represented by values of one or more variables within a system.

Transition: It represents a change from one state to another caused by an events.
Event: Something that causes the system to change state. Events may have parameters associated with them. Events can be independent or casually related.

Actions:  An action is an operation initiated because of state change. Often these actions causes something to be created that is outputs of the system.