当前位置:网站首页>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
边栏推荐
- Will domestic software testing be biased
- ES6 note 1
- 嵌入式面试题(算法部分)
- 我感觉被骗了,微信内测 “大小号” 功能,同一手机号可注册两个微信
- Desci: is decentralized science the new trend of Web3.0?
- 微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
- Rules for filling in volunteers for college entrance examination
- Cloud security daily 220707: Cisco Expressway series and telepresence video communication server have found remote attack vulnerabilities and need to be upgraded as soon as possible
- The moveposition function of rigidbody2d of unity2d solves the problem of people or screen jitter when moving
- Review of network attack and defense
猜你喜欢

标准ACL与扩展ACL

如何选择合适的自动化测试工具?

企业展厅设计中常用的三种多媒体技术形式
![Kirk borne's selection of learning resources this week [click the title to download directly]](/img/df/98aa3edf0a70b870684963d52e7c72.png)
Kirk borne's selection of learning resources this week [click the title to download directly]

微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案

单臂路由和三层交换的简单配置

ES6笔记一
![Interview vipshop internship testing post, Tiktok internship testing post [true submission]](/img/69/b27255c303150430df467ff3b5cd08.gif)
Interview vipshop internship testing post, Tiktok internship testing post [true submission]

前首富,沉迷种田

ES6 note 1
随机推荐
Thread factory in thread pool
Comparison and selection of kubernetes Devops CD Tools
体总:安全有序恢复线下体育赛事,力争做到国内赛事应办尽办
PTA 1101 B是A的多少倍
How to implement safety practice in software development stage
行业案例|数字化经营底座助力寿险行业转型
Borui data was selected in the 2022 love analysis - Panoramic report of it operation and maintenance manufacturers
伺服力矩控制模式下的力矩目标值(fTorque)计算
SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
【Base64笔记】「建议收藏」
Datasimba launched wechat applet, and datanuza accepted the test of the whole scene| StartDT Hackathon
Cadre de validation des données Apache bval réutilisé
Wireshark analyzes packet capture data * cap
低代码助力企业数字化转型会让程序员失业?
LeetCode 497(C#)
Complete e-commerce system
面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
10 schemes to ensure interface data security
线程池的拒绝策略
ES6 note 1