Black-Box and White-Box testing techniques

Black-Box and White-Box testing techniques

In this article, we explore Black-Box testing and White-Box testing techniques that are useful for correctly approaching software testing in these two modes. First of all, there are two types of test selection criteria.

  1. Functional test or Black-Box Testing: based on the program specifications and knowledge of the features only and on the search for reliability and efficiency;
  2. Structural test or White-Box Testing: Based on the program with knowledge of the code, independent of the specifications and with the sole aim of finding defects.

These two criteria are complementary and each can detect malfunctions not detectable with the other.

Black-Box and White-Box testing techniques
Black-Box and White-Box testing techniques

Black-Box Testing

Below we talk about two techniques for data generation to perform functional checks.

Partition Testing

The partition testing (literally, “partitioning of evidence”) is the most characteristic approach of functional testing, the idea is to divide the inputs to be tested into subsets of data, from which the name partitioning is derived.
Each partition must be separated from the others and each value must have a characteristic in common with the other values ​​of the partition. All values ​​must be in the D domain of the program input data. These values ​​could be infinite.
In the testing procedure you can perform the following steps:

  1. Define the characteristics of the data based on the features to be tested;
  2. Partitioning by features;
  3. Combine the values ​​by characteristics creating the input data to be used in the tests, to verify the correct functioning at each data partition.

A fundamental part of this procedure is to define a model of the input data representation more commonly called “Input Domain Model”, (literally “input domain model”, IDM). By identifying the controllable functions and the modules of the application to be tested, all the parameters of the methods and the fields of the modules to be inserted, it is possible to obtain the data to perform the tests. Applying a test criterion for the generation of values, it will be necessary to choose a combination of them, based on the functionalities.

To define IDM, there are two approaches:

  1. Based on the interface you are testing: the values ​​are generated by identifying the type of each data item. For example, generating a numeric value, a text if it is a string or a date;
  2. Based on the features: having a complete view of the program’s behavior, values ​​can be generated for specific functions. More difficult to design and develop but with better results than the previous approach.

In choosing the input values, always checking the completeness in the set of case studies and remembering to maintain the disjunction between the individual partitions, we can refer to different strategies:

  1. Include valid, invalid and special values;
  2. Include values ​​at the boundaries of domains, values ​​at the limit of the range of possible values. This strategy defines a new selection criterion known as “Boundary value analysis” (literally “boundary of values”);
  3. Include values ​​that represent a “normal use” of the system;
  4. Include a considerable number of values ​​with the same characteristics to carry out load tests.

White-Box Testing

This criterion is based on the principle of analyzing the source code and relying on it to create selection criteria (C) for the tests. Each program can be associated with a control graph. Each node of the graph is a “command” that can be connected to other nodes through arcs. Each node can have input and output arcs. A command can be a simple instruction or a condition. A condition type command can have multiple output arcs, an instruction no. A path includes a set of nodes traversed by a single program execution.

The White-Box Testing is based on the notion of coverage, on the execution of the elements of the graph of the control flow of a program.
The coverage technique (there are different types of coverage: instructions, decisions and conditions) allows to determine the conditions that must be verified by the input data so that a particular path is executed and relates the values ​​produced by the execution of the program with the values ​​in program entry itself. Note that the program is not executed with actual values ​​but with symbolic values ​​derived from the input data. From symbolic values ​​formulas solved based on program execution are processed.

Precedente Criteria needed for a good software testing plan Successivo The software testing process

Lascia un commento