当前位置:网站首页>testing and SQA_ Dynamic white box test [easy to understand]

testing and SQA_ Dynamic white box test [easy to understand]

2022-07-07 19:09:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm the king of the whole stack .

One 、 Software Testing Technology : Black box : Without knowing the internal structure of the program , The testing technology or strategy used only when the program structure is known . White box : The testing technology or strategy adopted when the internal structure of the program is known . Two test methods from different angles , It reflects different aspects of the software . Also try to use it in different development environments .

Two 、 White box method is also called logical covering method . The coverage method often used nowadays : skill : Conditional combination covering > Determine coverage > Statement override Path coverage > Determine coverage > Statement override 1、 Statement override —— Each statement runs at least once

Test case : A=2 , B=0 , X=4.

2、 Determine coverage ( Branch coverage )—— Each determined branch runs at least once Test cases:①A=3 , B=0 , X=3②A=2 , B=1 , X=1

3、 Conditional coverage —— That is, an inference statement often includes several conditions . By giving test cases , Make every condition in the inference obtain various possible results . Test cases: ①A=2 , B=0 , X=4( Satisfy A>1, B=0; A=2, X>1) ②A=1,B=1, X=1

4、 infer / Conditional coverage —— Select enough test data . Make every condition in inference obtain various possible values . And make every inference expression get all kinds of possible results .

5、 Conditional combination covering —— Make every possible combination of conditions in every inference appear at least once .

3、 ... and 、 Least use case calculation method To achieve the logical coverage of the test , Enough test cases must be designed , And use these test cases to run the program under test , Implement tests . What we care about is , For a detailed program , At least how many test cases should be designed . Here is a way to estimate the minimum number of test cases . We know , Structured programs are made up of 3 It consists of three basic control structures , this 3 One basic control structure is : Sequential type —— Constitute serial operation . Selective type —— Form a branch operation ; Repetitive —— Constitute a cyclic operation . To simplify the problem . Avoid the combination explosion of too many test cases , Replace the repetitive structure that forms the circular operation with the selective structure . in other words , You don't expect the test loop to run all over again , It's just a circular physical examination . such . Any cycle will be transformed into a branch operation that enters the cycle body or does not enter the cycle body . The following figure shows a similar flow chart N-S The basic control structure shown in Fig ( In the figure A、B、C、D、S Both indicate the operation to be run ,P Is a predicate that takes true and false values ,Y Table truth value ,N Table false value ). Middle picture 9(c) Sum graph 9(d) Two repeating structures represent two cycles . After making the above simplified cycle, if . For general program control flow . We only consider alternative structures . In fact, it can already reflect the sequential and repetitive structure .

Several related exercises to help understand : 1. For example, the following figure shows two branch structures running in sequence . Two branch predicates P1 and P2 When taking different values , Will run separately a or b And c or d operation . obviously , To test this applet , At least 4 Only test cases can achieve logical coverage . bring ac、ad、bc And bd The operation has been verified . in fact , there 4 It's the... In the picture 1 Two operations derived from branch predicates . And the first 2 Two branch predicates lead to a combination of two operations , namely 2×2 = 4. and . there 2 Because of two parallel operations ,1 + 1 = 2 And obtained .

2. The program shown in the figure below is an example , This program is jointly owned 9 Branch predicates , Although these branching structures seem to be very complex . It is very difficult to see at a glance how many test cases should be needed at least . We noticed that the figure can be divided into two levels : Branch predicate 1 The operation domain of is the upper layer , Branch predicate 8 The operation domain of is the lower level . These two layers are just like in the previous simple example P1 and P2 Same relationship . Just get the number of test cases of the two layers . Then multiply them to get the total number of test cases . Here we need to first consider the more complex superstructure . The predicate 1 The operation to be done when not satisfied can be further decomposed into two layers , This is the subgraph of the graph (a) and (b). The number of test cases they need is 1+1+1+1+1 = 5 And 1+1+1 = 3. Therefore, the two-tier combination , obtain 5×3 = 15. So the number of test cases required for the upper layer of the whole program structure is 1+15 = 16. And the lower layer is obviously 3. Therefore, the number of test cases required for the whole program is at least 6×3 = 48.

computing method :

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116607.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071653296769.html