The test is always black and white. In general, because white box testing requires logical thinking ability is relatively high technical requirements than the General developer project experience and cautious even higher, and longer test time for unit testing, expensive tools, therefore, domestic enterprises generally ignore white box testing. This is why since its inception the white box test. There is no official promotion in China.
For a healthy test team, there must be one or more people familiar with the white box test. Let us first analyze, under normal circumstances, to implement coverage test. There are several strategies that are completely different.
1 black box test (function test)
The black box test is a function-oriented test. The test example is based on the requirements of the software, testing the object is to execute the software.
usually. An experienced test project that was written according to the requirements specification after execution. Coverage generally can reach about 70%. Requires n working days. To reach the end of the coverage target of 100%, a new test example needs to be added. Friends who have had coverage Test experience know that the remaining 30% may need to be N-3 working days, or even many others. At the same time in order to achieve higher coverage. Generally, there will be a large number of repeated test examples, greatly added test cost.
For the black box test coverage and cost of use:
2 White Box test
Contrary to the black box test, the test case of the white box test is based on the software code. The test project master needs to analyze the logical structure and basic path of the code. Get a test example. Because the method is directly oriented to code. The test examples written are very targeted, each running a use case, coverage indicators can have a new increase, and finally achieve the ultimate goal. Sounds very good, in fact another very big problem is that the test project teacher needs to analyze the logical structure of all the code, call relationships, data flow and so on. Only this one item. It takes a huge amount of time.
In addition, the traditional unit-level white box test only focuses on program coverage, regardless of the program unit combination and integrated system-level functions. For the white box test coverage and cost of use:
Combining the above 2 methods, Threadingtest put forward a new concept namely threading Test (Theadingtest). It uses a combination of white box and black box method, with a black box test method, to obtain a white box test data. Advantages of Combining:
3 Threading Test
Since the above mentioned black box and white box each have merits and demerits, so it is better to adopt the combination of the two methods. The threading test actually belongs to the innovative system-level white box testing tool. It is a new academic genre in the field of software testing. It first tested the main functions with a traditional black box test round. Coverage reached 70%, at the same time the process was monitored by the Threading Test tool and obtained the test result data for that stage, and the second step was the white box result obtained by stringing the test. High-speed positioning the remaining 30% of the code, to be targeted to add test examples. Finally achieve the ultimate goal. After a lot of customer experience. Such a method is most effective for coverage testing. And the test time is the shortest.
Speaking of which, a lot of testers certainly have a strong interest in threading tests. Then we'll use the story to illustrate the traditional white-box test of the Test Personnel requirements Division, and threading test in this area of the response strategy:
A story about code coverage
Early in the morning, a young program ape asked the master: "I am going to write some unit test examples." How much code coverage should be achieved? ”
The master replied: "Don't think about code coverage, just write some good test examples." ”
Young program Ape very happy, bowed, departed.
Not long after, the second program Ape asked the master the same question.
The master pointed to a pot of boiling water and said, "How many meters should I put into this pot?" ”
The ape seems to be stumped by this program. replied: "How can I have an answer?" It depends on how many people you want to eat. They are not hungry. What kind of food do you have? How many meters do you have, and so on. ”
"Totally right. Said the master.
The second program the ape was very happy, bowed and departed.
Finally, a third program ape asked the master the same question about code coverage.
"80%, not less." The master punched the hammer on the table and replied in a stern tone.
The third program ape was very happy. Bow and depart.
A story about code coverage-interpreting
After replying to this, a young intern came to the master's side:
Master I overheard you today. Three different answers to the same code coverage issue. Why? ”
The master stood up from his chair: "Give me some tea, let's talk about this." ”
When the cup is filled with steaming green tea. The master started to say:
"This first program ape is a novice. Just started learning to test.
At the moment he has a large number of programs that are not tested.
He has a very long way to go; he is now being asked for code coverage only to hit him. It's not useful. It is better to let him slowly learn to write some test examples, test. He was able to consider code coverage later. ”
"And this second program of apes. Both the programming and the test are very experienced.
I will answer by asking. Ask her how many meters she should put in the pot. There are so many factors that make her decide how much to test the sample, and she knows more about these factors than I do-after all, her own code. There is no simple, straightforward answer to this question. With her cleverness, it is clear that this is the right thing to do. ”
"I made it clear. "said the young intern. "But assuming there is not a straightforward answer, why did you tell the third program that Ape ' 80%, not less '? ”
The master laughed and the green tea was blown out.
"This third program ape just wants a simple answer-even if there is no simple answer ... And even if there is an answer, she will not follow the answer.
”
Young interns and grizzled masters drank tea in contemplation.
From the above story we can find:
The first novice tester needs to be trained for a very long period of time for coverage testing.
The second experienced tester needs to be familiar with programming and testing as well as the overall measurement process when it comes to coverage testing.
The third explanation is that the coverage index is clearly required when the test personnel are tested for coverage.
But in the actual operation process, the domestic due to white box test personnel scarce. The long and expensive training cycle and the requirements for test progress have led to slow development.
For the case of white box, threading test to put forward a new approach.
The above mentioned the threading test through the original black box test method, to obtain the white box results, which makes the test difficulty and test personnel's ability requirements greatly reduced, and on this basis. In order to make the white box test results more convenient to understand, threading test has put forward a visual code coverage. With a simple graphical display, the majority of black box testers who do not understand the internal structure of the code and the program can also perform master-level code coverage tests.
Example: Seen as a threading test for the theory, the product of the tool Threadingtest:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdghyzwfkaw5ndgvzddiwmtq=/font/5a6l5l2t/fontsize/400/fill/ I0jbqkfcma==/dissolve/70/gravity/southeast ">
Figure Coverage SC0 Explanation:
Paragraph
A sequence of computer program statements between two successive branch points is called as a segment.
"Visible Segments"
The maximum possible non-conditional statement sequence within a control layer is called a visual segment. The length of the viewable segment between two nodes may be 0 (there is no statement to run).
SC0
The basic section test coverage metric is also known as block test coverage. Assuming that all visible segments of the program (the program block) are run at least once, the SC0 coverage of this program reaches 100%.
sc0= number of blocks to be run/number of blocks included in the program (you can see the number of segments)
In the diagram. We clearly see how the coverage of the function is SC0 and how it is computed. and show the relevant code, in such a way, can make the vast number of non-contact Code test personnel, through the black box measurement is the way, to find out the coverage of the code is not covered to the part of the test example of the supplement, so as to enhance the production of test examples, and improve test quality.
In Threadingtest, there are also partition descriptions for other coverage, such as true (percent of true conditions), BOTH (percent of coverage for true and false), Branch (branch coverage), MC/DC, and so on.
Please pay attention to the coverage analysis in the official technical site www.threadingtest.com , with specific explanations and calculations.
Test coverage effect
Test coverage is part of the test end criteria
Test coverage of modules and critical modules with low coverage. These data can help us to locate many other test modules at high speed, which can help us understand the test situation of the important modules. This is to measure the quality of our test samples and even test quality.
In the spiral development model, let's say we don't have control over the test coverage in our last iteration, when a version number
Once a version number has been added up, it is very difficult to determine which of our modules did not give enough testing during the development process.
Make the next phase effective test plan through coverage
Report on test coverage
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdghyzwfkaw5ndgvzddiwmtq=/font/5a6l5l2t/fontsize/400/fill/ I0jbqkfcma==/dissolve/70/gravity/southeast ">
Through the coverage of the show, we are able to conduct the next test of the overall direction plan.
Check for unused features
Check the minimum coverage for the first 10
The strengthening of the test example
Threading test coverage and validation phase
The validation phase can be divided into the unit validation (UT) phase, the integrated validation (IT) phase, and the system validation (ST) phase.
Unit validation phase, which is concerned with module function and module quality. The export condition is code coverage at this point. The general industry commonly used export conditions are: line coverage reached 100%, branch coverage reached 100%, the condition coverage reached 95%. The need to give a reasonable description of the absence of coverage.
Integration Validation phase. The functions of the system concerned, as well as the interface between the module and the module, at this time the export conditions for functional coverage.
The general industry commonly used export conditions are: the functional coverage of 90%, the need to give a reasonable description of the lack of coverage.
? High functional coverage and low code coverage:
Verify that the plan is insufficient and you need to add a feature overlay.
? High code coverage and low functional coverage:
The design does not implement the specified functionality.
Threading to meet test coverage. Achieve Best practices
Traditional white-Box testing
Path coverage > Condition overrides > Decision overrides > Statement overrides
Test coverage 100% is an ideal situation that is very difficult to achieve
Test coverage 100% doesn't indicate that we did a total test.
Test coverage to consider the overall coverage of the software, as well as project costs, including manpower, time and so on.
Because of the above factors, so the traditional white box test is not recommended to meet the company's special coverage test indicators, in order to test and test.
The threading test is a unified management of test data for traditional white box test results. Achieve each stage of the accumulation. Shorten the time to repeat the test. So that the test 100% coverage of high-quality.
Judging from the original test. The test data of the unit Test stage, the integrated test stage and the system test phase are separated from each other in the normal test, but in the actual process, the adequacy degree of the Unit test, the integration test of the late, the system test and so on have played a correlation role, in this part of the threading test using the cumulative coverage of the technology, The test results are used and accumulated throughout the test, so that the whole test iteration plays a role in quantifying correlation. Can be analyzed and improved at any time at all stages of testing.
Compared to the traditional unit-level white box test, threading test also put forward the distribution test method, for medium and large-scale software or site, a single test personnel can not complete the test task, in order to better cooperate with each other. Threadingtest used a distributed test design, in the test process, test personnel can be in different locations, at the same time a program or site of the different modules to test, test results in the case of non-interference with the aggregation of the central server, This results in a unified management of test data for each person on a daily basis, thus effectively quantifying the overall test progress.
The appearance of threading test and the reform of testing field
The Commercial test tool product Threadingtest the threading concept into a practical product-by-tool approach. The black box test staff can also conduct a code-level white box test, and the entire test phase of the process of quantitative management, through the black box test to achieve the white box results display. The test method is the most effective 70% black box +30% white box combined.
Threading test broke the traditional white box test operation is difficult, too much pursuit of coverage, and so on, through the combination of black box and white box, so that all stages of testing personnel, can correctly according to their own needs to test, so as to avoid blindness, repetition, omission and other issues.
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
Threadingtest (threading test) leading white box into this industry