Test Case Design White paper-Causal diagram method __ Test

Source: Internet
Author: User

Test Case Design White paper-Causal diagram method
Author:vince Source: Http://blog.csdn.net/vincetest

I. Method Introduction 1. Definition: A method for designing test cases by using graphical analysis of various combinations of input, which is suitable for checking the various combinations of the input conditions of the program. 2. The background of causality diagram: Equivalence class partitioning method and boundary value analysis method are all focused on the input conditions, but do not take into account the input conditions of the various combinations, the constraints between the input conditions. In this way, although a variety of input conditions may be wrong, the situation has been tested, but the combination of multiple input conditions may be error is ignored. If the various combinations of input conditions must be considered at the time of testing, the number of possible combinations will be astronomical, so it is necessary to consider a test case design that is suitable for describing a combination of multiple conditions and generating multiple actions accordingly, which requires the use of causal diagrams (logical models). 3. The causal map 1) 4 symbols represent the 4 causal relationships in the specification respectively.

2 The causal diagram uses a simple logic symbol to connect 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 for reason, usually at the left part of the graph; Ei represents the result, usually at the right of the graph. Both CI and ei are desirable for a value of 0 or 1,0 to indicate that a state does not appear, and 1 indicates that a state appears. 4. Causality diagram concept 1) Relationship ① identity: If CI is 1, then EI is 1; otherwise, EI is 0. ②: If CI is 1, then EI is 0; otherwise ei is 1. ③ or: If C1 or C2 or C3 is 1, then EI is 1; otherwise, EI is 0. "or" can have any input. ④ with: If C1 and C2 are both 1, then EI is 1; otherwise, EI is 0. "and" can also have any input. 2 constraint input states may also have some dependencies between each other, called constraints. For example, some input conditions themselves cannot appear at the same time. Constraints are also often present between output states. In causal diagrams, these constraints are marked with specific symbols.    A. The constraints of an input condition have the following 4 categories: ①e constraints (XOR): At most one and B may be 1, i.e. A and B cannot be 1 at the same time.    ②i constraints (OR): at least one of the A, B, and C must be 1, i.e. A, B, and C cannot be 0 at the same time.    ③o constraints (unique); A and b must have one, and only 1 of them are 1. ④r constraint (required): A is 1 o'clock, B must be 1, that is, impossible A is 1 o'clock B is 0. B. The constraint of OUTPUT condition constraint type output condition is only M constraint (coercion): If result A is 1, then result B is forced to 0. 5. Steps to design test cases using causality diagram: 1 The Analysis software Specification description, those are the reasons (that is, input conditions or input conditions of the equivalence class), those are the results (that is, output conditions), and give each reason and result an identifier. 2 Analyze the semantics of the description of the software specification, find out the relationship between the cause and the result, cause and reason, and draw a causal diagram according to these relationships. 3 because of grammatical or environmental limitations, there are some reasons and reasons, the combination of causes and results is not possible, in order to indicate these special circumstances, in the causal map with some signs to indicate constraints or constraints. 4 the causality diagram is converted into the judgment table. 5 take each column of the decision table as the basis, design test cases.two. Practical Exercises 1.  a software specification contains such requirements: the first column character must be a or B, and 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; if the second column character is not a number, give the information m. Answer: 1   According to the question, the reasons and results are as follows:         reason:            1--The first column character is A;           2--the first column character is b;            3--The second column character is a number.        results:           21--modification documents;            22--give the information l            23--gives the information m. 2)   its corresponding cause and effect diagram is as follows: 11 is the intermediate node, considering the reason 1 and reason 2 cannot be 1 at the same time, therefore imposes the e constraint on the causality diagram. 3 to establish a judgment table according to causality diagram.          Table 8 cases in the left two columns, the reason ① and reason ② at the same time 1, this is not possible, it should be ruled out in both cases. The next column in the table gives 6 scenarios of test cases, which are the data we need. 2. The design of a vending machine software test case that deals with a beverage with a price of 5 cents. The specifications are as follows: If you put a coin of 5 cents or 1 yuan, and you bet the orange juice or beer button, the corresponding drink will be sent out. If the vending machine has no change, a red light that shows the change is done at this time in the input of 1 yuan coins and put the button, the drink does not send out and 1 yuan coins also retreat, if there is change to find, then show the change after the red light out, in the delivery of drinks at the same time refund 5 cents coins. 1)   Analyze This section of the description, list the reasonsAnd the reason for the result: 1. The vending machine has small change to find 2. Invest 1 yuan Coins 3. Put 5 cents 4. Drop the orange juice button 5. Result: 21. The change of the vending machine is light     22. Refund 1 coins 23 cents  &nbs p;           24. Send out orange juice drink 25. Send out Beer drink 2 draw a causal diagram, as shown in the picture. All cause nodes are listed on the left, and all result nodes are listed on the right. Establish an intermediate node that represents the intermediate state of the processing. Intermediate node: 11. Put a 1-dollar coin and charge the drink button                 12. Press the button for orange juice or beer                 13. You should find 5 cents and a vending machine with small change for                 14. The money has been paid 3) converted to the Judgment table:   4)   In the decision table, the shaded section indicates the impossibility of violating the constraint, and deletes it. The 16th and 32nd columns did not do any action, also deleted. Finally, the remaining 16 columns can be used as a basis for determining test cases.

Related articles:

Test Case Design White paper--the basic concept of test cases

Second, test case design white paper--equivalence class partitioning method

Test Case Design White paper--Boundary value analysis method

Test Case Design White paper--Error inference method

V. Test Case Design White paper-Causal diagram method

Vi. test Case Design White paper--Decision table driving analysis method

Test Case Design White paper--design method of orthogonal experiment

Test Case Design White paper--Function Diagram Analysis method

Ix. test Case Design White paper--Scene design side hair

Test Case Design White paper--a comprehensive strategy for test case design

Welcome to reprint This article, reproduced when please specify the source of the article: Vince Test 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.