Basic knowledge of testing 4 "" black box testing and white box testing

In the previous test basics, I summarized the types of tests, which are classified according to the test phase or test execution method. For details, please refer to my blog: Basic Knowledge of Testing 2 "Classification of Software Testing

For basic introductory testers, they should be familiar with white box testing, black box testing and their corresponding methods. They are all necessary knowledge in interviews and professional requirements.

White box testing

White-box testing (also known as logic-driven testing, structural testing), it is to know the internal working process of the product, through the test to check whether the internal action of the product is carried out normally according to the specifications, according to the internal structure test of the program Program, check whether each path in the program can work correctly according to the predetermined requirements, regardless of its function, the main methods of white box testing include logic drive, base circuit testing, etc., which are mainly used for software verification.


White box testing of software is a detailed inspection of the procedural details of the software. This method regards the test object as an open box, which allows testers to use the logic structure and related information within the program to design or select test cases to test all logic paths of the program. By checking the state of the program at different points, determine whether the actual state is consistent with the expected state. Therefore, white box testing is also called structural testing or logic-driven testing.

White box testing is divided into static and dynamic testing:
Static testing: A static method refers to a testing method that directly checks the source code or code according to certain steps, including methods such as code review, desktop inspection, and code walkthrough.
 

Dynamic testing: Dynamic testing refers to generating test cases according to certain steps and driving the program under test to find errors, including basic path, symbol testing, logic-driven coverage, loop testing, data flow testing and other methods.

There are several ways to design test cases using white box technology:
Logic coverage method,
base path test method,
loop statement test,
data flow test,
code inspection,
jurisdiction test method,
symbol test method,
dynamic white box testing technology

Black box testing

Black box test: Knowing the functional design specifications of the product, tests can be performed to prove whether each implemented function meets the requirements. White box testing: Knowing the internal working process of the product, testing can be used to prove whether each internal operation meets the design specifications and whether all internal components have been checked.
Black-box testing of software means that testing must be performed at the interface of the software. This method regards the test object as a black box, and the tester does not consider the logic structure and internal characteristics of the program at all, and only checks whether the function of the program meets its functional description based on the program's requirements specification. Therefore, black box testing is also called functional testing or data-driven testing.

The difference between black box testing and white box testing:

Any engineering product (note that it is any engineering product) can use one of these two methods for testing. Because they have different advantages and disadvantages, we will use them together in our work. Let's take a look at the difference between the two in detail.
Black box testing is mainly to find the following types of errors:
1. Is there any incorrect or missing function?
2. On the interface, can the input be accepted correctly? Can the correct result be output?
3. Is there a data structure error? Or external information (such as data files) access errors?
4. Does the performance meet the requirements?
5. Are there any initialization or termination errors? The
white box test mainly wants to check the program modules as follows:
1. All of the program modules Test the independent execution path at least once.
2. For all logical judgments, the two cases of "true" and "false" can be tested at least once.
3. Execute the loop body within the boundary of the loop and the boundary of the operation.
4. Test the validity of internal data structures, etc.

It can be seen that multiple test methods cannot guarantee that the software program is error-free. Software testing has a fatal flaw, that is, incomplete and incomplete testing. Therefore, in daily work, the program can only perform a small amount of limited testing (relative to the huge number of exhaustion).

Here, I suggest interested friends. If you need a detailed understanding, you can look for conceptual books, or search the database online. Here is a website: Niuke.com. There is a question bank on it, which is convenient for everyone to read. For beginners and those who like to watch videos to learn, I suggest you go to: MOOC.com.

In fact, there are a lot of materials, what others have summarized, and those in contact with yourself, are good at summarizing and sorting out, and become your own!

Guess you like

Origin blog.csdn.net/Yorkie_Lin/article/details/79528097