当前位置:网站首页>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
边栏推荐
- How many are there (Lua)
- Thread pool and singleton mode and file operation
- Yunjing network technology interview question [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]
- Complete e-commerce system
- Wireshark analyzes packet capture data * cap
- Static routing configuration
- unity2d的Rigidbody2D的MovePosition函数移动时人物或屏幕抖动问题解决
- Nat address translation
- 如何选择合适的自动化测试工具?
- 【Unity Shader】插入Pass实现模型遮挡X光透视效果
猜你喜欢
[unity shader] insert pass to realize the X-ray perspective effect of model occlusion
行业案例|数字化经营底座助力寿险行业转型
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
Comparison and selection of kubernetes Devops CD Tools
3.关于cookie
企业展厅设计中常用的三种多媒体技术形式
In 2021, the national average salary was released. Have you reached the standard?
Nat address translation
Three forms of multimedia technology commonly used in enterprise exhibition hall design
6.关于jwt
随机推荐
How to implement safety practice in software development stage
Reuse of data validation framework Apache bval
Draw squares with Obama (Lua)
[C language] string function
嵌入式面试题(算法部分)
Antisamy: a solution against XSS attack tutorial
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
2022-07-04 matlab读取视频帧并保存
A hodgepodge of ICER knowledge points (attached with a large number of topics, which are constantly being updated)
手把手教姐姐写消息队列
ES6 note 1
高考填志愿规则
Teach your sister to write the message queue hand in hand
企业展厅设计中常用的三种多媒体技术形式
Comparison and selection of kubernetes Devops CD Tools
String type, constant type and container type of go language
Nat address translation
SD_ DATA_ SEND_ SHIFT_ REGISTER
Borui data was selected in the 2022 love analysis - Panoramic report of it operation and maintenance manufacturers
The moveposition function of rigidbody2d of unity2d solves the problem of people or screen jitter when moving