Starting from this section, we will summarize the typical white box testing technologies. I have summarized in detail the black box testing and some common black box testing technologies, but none of them open the software code for testing. The concept of black box testing is to name the white box testing technology, so what is white box testing? The white-box test is also called the structure test. The white-box test is a test on how the tested unit works internally. It goes deep into the program code details and designs test cases based on the program control structure, it is mainly used for software program verification.
White Box tests are classified into static white box tests and dynamic white box tests. Static tests mainly involve code profiling and review, which are not summarized here. Dynamic tests include logic coverage testing, path coverage testing, and boundary value testing. Of course, there are many other methods, here we mainly summarize the logic coverage test and path coverage test. The coverage test should use the program diagram and flowchart auxiliary tools, so you should be familiar with the program diagram and flowchart painting before learning the coverage test.
This section describes the conversion between flowcharts and flowcharts. A program flow chart is a common tool used to describe and analyze the flow of software control. Using a program flow chart to design a test case helps to separate the program path and conduct coverage statistics. The main symbol of the program flow chart is:
Sequence:
Condition determination:
Judge first and then loop:
Execute the command first and then judge the loop:
Next, let's take a look at the code of a program and analyze the flowchart:
# Include <iostream. h>
Void main ()
{
Inti, a [5]; // defines the cyclic variable I, number of columns n
Longsum = 0; // defines the sum and temporary variables of the sequence.
Cout <"enter 5 numbers as the value of each item in the series:" <Endl;
For (I = 1; I <= 5; I ++)
{
Cout <"Enter the" <I <"value :";
Cin> A [I];
}
For (I = 1; I <= 5; I ++)
{
Sum + = A [I];
}
Cout <A [1] <"+" <A [2] <"+... + "<A [5] <" = "<sum <Endl;
}
Flowchart:
Program diagram:
Because the knowledge of the program flowchart is very simple, this section describes such a very simple example. The diagrams can be compared and drawn. The program flowchart is very important in the logic coverage test, therefore, examples of program flowcharts will also be infiltrated in the summary in the following sections.