Test case design method Six Meridians Divine Sword - The Second Sword: Combination of moves, causal determination is born | JD Logistics Technology Team

1 Introduction

The previous article talked about equivalence class division and boundary value analysis methods, but these two methods only consider a single input condition, and do not consider various combinations of input conditions and scenarios of mutual constraints between input conditions. Based on this shortcoming, the cause-effect diagram method and the decision table method came into being.

2 Cause-and-effect diagram method

2.1 Concepts and principles

2.1.1 Definition

A graphical tool that describes combinations of input conditions and the output corresponding to each combination. It is suitable for checking various combinations of program input conditions.

2.1.2 Principles of method

When drawing a cause-and-effect diagram, the cause is on the left and the result is on the right, arranged from top to bottom. According to the relationship between the cause and the result specified in the function description, the following basic symbols are used to connect them. You can also introduce some in the cause-effect diagram. intermediate node.

1. Basic graphics symbols of cause-and-effect diagrams

2. Constraints in cause-and-effect diagrams

From the perspective of reasons, there are mainly 4 types of constraints:

  • E (mutually exclusive, exclusive): two reasons a and b will not appear at the same time, at most only one will appear.
  • I (including, or): at least one of the three reasons a, b, c appears
  • O (unique): one and only one of the two reasons a and b must occur
  • R (requirement): b must appear when a appears.

From the perspective of results, there is mainly one constraint:

  • M (masking): When a appears, b will definitely not appear; when a does not appear, b is uncertain

2.2 Method steps

  1. Find all the reasons, which are input conditions or equivalence classes of input conditions;
  2. Find all the results, the results are the output conditions;
  3. Clarify the constraints and combination relationships between all input conditions; which conditions cannot be combined together and which conditions can be combined together.
  4. Clarify the constraints and combination relationships between all output conditions; which output results cannot be output at the same time, and which output results can be output at the same time.
  5. Find out what combination of input conditions produces which output;
  6. Draw cause and effect diagrams;
  7. Convert the cause-and-effect diagram into a judgment table/decision table;
  8. Design test cases for the situation represented by each column in the decision table (each column is a test case).

2.3 Give a chestnut

Scenario: Basic agent admits responsibility or appeals

1. First list the input conditions and output conditions

Input conditions:

  • 1——Acknowledge responsibility or
  • 2——Appeal
  • 3 - Personal Responsibility
  • 4 - Organizational Responsibility
  • 5——Tripartite Responsibility
  • 6——Responsible Person ERP
  • 7-Reasons for appeal
  • 8-Description

Output conditions:

  • a - Accept personal responsibility
  • b——acknowledge organizational responsibility
  • c——Acknowledgement of liability of three parties
  • d——Appeal

2. Draw a cause and effect diagram

3. Convert the cause-and-effect diagram into a decision table, and take out each column of the decision table as a test case

  • Select "Acknowledge Responsibility", select "Personal Responsibility", fill in: Responsible Person ERP, Description-"Acknowledge Responsibility Personal Responsibility"
  • Select "Acknowledge Responsibility", select "Organizational Responsibility", fill in: Description-"Acknowledge Responsibility Organizational Responsibility"
  • Select "Acknowledge Responsibility", select "Three-Party Responsibility", fill in: responsible person ERP, name of three parties, description -"Acknowledge Responsibility Three-Party Responsibility"
  • Select "Appeal" and fill in: Reason for appeal, description - "Appeal"

3 Determination table method

3.1 Concepts and principles

3.1.1 Definition

The decision table is a tool for analyzing and expressing the situation of performing different operations under multiple logical conditions. It refers to a table used to display conditions and the set of actions caused by the conditions.

3.1.2 Principles of method

It mainly contains five parts:

  • Condition pile: all conditions of the problem
  • Conditional items: value combinations of all conditions
  • Action pile: all possible actions
  • Action item: Which actions in the action pile are executed for each combination of condition values?
  • Rule: A condition value combination and its corresponding action combination. A condition value combination and its corresponding action combination (that is, a column in the decision table that runs through the condition item and the action item) constitute a rule in the decision table.

3.2 Method steps

  1. List all condition stubs and action stubs (inputs and outputs);
  2. Fill in the conditional items (input items);
  3. Fill in the action items to get the initial judgment table;
  4. Simplify the decision table (merging similar rules (same actions)).

3.3 Give a chestnut

Scenario: Basic agent admits responsibility or appeals

1. Column judgment table

2. Simplify the decision table

  • Select "Acknowledge Responsibility", select "Personal Responsibility", fill in: Responsible Person ERP, Description-"Acknowledge Responsibility Personal Responsibility"
  • Select "Acknowledge Responsibility", select "Organizational Responsibility", fill in: Description-"Acknowledge Responsibility Organizational Responsibility"
  • Select "Acknowledge Responsibility", select "Three-Party Responsibility", fill in: responsible person ERP, name of three parties, description -"Acknowledge Responsibility Three-Party Responsibility"
  • Select "Appeal" and fill in: Reason for appeal, description - "Appeal"

4 Summary

However, the cause-and-effect diagram and decision table methods will generate very large and redundant test cases in scenarios with many variable values ​​and a large number of permutations and combinations. At this time, it is difficult for us to fully cover all combination scenarios with test cases. It’s time for the orthogonal test method to show its power, let’s learn it together~

Author: Wang Peng of JD Logistics

Source: JD Cloud Developer Community Ziyuanqishuo Tech Please indicate the source when reprinting

 

IntelliJ IDEA 2023.3 & JetBrains Family Bucket annual major version update new concept "defensive programming": make yourself a stable job GitHub.com runs more than 1,200 MySQL hosts, how to seamlessly upgrade to 8.0? Stephen Chow's Web3 team will launch an independent App next month. Will Firefox be eliminated? Visual Studio Code 1.85 released, floating window Yu Chengdong: Huawei will launch disruptive products next year and rewrite the history of the industry. The US CISA recommends abandoning C/C++ to eliminate memory security vulnerabilities. TIOBE December: C# is expected to become the programming language of the year. A paper written by Lei Jun 30 years ago : "Principle and Design of Computer Virus Determination Expert System"
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/4090830/blog/10319798