当前位置:网站首页>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
边栏推荐
- Big Ben (Lua)
- Redis的发布与订阅
- 基于图像和激光的多模态点云融合与视觉定位
- 2022上半年朋友圈都在传的10本书,找到了
- 静态路由配置
- Comparison and selection of kubernetes Devops CD Tools
- [sword finger offer] 59 - I. maximum value of sliding window
- Reinforcement learning - learning notes 8 | Q-learning
- Simple configuration of single arm routing and layer 3 switching
- 【Base64笔记】「建议收藏」
猜你喜欢

Comparison and selection of kubernetes Devops CD Tools

Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month

Borui data was selected in the 2022 love analysis - Panoramic report of it operation and maintenance manufacturers

Do you know all four common cache modes?

完整的电商系统

【软件测试】从企业版BOSS直聘,看求职简历,你没被面上是有原因的

低代码助力企业数字化转型会让程序员失业?

Basic operation of chain binary tree (implemented in C language)

2022.07.02

3.关于cookie
随机推荐
将模型的记忆保存下来!Meta&UC Berkeley提出MeMViT,建模时间支持比现有模型长30倍,计算量仅增加4.5%...
Datasimba launched wechat applet, and datanuza accepted the test of the whole scene| StartDT Hackathon
testing and SQA_动态白盒測试[通俗易懂]
3. About cookies
链式二叉树的基本操作(C语言实现)
高考填志愿规则
Continuous test (CT) practical experience sharing
Save the memory of the model! Meta & UC Berkeley proposed memvit. The modeling time support is 30 times longer than the existing model, and the calculation amount is only increased by 4.5%
【塔望方法论】塔望3W消费战略 - U&A研究法
Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month
PTA 1102 教超冠军卷
IP netns command (memo)
鸿蒙智能家居【1.0】
直播预约通道开启!解锁音视频应用快速上线的秘诀
【MIME笔记】
ip netns 命令(备忘)
Redis的发布与订阅
String type, constant type and container type of go language
[tpm2.0 principle and Application guide] Chapter 9, 10 and 11
强化学习-学习笔记8 | Q-learning