Black Box Testing Methodology - Decision Table

In the causal diagram analysis method, a decision table will be obtained at the end. It can be seen that the causal diagram and the judgment table are related and generally need to be used in combination.

The cause-and-effect diagram is an analysis tool. Through the analysis, the decision table is finally obtained, and then the test cases are written through the decision table. Under certain circumstances, it is also possible to directly write the judgment table, omit the cause-and-effect diagram, and then write test cases.

The composition of the decision table

The decision table is composed of condition stubs, action stubs, condition items and action items. Condition stubs represent all conditions that may cause this problem, action stubs represent all output results of this problem, condition items are the values ​​of the condition stubs, and action items are the output results of each value of the condition items.

Decision Table Design Steps

To design a decision table, you first need to list all condition stubs and action stubs, and determine the number of rules. The number of rules is determined by the condition stubs. Number of rules = number of conditional values ​​^ number of conditions.

Fill in the condition items and action items in turn to get the initial decision table. The initial decision table will contain redundant content, which is generally not suitable for designing test cases. The decision table is further simplified, and similar rules or actions are combined to obtain a complete and concise decision table for the final design of use cases.

example

Input three positive integers a, b, and c as the three sides of the triangle, and judge whether the three sides can form a triangle, and if they can form a triangle, determine the type of triangle.

Determine the condition pile
C1: a, b, c form a triangle?a<b+c、b<a+c、c<a+b C2:a = b?C3:a = c?C4:b = c?

Determine action pile
A1: non-triangular; A2: scalene triangle; A3: isosceles triangle; A4: equilateral triangle; A5: impossible.

Fill in the form, determine condition items and action items.
Determine the number of rules
. There are four conditions, each of which evaluates to "yes" or "no", so there are 2 ^ 4 = 16 rules.

Design Judgment Form
1. Fill in the Initial Judgment Form

C1: 8 0s, 8 1s;

C2: 4 0s, 4 1s, 4 0s, 4 1s;

C3: 2 0s, 2 1s, 2 0s, 2 1s, 2 0s, 2 1s, 2 0s, 2 1s;

C4:0,1,0,1,0,1,0,1,0,1…

2. Simplified decision table

If the conditions for forming a triangle are not met, the result is a non-triangle, which has nothing to do with the following three conditions. In this case, the decision table can be simplified.

 

Design test cases
Impossible cases can be excluded when designing test cases, and non-triangular cases need to consider the different situations of each value. The final test case is obtained as shown in the following table:

 

Through the examples, do you have a deeper understanding of the judgment table? We not only need to learn the theory of the test method, but also need to flexibly apply it to the test work~ 

  Finally:  In order to give back to the die-hard fans, I have compiled a complete software testing video learning tutorial for you. If you need it, you can get it for free 【保证100%免费】

insert image description here

How to obtain the full set of materials: Click the small card below to get it yourself

 

Guess you like

Origin blog.csdn.net/weixin_57794111/article/details/131490007