White Paper on test case design-The Causal Method

Source: Internet
Author: User

White Paper on test case design-The Causal Method
Author: Vince Source: http://blog.csdn.net/vincetest

I. Method Introduction

1. Definition: it is a method that uses Graphic solutions to analyze various combinations of input and design test cases. It is suitable for checking various combinations of input conditions of a program. 2. Background produced by the Causal Method: both the equivalence classification method and the Boundary Value Analysis Method Focus on the input conditions, but do not consider the combinations of input conditions and the mutual constraints between input conditions. In this way, although various input conditions may have errors tested, the combination of multiple input conditions may cause errors, which is ignored. If you must consider the combinations of input conditions during testing, the possible number of combinations will be astronomical, therefore, we must consider using a combination suitable for describing multiple conditions and multiple actions to design test cases. This requires the use of the logical model ). 3. Description of cause and effect (1) four symbols indicate four causal relationships in the Specification Description.

(2) A simple logical symbol is used in the causal indicator to connect the Left and Right nodes in a straight line. The left node indicates the input state (or reason), and the right node indicates the output state (or result ). 3) CI indicates the reason, which is usually placed in the left part of the graph; EI indicates the result, usually in the right part of the graph. The values of Ci and Ei are 0 or 1. 0 indicates that a status does not appear, and 1 indicates that a status appears. 4. Concept 1) Relation ① constant: If Ci is 1, then EI is 1; otherwise, EI is 0. ② Non: If Ci is 1, EI is 0; otherwise, EI is 1. ③ Or: If C1, C2, or C3 is 1, EI is 1; otherwise, EI is 0. "Or" can have any input. ④ And: If c1 and c2 are both 1, then EI is 1; otherwise, EI is 0. "And" can also have any input. 2) constraints the input states may also have some dependencies between them, which are called constraints. For example, some input conditions cannot appear simultaneously. There are also constraints between output states. The constraints are marked with specific symbols in the cause. A. There are four types of constraints for the input condition: ① e constraint (different): at most one of A and B may be 1, that is, a and B cannot be 1 at the same time. ② I constraint (OR): at least one of A, B, and C must be 1, that is, A, B, and C cannot be 0 at the same time. ③ O constraint (unique); A and B must have one and only one is 1. ④ R constraint (requirement): When a is 1, B must be 1, that is, it is impossible for a to be 1 and B to be 0. B. Output condition constraint type the output condition constraint is only M (mandatory): If result a is 1, Result B is 0. 5. steps for designing test cases using the Causal Method: 1) analyze the causes (that is, the equivalence classes of input conditions or input conditions) in the Software Specification Description ), those are results (that is, output conditions), and each reason and result is assigned an identifier. 2) analyze the semantics in the description of the Software specification, find out the relationship between the cause and the result, and between the cause and the reason, and draw the cause. 3) due to syntax or environmental restrictions, the combination between the cause and the result may not be possible for some reasons. To indicate these special situations, use some marks to indicate constraints or restrictions on the cause and effect. 4) convert the causal table into a discriminant table. 5) use each column of the decision table as a basis to design test cases. Ii. Practical drills1. A Software Specification includes the following requirements: the first column must be A or B, and the second column must be a number. In this case, modify the file, however, if the character in the first column is incorrect, information l is given. If the character in the second column is not a number, information m is given. Answer: 1) Based on the meaning of the question, the reason and result are as follows: 1 -- the first column is a; 2 -- the first column is B; 3 -- the second column is a number. Result: 21: Modify the file; 22: give information l; 23: give information M. 2) the corresponding cause and effect are as follows: 11 is the intermediate node. Considering that cause 1 and cause 2 cannot be 1 at the same time, the E constraint is applied on the cause and effect. 3) create a decision table based on the cause and effect. In the two left columns of the eight situations in the table, the reason ① and reason ② are both 1, which is impossible. Therefore, we should exclude these two situations. The bottom column of the table provides test cases in six cases, which are the data we need. 2. There is a vending machine software test case for processing a drink with a price of 5 cents. The specifications are described as follows: if a coin of 5 cents or 1 yuan is invested, and the button of orange juice or beer is placed, the corresponding drinks will be sent out. If there is no change to find the vending machine, then a red light that shows the change is finished, then after you put a 1 Yuan coin and place the button, the drink is not sent out, and the 1 Yuan coin also exits. If there is change, the red light of the change is displayed, and the 5-cent coin is returned when the drink is sent. 1) analyze this section to list the causes and result causes: 1. find the vending machine with change 2. invest 1 RMB coin 3. 5-cent coin 4. place the orange juice button. result: 21. vending machine watch the light on 22. refund 1 RMB coin 23. refund 5-cent coins 24. deliver orange juice 25. send beer drinks 2) Draw the cause ,. All cause nodes are listed on the left, and all result nodes are listed on the right. Creates an intermediate node to indicate the intermediate state of processing. Intermediate node: 11. 1 RMB coin and drink Button 12. click orange juice or beer. should look for 5 cents change and the vending machine has change to find 14. money paid off 3) convert to a decision table: 4) in the decision table, the shadow part indicates that the violation of the constraints is impossible, delete. Columns 16th and 32nd are also deleted because of no action. Finally, you can use the remaining 16 columns as the basis for determining test cases.

Related Articles:

I. White Paper on test case design-basic concepts of Test Cases

Ii. White Paper on test case design-division of equivalence classes

Iii. White Paper on Test Case Design -- Boundary Value Analysis Method

Iv. White Paper on test case design-incorrect estimation method

V. White Paper on test case design-the cause-and-effect method

Vi. White Paper on Test Case Design -- Determination table-Driven Analysis Method

VII. White Paper on test case design-orthogonal experiment design method

VIII. White Paper on test case design-function diagram Analysis

IX. White Paper on test case design-scenario designer

10. White Paper on test case design-Comprehensive Strategy for Test Case Design

Welcome to repost this article, please indicate the source of the article: Vince Testing Technology Research Center http://blog.csdn.net/vincetest

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.