[Test Case Design] Black Box Testing Methodology - Cause and Effect Diagram

causal diagram

Using the graphical method to analyze various combinations of input, so as to design test cases, is suitable for checking various combinations of program input conditions. Cause: Input condition, Effect: Output result.

Applicable scenario: Describe the combination of multiple conditions and generate multiple actions.

Basic symbols in causal diagrams

Usually, c1 is used in the causal diagram to represent the cause, e1 to represent the result, and each node represents the state, which can take a value of 0 or 1. 0 represents that a certain state does not appear, and 1 represents that a certain state appears.

Identity: When the cause appears, the effect will appear; if the cause does not appear, the effect will not appear. If there is a cause, there must be an effect, and if there is no cause, there will be no effect. c1=1, e1=1; c1=0, e1=0. Such as: shopping payment, there is a shopping receipt after payment, and no shopping receipt if no payment is made.

Non: The cause appears, the effect does not appear; the cause does not appear, the effect occurs. There is no cause and no effect, no cause and no effect. c1=1, e1=0; c1=0, e1=1. Such as: shopping, if you buy all the stock of a certain product, you can not buy this product again, if you don’t buy all the stock, you can buy it again.

Or: There are multiple reasons. If at least one cause occurs, the effect occurs; if there is no cause, the effect does not occur. At least one of c1, c2, c3 = 1, e1 = 1; c1, c2, c3 are all = 0, e1 = 0. For example: shopping payment, if there are three bank cards, if the balance of one of them meets the payment fee, the payment can be successful, and if the balance of the three cards is not enough, the payment will fail.

vs.: There are multiple reasons. When all causes occur, the effect occurs; if at least one cause does not occur, the effect does not occur. c1, c2, c3 all=1, e1=1; at least one of c1, c2, c3=0, e1=0. For example: shopping, it is necessary to satisfy that the goods are in stock and the bank card balance is sufficient for payment, then the purchase can be made successfully, and if one condition is not met, the purchase cannot be made.

Constraints in causal graphs

Input conditions may also have certain dependencies on each other, called constraints. The same applies between the output conditions. In the causal diagram, these constraints are marked with specific symbols.

Mutual exclusion E: at most one of a, b, and c is established, and none of them may be established.

Contains I: at least one of a, b, and c is established, and all of them can be established.

Unique O: There is one and only one of a, b, and c.

Requirement R: If a is established, then b must be established, and the others are not restricted.

Masking M: If a is established, then b is not established, and the others are not constrained.

Cause and Effect Diagram Design Steps

Find all input conditions (caused by)

Find all output conditions (fruits)

Clarify the constraints and combinations of input conditions

Clarify the constraints and combinations of output conditions

Find the corresponding output results produced by the combination of input conditions

Causality Diagram Converted to Decision Table

Design test cases based on decision tables

the case

A recharge system that can recharge 50 or 100 yuan each time

Requirements analysis

 1. Find out all input conditions and output conditions

Recharge software: Coin 50/100, recharge 50/100

input conditions

output condition

1. Coin 50

a. Complete the recharge and return the card

2. Coin 100

b. Prompt that the recharge is successful

3. Recharge 50

c. Give change (return money)

4. Recharge 100

d. Prompt error

2. Respectively clarify the constraints and combination relationships between input conditions and output conditions

Input conditions: 1 and 2 are mutually exclusive, 3 and 4 are mutually exclusive, so there are 1, 2, 3, 4, 13, 14, 23, 24, a total of 8 input combinations.

Output conditions: a and d are mutually exclusive, b and d are mutually exclusive, so there are ab, abc, cd, d, a total of 4 output combinations.

3. Find out the corresponding output results generated by the combination of input conditions

1、2→cd ,3、4→d ,13、24→ab ,14→cd ,23→abc

 Intermediate nodes can be added to assist in analysis and simplify the cause-and-effect diagram.

4. Transform the causal diagram into a decision table

serial number

1

2

3

4

5

6

7

8

enter

1. Coin 50 yuan

1

1

1

2. Coin 100 yuan

1

1

1

3. Recharge 50 yuan

1

1

1

4. Recharge 100 yuan

1

1

1

output

a. Complete the recharge and return the card

1

1

1

b. Prompt that the recharge is successful

1

1

1

c. Give change (return money)

1

1

1

1

d. Prompt error

1

1

1

1

1

5. Design test cases according to the decision table

use case number

test point

test steps

expected outcome

1

Invest 50 yuan recharge 50 yuan

1. Click the 50 yuan coin button
2. Click the recharge 50 yuan button

The recharge is successful and the card is returned, indicating that the recharge is successful

2

Invest 50 yuan to recharge 100 yuan

1. Click the 50-yuan coin button
2. Click the recharge 100-yuan button

Prompt error, give change 50 yuan

3

Invest 100 yuan recharge 50 yuan

1. Click the 100 yuan coin button
2. Click the recharge 50 yuan button

If the recharge is successful and the card is returned, it will prompt that the recharge is successful, and you will get 50 yuan in change

4

Invest 100 yuan recharge 100 yuan

1. Click the coin 100 yuan button
2. Click the recharge 100 yuan button

The recharge is successful and the card is returned, indicating that the recharge is successful

5

Invest 50 yuan without clicking the recharge button

1. Click the 50 coin button
2. Don't click the recharge button

Prompt error, give change 50 yuan

6

Invest 100 yuan without clicking the recharge button

1. Click the coin 100 yuan button
2. Do not click the recharge button

Prompt error, give change 100 yuan

7

No coin click to recharge 50 yuan

1. Do not click the coin button
2. Click the recharge 50 button

Prompt error

8

No coin click to recharge 100 yuan

1. Do not click the coin button
2. Click the recharge 100 button

Prompt error

Guess you like

Origin blog.csdn.net/Yocczy/article/details/127760243