Smart test
Pros and cons of white box testing and black box testing
White box testing and black box testing are two basic methods of software testing.
White box testing is also called structural testing, transparent box testing, logic-driven testing or code-based testing. White box testing is a method of designing test cases. The box refers to the software being tested, and the white box refers to the visual box. You know what is inside the box and how it works. The "white box" method has a comprehensive understanding of the internal logical structure of the program and tests all logical paths. The "white box" method is an exhaustive path test. When using this scheme, the tester must check the internal structure of the program, start from the logic of the check program, and get the test data. The number of independent paths throughout the program is astronomical.
Black box test is also called function test, which is to test whether each function can be used normally. In the test, the program is regarded as a black box that cannot be opened. The program interface is tested without considering the internal structure and internal characteristics of the program. It only checks whether the program functions are used normally according to the requirements specification. Whether the program can properly receive input data and generate correct output information. Black box testing focuses on the external structure of the program, without considering the internal logical structure, and mainly tests the software interface and software functions.
Pros and cons of white box testing and black box testing
The advantages and disadvantages of white box testing
White box test advantages:
1. Forcing testers to think carefully about the implementation of the software;
2, each branch and path in the code can be detected;
3. Reveal the errors hidden in the code;
4. Test the code more thoroughly;
5. Transformation.
Pros and cons of white box testing and black box testing
Disadvantages of white box testing:
1. Expensive, when the system is huge, the test overhead will be very large;
2. The test is based on the code. It can only test whether the developer is doing it correctly, but cannot know whether the design is correct. Some functional requirements may be missed, and it is impossible to detect missing paths and data sensitivity errors in the code;
3. Without verifying the correctness of the specifications, there will be many different paths for the program to run, and it is impossible to test all the running paths.
Black box testing advantages and disadvantages
Black box test advantages:
1. It is relatively simple and does not need to understand the internal code and implementation of the program;
2, has nothing to do with the internal realization of the software;
3. From the user's point of view, it is easy to know which functions the user will use and what problems they will encounter;
4. Based on the software development document, so you can also know which functions in the document are implemented by the software;
5. It is more convenient when doing software automation testing.
Pros and cons of white box testing and black box testing
Black box test disadvantages:
1. The result depends on the design of the test case. The design of the test case is partly superior to experience, and the coverage rate is relatively low, which can only reach 30% of the total code;
2. The reusability of automated testing is low, there is no concept of state transition, and the state transition of the program under test cannot be realized.