Black-box test design techniques outlined in Example

1. equivalence partitioning method

1.1 test questions?

In doing adder function test, test after a 1 + 1, 1 + 2, 1 + 1 + 3 and 4, there is a need to test I + 5 and 1 + 6 you, can safely think they are right?

1.2 equivalence partitioning

  1. The program input fields divided into several parts, and select a small number of representative data from each section as a test case.
  2. Role of representative data for each class in the test is equivalent to other values ​​in this category, one example of a class if an error is found in this and other sub error is not detected.
  3. 1. The       division of equivalence classes and are listed in equivalence class table

1.3 Basic Steps

Effective equivalence class

Invalid equivalence class

Determining principles of equivalence classes

  1. In the case where a predetermined input condition number or range of values ​​can be established and an efficient two invalid equivalence class equivalence class.
  2. In the case where a predetermined input condition or a predetermined set of input values ​​of the "how to be" conditions, can establish a valid and an invalid equivalence class equivalence class.
  3. Under predetermined rules input data must comply with a case, can establish a valid equivalence class (in accordance with the rules), and a plurality of invalid equivalence class (in violation of rules from different angles).
  4. Indeed divided in friends equivalence class, different elements in a manner in the case of processing a program, then the equivalence class should be further divided into smaller equivalence classes.
  5. In the input condition is a Boolean case, can determine a valid and an invalid equivalence class equivalence class.
  6. In a set of predetermined values ​​of input data (assuming n number), and the program to be treated separately for each input value, n can establish a valid and an invalid equivalence class equivalence class.

1.4 determine the test case

  1. Planning for each equivalence class a unique number.
  2. Design a new test case, it effectively cover equivalence class as much as possible not yet covered. This step was repeated, and finally the effective equivalence classes such that all test cases are covered.
  3. Design a new test case, it only covers one invalid equivalence class. Repeat this step so that all invalid equivalence classes are covered.

2. boundary value analysis

2.1 Principles boundary worthy choice

  1. If the input conditions specified range of values, should take just to reach the boundary of this range of values, and just beyond the boundary of the value of this range as the test input data.
  2. Analysis of specifications, to identify other possible boundary conditions.
  3. When the input conditions specified number of values, with the maximum number, minimum number, one less than the minimum number, over a number as a ratio of the maximum number of test data.
  4. If the program's standard input field or output field is given ordered set, it should select the first set of elements and the last element as a test case.
  5. If the program used in internal data structures, should be selected on the value of this internal structural boundary as the test data.

3. cause and effect diagram method

3.1 Li source of cause and effect diagram method

      The consideration of combination with one another between the input conditions, due to a large number of combinations, a large amount of test cases.

Features 3.2 of cause and effect diagram method

  1. Consider the relationship between the combination of input conditions.
  2. Consider the trust relationship between the output condition input condition that a causal relationship.
  3. You can check out some inconsistencies or omissions in the description of the function.
  4. Test found high error efficiency.
  5. The method of FIG cause determination table is finally produced, which is adapted to check program and various combinations of input conditions.

FIG method steps cause substantially 3.3

  The cause and effect relation between the features specified in the description below:

           

 

 

3.4 recognizes that "reason" and "results" and numbered

Case:  There is a drinks vending machine (processing unit price is 5 cents) control software, its software specifications described below. If the coin of 5 cents, press the "juice" or "beer" button, the corresponding beverage send out. If put a dollar coin, is also press the "juice" or "beer" button, the vending machine coin return 50 cents at the same time sending the appropriate beverage.

Vending machines causal diagram is as follows:

       

3.5 wherein mutex, comprises only, for reasons of time constraint requirement, the shield is constrained on the results. Their meaning is as follows

  1. Mutex: not simultaneously represent 1, i.e. a, b, c at most only a 1.
  2. Comprising: at least a 1 indicates that a, b, c are not simultaneously 0.
  3. Unique: indicates a, b, c and only a 1 in.
  4. Requirements: indicates if a = 1, then b must be that it is impossible to 1. a = 1 and b = 0.
  5. Mask: indicates if a = 1, then b must be 0.

       

4. The driving method determination table

  1. Heart condition pile (Condition Stub): lists problems have all conditions. Generally considered the order of the conditions listed does not matter.
  2. Heart action pile (Action Stub): list problem provisions may be taken. The order of these operations is not bound.
  3. 心条件项( Condition Entry ) :列出针对它左列条件的取值。在所有可能情况下的真假值。
  4. 学动作项( Action Entry ) :列出在条件项的各种取值情况下应该采取的动作。

4.1       建立判定表的步骤

         确定规则的个数

      假如有n个条件,每个条件有两个取值(0 , 1) ,故有2n种规则。

  1. 列出所有的条件桩和动作桩填入条件项。
  2. 填入动作项,制定初始判定表。
  3. 简化,合并相似规则或者相同动作。
  4. 规格说明以判定表的形式给出,或很容易转换成判定表。
  5. 条件的排列顺序不影响执行哪些操作。
  6. 规则的排列顺序不影响执行哪些操作。
  7. 当某一规则的条件已经满足,并确定要执行的操作后,不必检验别的规则。

4.2 适合使用判定表设计测试用例的条件:

当某一规则的条件已经满足,并确定要执行的操作后,不必检验别的规则。

Guess you like

Origin www.cnblogs.com/huzhanghui/p/12158956.html