What are the classifications of software testing based on software testing

There are actually many ways to classify software testing . They are classified from different dimensions, and the types are completely different. Usually , testing methods can be classified from three dimensions .

(1) Classification from the perspective of the tested object. Classified from the perspective of the tested object, testing can be divided into black box testing, white box testing and gray box testing.

(2) Classify from the perspective of whether the tested object is running or not. From the classification of whether the tested object is running, the test can be divided into dynamic test and static test.

(3) Classification from the perspective of tools used in test execution. From the perspective of the tools used in test execution, testing can be divided into manual testing and automated testing.

1. The difference between black box, white box and gray box testing

Classified from the perspective of the tested object, the test methods can be divided into three types: black box test, white box test, and gray box test , which is also the most commonly seen classification method.

Any program is composed of these parts during testing: input, program processing and output , as shown in Figure 1-1. Black-box testing refers to only focusing on input and output during the entire testing process. If a test data is input and the output result is correct, we consider this function to be correct. For example, input test data (2,2), and if the output is 4, it is considered correct. The test engineer does not pay attention to how the program is processed. It may be 2×2, 2+2, or twenty two. Of course, if you don't know how the program handles it, then after another set of data, the result you may get may not be correct. For example, if you input (3,3), the result may not be correct.

Software testing basics to project actual combat

The difference between white box testing and black box testing is that white box testing not only focuses on whether the input and output results are correct, but also pays attention to how the program is processed. The same is the above example, input test data (2,2), White box testing not only pays attention to whether the test result is 4, but also pays attention to the internal logic processing process of this program.

Regarding black-box testing and white-box testing, it is actually like two kinds of people in society. Black-box testing is equivalent to the underworld, and white-box testing is equivalent to the white way. If the boss of the underworld wants to solve something, they will send their subordinates to deal with it, and the boss only pays attention to the result. As for how to deal with it in the middle, it has nothing to do with him. The Baidao people are what we call civil servants. They have a good understanding of the entire process of handling affairs or the legal system. For example, if your relative fights with someone and beats someone up, the first thing you do is not to report the crime, but to contact your friends to see if there are any acquaintances in the court, police station or other relevant departments, because these people are very familiar with the legal process. Familiar, they know how to minimize your relative's responsibilities.

But there is another type of people in this society who eat black and white. This is the gray box test in our test category. Gray box test is a test between black box test and white box test. The reason why gray box testing exists is that it is divided according to the testing phase. The entire testing process includes unit testing, integration testing, and system testing, while white box testing corresponds to unit testing, and black box testing corresponds to system testing. Then in the correct testing process In the above, the unit module should be tested first. After the unit module test is completed, it does not immediately enter the system test, but the integration test. At this time, the method used is the gray box test, that is, after we test a single module, although the single module does not Problems, but it does not mean that there will be no problems when these modules are combined together. Then to verify that there is no problem with the combination of these functional modules, this is what we call integration testing, and the method of use is gray box testing.

From a certain point of view, white-box testing is obviously more comprehensive than black-box testing, because they not only pay attention to the test results, but also pay attention to the internal logical structure of the program, so some people ask why not just white-box testing? The answer is obviously yes of. Discussing this extreme problem, the reverse problem is what is the content of black box testing that cannot be achieved by white box testing. We say that black-box testing is a test that is closer to user use, so aspects such as user process and usability cannot be tested by white-box testing, that is, if there is no problem with white-box testing, the ease of use of the program cannot be guaranteed There must be no errors in content such as usability, interface display, and business processes. In the same way, black-box testing is obviously not enough, because although black-box testing can better test from the perspective of users, black-box testing cannot test the internal structure of the program as effectively as white-box testing. Therefore, it is not extreme to think that only white-box testing or only black-box testing can test a good system.

So now there are three types of methods in a complete testing system: black box testing, white box testing, and gray box testing. Only the perfect combination of these three can better ensure the quality of the system. From the perspective of the development of software testing, including domestic software testing, in fact, there is black-box testing before white-box testing. It is impossible to do white-box testing first and then black-box testing, and at this stage, few companies in China do it. White-box testing, the reason for this situation is that white-box testing has much higher skill requirements for test engineers. At the same time, another reason is that the current domestic software testing development is still in its infancy, so white-box testing is not carried out. not ideal.

2. The difference between dynamic and static testing

If it is divided from the perspective of whether the object under test is run, the test can be divided into static test and dynamic test. Static testing refers to a testing technique that does not run the software system under test, but uses other means and techniques to detect the software under test.

For example: code walk-through, document review, program analysis, etc. are all in the category of static testing. Commonly used static analysis techniques include: control flow, information flow, and data flow, but these methods are actually less practical now, because many problems are solved in the editor. In our testing process, the most used static test is to review the documents. Of course, the issues that different documents focus on during the review are completely different.

Dynamic testing refers to a testing technique for testing the software system under test by running the software system under test according to pre-designed data and steps. If it is divided by stage, the common dynamic testing method in unit testing is the method of logic coverage, and in the system testing phase, the tests we do are all dynamic tests, because we need to run the system to verify whether the system functions are correct.

Dynamic testing provides information on execution tracking, timing analysis, and test coverage by observing the behavior of the code while it is running. Dynamic testing finds bugs by actually running the program. Analyze the operation of the program under test through effective test cases and corresponding input/output relationships.

3. The difference between manual and automated testing

From the perspective of tools used in test execution, testing can be divided into manual testing and automated testing. Manual testing means that the entire process of software testing (such as review, test design, test execution, etc.) is the most basic form of testing.

Automated testing uses software to control the test execution process, compares whether the actual results are consistent with the expected results, sets test preconditions and other test control conditions, and outputs test reports. Usually, automated testing needs to automate the already formalized manual testing process at the appropriate time.

In the past few years, almost all tests were performed manually. In recent years, automated testing has gradually begun to develop. Some mature companies have begun to have professional teams to do automated testing. So why does automated testing exist? In fact, it also has its own reasons, and it does not appear for no reason.

As the system is becoming more and more complex, if the version is upgraded and some requirements are added, then we must conduct a comprehensive regression test on the entire system, but this will take a huge time cost. For example, the homepage of China Ping An http://www.pingan.com is bound to many subsystems, including Ping An Bank, Ping An Finance, Ping An Insurance, etc. If you are only upgrading a few requirements now, you must conduct a comprehensive test on all functions, and such a large system has at least 3,000 function points, so a round of regression testing may require hundreds of people every day, and the cost is huge. Yes, so at this time we must solve the problem of regression testing through automated testing, thereby saving testing costs.

And even if we do not consider the issue of time cost, manual testing cannot fully return. In Section 1.3, we have introduced the situation of testing mentality. If we continue to test a function and there is no problem after several rounds of testing, then in the next round we will Testing may not be done carefully and comprehensively, resulting in some issues being missed. But if we use an automated testing tool, this problem does not exist, because the tool does not know how many rounds it has tested.

Therefore, automated testing and manual testing should be used in combination with each other, and there cannot be only automated testing without manual testing, because it is very clear in the concept of automated testing: "Automated testing needs to make the already formalized manual testing process Automation." In other words, the first round of testing is not allowed to do automated testing, the first round must be manual testing. So only automated testing will not work.

Software testing basics to project actual combat

Guess you like

Origin blog.csdn.net/m0_37449634/article/details/131582224