Test case design--decision table

1. Why use decision tables to design test cases?

The equivalence class method considers the requirement input domain in detail, but cannot cover when the input domain is related to the input domain, (for example, when the equivalence class is divided into design test cases, a new test case is designed to cover only one invalid, etc. equivalence classes until all invalid equivalence classes are completely covered, regardless of the combination of invalid equivalence classes and invalid equivalence classes). Therefore, a design method that can consider the mutual relationship between input fields is needed to consider the descriptive test requirements of the business.

2. What is a judgment table?

The judgment table is a tool for analyzing and expressing several input conditions, and the measured object responds differently according to the input. It is suitable for business logic relationships and combinations of various conditions.

The structure of the decision table

 

Conditional stubs: all inputs to the object under test

Condition: True or false values ​​that may be entered for condition stubs

Action stubs: all possible actions that the object under test may take for conditional stubs

Action item: for the action pile, the measured object responds to the possible result value

3. How to use the judgment table to design test cases?

step:

1. List all conditions and actions

2. According to the extracted condition piles and action piles, design a judgment table to determine the number of rules (if there are n conditions, and each condition has 2 values ​​(0, 1), the nth power of 2 can be generated rule)

3. Fill out the judgment form

4. Simplify the judgment table (merging the judgment table is at the expense of test adequacy and confusing business logic. It is not recommended to merge the rules within 8)

5. Extract test cases (after simplifying the judgment table, each rule in the judgment table can be extracted as a test case, and the judgment table obtains the test rules, not the final test cases. The rules cannot verify the correctness of function points, only business rules are verified correctness)

 4. What are the pros and cons of designing test cases for decision tables?

Advantages: The decision table fully considers the combination of input fields, each rule covers multiple input conditions, and the constraint relationship of the input is considered, which reduces the risk of missed testing. At the same time, the logic of the requirement specification itself can be inferred by using the judgment table, which proves the correctness of the requirement in reverse.

Disadvantages: When there are too many input items, the number of rules increases sharply by the nth power of 2, and the judgment table will be very large. When the judgment table is merged, it will cause a lack of logic and business confusion and errors.

5. Examples of judgment table design test cases

Example 1: The caller and the called party are not allowed to be called due to downtime or arrears

Step 1: List all conditions and actions

Condition: Downtime/Arrears

Action: The calling party is called

Step 2: Determine the number of rules

There are 3 conditions, and each condition has 2 values, so there are 8 rules

Step 3: Fill out the judgment form

Step 4: Only 4 rules are not merged, and it is not recommended to merge the rules below 8

Step 5: Rule extraction:

(1) The user does not stop and does not owe payment, and can make the call

(2) The user does not stop the arrears and does not allow the caller to be called

(3) The user will not be in arrears for downtime, and the caller and the callee are not allowed

(4) The user is in arrears for downtime, and the callee is not allowed to live

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325028453&siteId=291194637