test method of state transition for black box test

Source: Internet
Author: User

The composition of the state transition diagram:

1, state: In the circle, the beginning and the end is a special state;

2, conversion: Due to the driving of the event, the system from one state to another State;

3. Event: triggered by the relevant interface of the system, and the specific conversion association;

4. Activity: "/" indicates that the activity is triggered by a state transition;

5, the condition: "[]" to indicate that the state conversion is only after satisfying this condition.


state Transition Testing : A way to design test cases based on state transitions. A switchover between two allowed states of a system or component.

The test method based on state transition is an effective way to detect the dynamic behavior anomaly of Web program. Changes in the state of the Web program are determined by the navigation scenarios that are composed of the link sequence and the submitted data. This paper uses the Activity page navigation diagram (APND) to describe the link conversion behavior between pages, using the state variable combination object state diagram ( COSD) to describe the changes in system state variables caused by the submitted data, and then unify the two into a more comprehensive dynamic behavior model of the Web program state Transition diagram (WSTD). Finally, we use the clue K Fork Tree and improve it to generate the test case automatically.


State transition Diagram-----> State Transformation Tree

1, the starting state as the root of the state conversion tree;

2, from left to right to check the current level of the node, the node corresponding to all the next possible state as its child nodes;

3. Repeat the second action until the node at the previous level is encountered, the node is the final node, and finally the end node.


-->n-switch of circulating conversion machine

N-switch was proposed by Tsun S. Chow in 1978, and he defined n-switch as a sequence of successive edges or arcs (usually representing loops in a state diagram) in a program diagram with a length of n+1. So a single edge (or conversion) is a 0-switch, and the sequence of two contiguous edges is 1-switch.

The concepts and differences between 0-switch and 1-switch are described in the state machine shown in Figure 1 below. Figure 1 shows an example of a state machine where a circle represents a state, an edge with an arrowhead represents a transformation, and an identity of an English letter is defined for each transformation.

650) this.width=650; "src=" http://img.educity.cn/img_7/262/2013122003/5974031100.gif "border=" 0 "alt=" 5974031100. GIF "/>

Figure 1 State Machine example diagram


  1) 0-switch

For 0-switch, the basic rules or steps for transforming a state transition diagram into a state conversion tree are as follows:

Step 1: The initial state or start state as the root of the state transformation tree, the root in the entire state transformation tree hierarchy is 1.

Step 2: Assuming that the current build state transformation tree has a hierarchy of K, then left-to-right checks all the nodes on the K, and the node corresponding to all the next possible state as its child nodes, transitions between states as a two-state edge.

Step 3: Repeat step 2 until a node at level K appears on the level J, and J is less than or equal to K, then the node becomes the final leaf node without having to continue to generate its child nodes, or the state of the node is an end state, and there is no need to continue the state transition for that node.

According to the definition of 0-switch, all the 0-switch corresponding to this state machine are: A, B, C, D, E, F. At the same time, according to the above 0-switch state transformation tree generation rules, the resulting state is shown in Figure 2.

650) this.width=650; "src=" http://img.educity.cn/img_7/262/2013122003/5975031100.gif "border=" 0 "alt=" 5975031100. GIF "/>

Figure 2 0-switch state Transition diagram example


  2) N-switch

Look again at 1-switch. According to the definition of 1-switch, all 1-switch corresponding to this state machine are: AB, AC, BB, BC, CD, CE, DD, DE, EA, EF, FD, fe. The generation rule of the 1-switch State transformation tree is based on the 0-switch state transformation tree, and then adds a hierarchy, that is, for all leaf nodes of the 0-switch State transformation tree, the possible next state of each leaf node as a child node of that node. It is important to note that only one level can be added. The state transition diagram for the generated 1-switch is shown in Figure 3.

650) this.width=650; "src=" http://img.educity.cn/img_7/262/2013122003/5976031101.gif "border=" 0 "alt=" 5976031101. GIF "/>

Figure 3 1-switch state Transition diagram example

If 1-switch still can not meet the strength of the test, then, according to the above ideas, continue to add a level, so that it reaches 2-switch. However, it is important to note that the increase in test strength is at the expense of increasing the test case in exponential form. The balance between the two is what the testers have to think about when they use the test strength.


Test method of state transition for black box testing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.