Software Testing Technology Course Summary (3) Black Box Testing

black box testing

Black box testing, also known as correctness testing, or functional testing, is to verify the functions of the product, and is used to check whether the product meets the functions required by the user or whether the software functions meet the specifications. In the test, the program is regarded as a black box that cannot be opened, and the program interface is tested without considering the internal structure and characteristics of the program. It only checks whether the program function is in normal use according to the requirements specification. Whether the program can properly receive input data and produce correct output information . White box testing is adopted in the early stage of testing while black box testing is mainly used in the later stage of testing. Black-box testing deliberately ignores control structures and instead focuses on information domains.

The main aspects of black box testing:

  • Incorrect or missing features;
  • interface, interface error;
  • performance errors;
  • data structure or external data access errors;
  • Incorrect initialization or termination conditions, etc.

equivalence class division

Equivalence class division is a typical black-box testing method. This method does not consider the internal structure of the program at all, and only divides the program input domain into several parts (subsets) according to the requirements and descriptions of the software, that is, the requirements specification. , and then select a small number of representative data from each part as the test input.

Valid equivalence classes and invalid equivalence classes

Equivalence class division is divided into two cases, effective equivalence class and invalid equivalence class

Classification introduce
effective equivalence class Refers to the specification of the program, which is a meaningful and reasonable collection of input data. Using effective equivalence classes, it is possible to check whether a program implements the functions and performances specified in the specification.
invalid equivalence class Refers to the specification of the program, which is a collection of unreasonable or meaningless input data. Using invalid equivalence classes, you can check whether the implementation of program functions and performance does not meet the requirements of the specification

Example: Suppose there is a triangle judging program: input three positive integers , and judge the type of triangle formed according to the input numbers.

When the input is: a = 10, b = 10, c = 10, it is an effective equivalence class

When the input is: a = -1, b = 5, c = 9, since a=-1 does not satisfy the condition that all three are positive integers, it is an invalid equivalence class.

equivalence class division

The division of equivalence classes requires that the divided set be a set of mutually disjoint subsets, and the union of these subsets is the whole set.

Take the above triangle judgment program as an example:

insert image description here

Boundary value analysis

A large number of failures occur on the boundaries of the input or output ranges, rather than inside the input ranges. When designing test cases using the Boundary Value Analysis method, the boundary cases should first be identified.

Boundary value analysis test data selection (also consider invalid values):

  1. Pick a value exactly equal to the bounds
  2. A value just above the bounds
  3. Values ​​just below the bounds

Disadvantages of Boundary Value Analysis:

Boundary value analysis requires that the input variables be independent, otherwise such methods cannot produce satisfactory test cases. For example, months and days are not independent, and the maximum value for days varies with the month.

The difference between boundary value analysis and equivalence partition:

  1. Boundary value analysis is not to randomly pick one from an equivalence class as a representative, but to make each boundary of this equivalence class a test condition.
  2. Boundary value analysis considers not only the input conditions, but also the test cases generated by the output space.

decision table test

Decision tables (also called decision tables) are the most rigorous and logically rigorous testing methods among all black-box testing methods.
The most prominent advantage of the decision table is that it can list complex problems according to various possible situations, which is concise and easy to understand, and can also avoid omissions.

The principle of decision table:

In some data processing problems, the implementation of certain operations depends on the combination of multiple input conditions. The decision table can list all complex problems according to various possible situations to avoid omissions.

Guess you like

Origin blog.csdn.net/lichukuan/article/details/126735698