I. Introduction to the methodology
1. Definition: It is a method of analyzing the various combinations of input by means of graphic method to design the test case, which is suitable for checking the various combinations of the input conditions of the program. 2. Background of the cause and Effect diagram method:The equivalence class partitioning method and the boundary value analysis method all focus on the input conditions, but do not take into account the various combinations of the input conditions, the mutual constraints between the input conditions. This allows for the possibility of errors in various input conditions that have been tested, but the combination of multiple input conditions may have been overlooked. if the various combinations of input conditions must be considered in the test, the number of possible combinations will be astronomical, so the design of the test case must be considered in the form of a combination that describes multiple conditions and produces multiple actions accordingly, which requires a causal diagram (logical model). 3. Cause and Effect diagram Introduction1) 4 symbols represent the 4 causal relationships in the specification.
2) Simple logic symbols are used in the causality diagram to join the left and right nodes in a straight line. The left node represents the input state (or reason), and the right node represents the output state (or result). 3) CI denotes the cause, usually placed on the left part of the graph; Ei represents the result, usually at the right of the graph. Both CI and EI values of 0 or 1,0 indicate that a state does not appear, and 1 indicates that a state appears. 4. Causality diagram Concept1) Relationship① Identity: If CI is 1, then EI is also 1; otherwise ei is 0. ② non: If CI is 1, ei is 0; otherwise ei is 1. ③ or: If C1 or C2 or C3 is 1, EI is 1; otherwise ei is 0. "or" can have any type of input. ④ and: If both C1 and C2 are 1, EI is 1; otherwise ei is 0. "and" can also have any input. 2) Constraintsthe input states may also have some dependencies on each other, called constraints. For example, some of the input conditions themselves cannot occur at the same time. Constraints also often exist between output states. In a causal diagram, these constraints are marked with a specific symbol. A. The constraints of the input criteria are as follows 4 categories:①e Constraint (XOR): A and B can be at most one of 1, i.e. A and B cannot be 1 at the same time. ②i constraints (OR): at least one of a, B, and C must be 1, i.e. A, B, and C cannot be at the same time 0. ③o constraints (unique); A and b must have one, and only 1 are 1. ④r Constraint (required): A is 1 o'clock, B must be 1, that is, the impossibility of A is 1 o'clock B is 0. B. Output condition Constraint typethe constraint of the output condition is only M constraint (mandatory): If result A is 1, then result B is forced to 0. 5. The steps to design a test case using a causal diagram:1) Analysis software Specification Description, those are the reason (that is, the input condition or the equivalence class of the input condition), those are the results (that is, the output condition), and give each cause and result assigned an identifier. 2) Analyze the semantics in the description of the software specification, find out the corresponding relationship between the reason and the result, the reason and the reason, and draw the causality diagram according to these relations. 3) Due to grammatical or environmental constraints, there are some reasons and reasons, the combination of causes and results can not occur, in order to indicate these special cases, on the cause and effect diagram with some marks to indicate constraints or constraints. 4) Convert the causality diagram into a decision table. 5) Each column of the decision table is taken out as the basis for the design of test cases.
two. Combat Drills1. A software specification contains the requirement that the first column character must be a or B, the second column character must be a number, in which case the file is modified, but if the first column character is incorrect, the information L is given, and if the second column character is not a number, the message M is given. Answer:1) According to test instructions, the reasons and results are as follows:Reason:the first column of characters is A;2--The first column of characters is b;3--The second column character is a number. Results:21--Modify the file;22--gives the information L;23--gives the information m. 2) Its corresponding causality diagram is as follows:11 is an intermediate node, and because reason 1 and reason 2 cannot be 1 at the same time, an e constraint is imposed on the causality diagram. 3) Establish a judgment table based on causality diagram. in the case of the left two columns of the table in 8 cases, the reason ① and the cause ② at the same time 1, this is impossible to appear, so should be ruled out both cases. The next column in the table gives the test cases for 6 cases, which is the data we need. 2. There is a software test case design for a vending machine that deals with a beverage with a unit price of 5 cents. The specifications are as follows: if you invest 5 cents or 1 yuan in a coin, put down the "orange juice" or "beer" button, then the corresponding drink will be sent out. If the vending machine does not have change to find, then a show "change to find out" red light, then put in 1 yuan coins and bet the button, the drink is not sent out and 1 yuan coin back out; If you have change to find, then show "Change to find" The red light off, in the same time to send out a drink to the 5 dime 1) Analyze This section of the note to list the causes and resultsReason:1. The vending machine has change to find2. Invest 1 yuan Coins3. Invest 5 cents in coins4. Charge the orange juice button5. Charge the beer buttonResults:21. Vending Machine "Change to find" light on22. Refund of 1 yuan coins23. Return 5 Dime24. Send an orange juice drink25. Giving out beer drinks2) Draw a causal diagram,. All cause nodes are listed on the left, and all result nodes are listed on the right. Establishes an intermediate node that represents the middle state of the process. Intermediate Junction:11. Invest 1 yuan coins and charge the drink button12. Charge the orange juice or beer button13. Should find 5 corner change and the vending machine has change to find14. The money has been paid3) Convert to decision table: 4) In the Judgment table, the shadow section indicates that the situation is not possible due to the violation of the constraint conditions, delete. The 16th and 32nd columns were also deleted because of what action was not done. Finally, the remaining 16 columns can be used as the basis for determining test cases.
Test Case Design Whitepaper--Causality diagram method