About State Transition Testing
State transition testing is a technique for creating test cases from state transition diagrams or state transition tables. For more information on state transition testing, please check this document.
About State Transition Testing in GIHOZ
- Editable Area: The gray area is the editable area where you can add and edit states and transitions.
- State: The rectangle represents the state of the test object.
- Transition: The directional line represents the transition of the state. You can edit the name of an event causing a transition.
- Generate state transition table and test cases: You can generate a state transition table, all transitions test cases, and N-switch test cases from the current state transition diagram by clicking this button.
- Select n-switch to generate test cases: You can select the N-switch test cases you want to generate.
- Download state transition diagram button: You can download the state transition diagram in either PNG or SVG format.
- Input State Transition Table toggle button: By turning on Input State Transition Table, the Editable area is closed and the state transition table can be entered.
How to Create a State Transition Diagram
Create a new state by double-clicking Editable area. Double-click State and edit the name of it. Press the Tab key to exit editing.
Drag the edge of state1 and drop it to state2 if you want to create a transition from state1 to state2.
Drag the edge of state1 and drop it on state1 if you want to create a transition from state1 to state1. Double-click area labelled transition and edit the name of the event causing the transition. Press Tab key to exit editing.
You can create a new state and transition at the same time by selecting a state and clicking +. If you want to delete a state or a transition, select the state or the transition and press Delete key. To zoom in or out on the diagram, hold down Ctrl key and move the mouse wheel up or down on the editable area, or click area and press + or - key.
Change the color of the state transition diagram
The color of states and transitions can be changed.
Click to select the states or transitions whose color you want to change, then select the desired color from the list of State color or Transition color below the editable area.
By clicking any color from the list, the color of the selected states or transitions will be changed.
Download the state transition diagram
The state transition diagrams can be downloaded in PNG or SVG format. By clicking Download state transition diagram, the format selection menu will appear. By selecting a format, the state transition diagram will be downloaded in the format. The maximum size of the PNG format is 10,000 x 10,000 pixels. Figures outside this size range will not be output. There is no size limit in the SVG format.
How to generate test cases from a state transition diagram
Click Generate state transition table & Test cases. A State Transition Table, All Transitions Test Cases, and N-switch Test Cases are automatically generated from the state transition diagram. When you edit the state transition diagram, click Update state transition table & Test cases. The change is reflected in the state transition table and each test case.
Two types of state transition tables are generated: State - Event and Current State - Next State. In the table of State - Event, the rows represent states. The columns represent events causing transitions. The cell shows the next state when the event represented the column occurs at the state represented the row. In the table of Current State - Next State, the rows represent the states before the transitions. The columns represent the states after the transitions. The event causing the transition from the current state to the next state is described in the cell.
In the table of State - Event, you can select ignore or can't happen in the empty cells by the pull-down menu.
How to generate test cases from a state transition table
To generate test cases from a state transition table without creating a state transition diagram, turn on Input State Transition Table below the diagram.
The State - Event table appears initially. In the State - Event table, input the state before transition in the header column, the event in the header row, and the state after transition in the data entry section.
If you want to edit the Current State - Next State table, you can switch the table by clicking radio button. In the Current State - Next State table, input the state before transition in the header column, the state after transition in the header row, and the event in the data entry section. You can input multiple data in the data entry section by separating them with commas. After you edit the table, you can generate each test case by clicking Generate Test cases. Click Download CSV to download the state transition table as a CSV file.
Generated Test Cases
All transition test cases including invalid transitions and N-switch test cases selected in the Select n-switch to generate test cases will be created.
All Transitions Test Cases: Test cases that cover all combinations of states and transitions
N-Switch Test Cases: Test cases that cover paths of N+1 times state transitions.
Click Download CSV to download the test cases as a CSV file.
Other operations
You can select a range in the editable area by holding down the mouse button on an empty spot and then dragging.
If you want to delete multiple states or transitions at once, select the range and press Delete key.