当前位置:网站首页>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
边栏推荐
- Calculation of torque target value (ftorque) in servo torque control mode
- 二叉树的基本概念和性质
- [Tawang methodology] Tawang 3W consumption strategy - U & a research method
- How many are there (Lua)
- 单臂路由和三层交换的简单配置
- IP netns command (memo)
- Idea completely uninstalls installation and configuration notes
- [sword finger offer] 59 - I. maximum value of sliding window
- ip netns 命令(备忘)
- 线程池中的线程工厂
猜你喜欢
In 2021, the national average salary was released. Have you reached the standard?
Nunjuks template engine
完整的电商系统
Redis
Calculation of torque target value (ftorque) in servo torque control mode
数据验证框架 Apache BVal 再使用
RISCV64
微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案
Antisamy: a solution against XSS attack tutorial
【软件测试】从企业版BOSS直聘,看求职简历,你没被面上是有原因的
随机推荐
6. About JWT
【HDU】5248-序列变换(贪心+二分)「建议收藏」
Kirk borne's selection of learning resources this week [click the title to download directly]
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
完整的电商系统
PTA 1102 教超冠军卷
SQLite SQL exception near "with": syntax error
POJ 2392 Space Elevator
直播预约通道开启!解锁音视频应用快速上线的秘诀
二叉树的基本概念和性质
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
强化学习-学习笔记8 | Q-learning
3.关于cookie
Reinforcement learning - learning notes 8 | Q-learning
Will low code help enterprises' digital transformation make programmers unemployed?
学习open62541 --- [67] 添加自定义Enum并显示名字
RIP和OSPF的区别和配置命令
The moveposition function of rigidbody2d of unity2d solves the problem of people or screen jitter when moving
SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
Wireshark analyzes packet capture data * cap