当前位置:网站首页>General test technology [II] test method
General test technology [II] test method
2022-04-23 03:12:00 【A happy wild pointer D】
1. Division of equivalence class
Divide the input field of the program into several parts , Then select a few representative data from each part for testing .
Effective equivalence class : It is reasonable for the tested object 、 meaningful 、 Acceptable input . In a nutshell Correct data .
Invalid equivalence class : It is unreasonable for the tested object 、 Meaningless 、 Unacceptable input . In short, that is bad data .
give an example : The length of the specified user name is 6-18 position , If the input data is within this length , It's the efficient equivalence class . Not in this range ( Less than 6 Bit or more 18 position ), Is an invalid equivalence class . therefore , When designing use cases , In response to this request , One forward use case and two reverse use cases can be designed .
Use case design method :
Design Forward use cases when , Make it Cover as many valid equivalence classes as possible . Repeat this step , Until all valid equivalence classes are covered by test cases .
Design Reverse use case when , Make it Only one invalid equivalence class is overwritten . Repeat this step , Until all invalid equivalence classes are covered by the use case . With the thinking of scientific experiment , Namely Control variable method .
2. Boundary value analysis
This is usually used as a supplement to the equivalence class division method , Mainly for Boundary value of input or output To test .
namely : If the input condition specifies the value range , Then take the boundary value and the value closest to this boundary to test .
give an example : Assume that the value range of age is [18,30], Then its boundary value is 18,30, The numbers closest to these two boundaries are 17,19 and 29,31. therefore , This can be tested as six boundary values . If the test time is tight , Or you can just take 17、18 and 30、31.
If it's an open interval (18,30) Words , Because age can only be rounded , So essentially , Its value range is [19,29] Between , That is, its boundary value is 19,29. The nearest number to the boundary is 18,20 and 28,30. Thus we can see that , Under this condition, the boundary value of age has 18,19,20 and 28,29,30.
Some common boundary values : The second part of the cycle 0 Time 、 for the first time 、 The penultimate and last ; The first and last elements of an ordered set ( Such as the drop-down list ); Having some development knowledge can also help us dig out the hidden boundary value conditions , Such as java in byte The value range of type is [-128,127] etc. .
3. Decision table ( Decision table )
It is mainly used for A combination of multiple conditions And result analysis .
Design steps :
(1) Determine the number of rules
Suppose there is n Input conditions , The rules are 2^n individual ( Because each condition has only two values , True or false ), This is the number of columns in the initial decision table .
(2) List all condition piles and action piles
Condition stake : All input conditions
Action post : All output conditions
(3) Fill in the condition item and action item , Get the initial decision table
Condition item : The specific value of this condition ,0 or 1
Action items : The output result obtained by the combination of all condition items
(4) simplify 、 Merge similar rules or actions
The rules : A column is a rule
give an example : see Qianfeng test course P66- Decision table analysis , Or find it online by yourself .
notes 1: There can only be two conditions , If not , Then the decision table... Does not apply .
notes 2: Sometimes there are too many conditions , It's impossible to finish the whole list or test , We need to optimize . The optimization strategy is uniform coverage , Make each condition take true and false values . for example :
4. Cause and effect diagram
According to the combination of input conditions 、 Constraints and output conditions Causal relationship , Various combinations of input conditions are analyzed , So as to design test cases .
The advantage of cause and effect diagram is Find deficiencies in the design . For some cases with only input and no output , This is a kind of defects , Can't be designed as a test case . Use case writing should focus on requirements , There are no output results in the requirements , Then you can't write it out . You can talk to the product manager first , Perfect the needs , Then add use cases . exemplars : Qian Feng Test course P63-- Vending machine case .
Cause and effect diagram example :
notes : Cause and effect diagrams and decision tables are Based on positive thinking Use cases for design . Although both of them are multi combination analysis for input conditions , But the cause and effect diagram is more Focus on the relationship between input conditions 、 Causality between input and output .
5. Orthogonal test method
factor 、 factors : The amount that affects the experimental results
level : The value of the factor
The orthogonal test method is only applicable to The number of levels is the same The situation of . If the factor A Yes 3 Species value , factor B Yes 4 Species value , Then this situation is not within the scope of application of the orthogonal test method .
Design steps :(1) Analyze all factors that affect the results
(2) Analyze the number of levels of each factor
(3) Choose the right orthogonal table , Find the closest . Generally speaking , Will be greater than the actual number of factors and levels
Tools : Orthogonal design assistant . Input factors and levels , Can automatically generate orthogonal results .
6. Scene method
be based on Business scenario ( The user's operation process , Right or wrong ) To design test cases .
Basic flow : All operations are correct , The process that can finally achieve the goal .
Alternative streams : Some operations are wrong , This leads to repeated processes , But in the end, the process that can achieve the goal .
Abnormal flow : Operation error leads to the process that fails to achieve the goal in the end .
give an example : Go to ATM Machine withdrawal .
① The card inserted is right , It's a bank card that can be used ; The password is entered correctly , The amount of money entered does not exceed the balance of the card and ATM There's so much money in the plane , Finally got the money . This is the basic flow , There is no problem with the operation of the whole process .
② Wrong card , Reinsert the right card ; Wrong password , Lose again , by the way ; The amount of money entered does not exceed the balance, nor does it exceed ATM The money in the plane , Finally, I took out the money . This is an alternative stream , Although there was a mistake on the way , But in the end, the goal was achieved .
③ The card is right , The password was entered incorrectly three times , The card is frozen , Can't withdraw money . This is abnormal flow , The business process has not reached the end .
Use case design steps :(1) Find out the basic flow of the program ( The right process ) And alternative streams 、 Abnormal flow ( The wrong link )
(2) Analyze business processes , Draw a flow chart ;
(3) A path is a scene .
7. Function diagram method
It's a little complicated. , Don't know much about , Too lazy to write. , Let's see later .
8. Wrong guess
Infer errors in the program based on experience and intuition , So as to design test cases .
9. Other design methods
9.1 Test outline method
Focus on needs , List various test conditions , Translate requirements into outlines .
Tree mind map , A test case starts from the root node to the leaf node . therefore , This method does not need to write specific test cases .
9.2 Exploratory testing
Based on experience and intuition
9.3 Monkey test
Unconscious behavior , Mess up like an ignorant monkey , Found some unexpected mistakes .
You don't have to write use cases .
版权声明
本文为[A happy wild pointer D]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220627538144.html
边栏推荐
- 【无标题】
- TP5 inherits base and uses the variables in base
- xutils3修改了我提报的一个bug,开心
- 先中二叉建树
- Simple example of using redis in PHP
- Establishing and traversing binary tree
- ASP.NET 6 中间件系列 - 执行顺序
- Systemctl start Prometheus + grafana environment
- 7-11 rearrange the linked list (25 points)
- Mise en service PID du moteur de codage (anneau de vitesse | anneau de position | suivant)
猜你喜欢
[untitled]
Judge whether there is a leap year in the given year
Tencent video price rise: earn more than 7.4 billion a year! Pay attention to me to receive Tencent VIP members, and the weekly card is as low as 7 yuan
ASP.NET和ASP.NETCore多环境配置对比
准备一个月去参加ACM,是一种什么体验?
《C语言程序设计》(谭浩强第五版) 第8章 善于利用指针 习题解析与答案
搭建XAMPP时mysql端口被占用
Ningde's position in the times is not guaranteed?
Source generator actual combat
xutils3修改了我提报的一个bug,开心
随机推荐
[untitled]
一套关于 内存对齐 的C#面试题,做错的人很多!
The most detailed in the whole network, software testing measurement, how to optimize software testing cost and improve efficiency --- hot
Mysql database design specification
准备一个月去参加ACM,是一种什么体验?
Detailed log display of openfeign call
IOTOS物联中台对接海康安防平台(iSecure Center)门禁系统
be based on. NETCORE development blog project starblog - (2) environment preparation and creation project
MYSQL_ From mastery to abandonment
xutils3修改了我提报的一个bug,开心
TP5 inherits base and uses the variables in base
yes. Net future
Tencent video VIP member, weekly card special price of 9 yuan! Tencent official direct charging, members take effect immediately!
[MySQL] left function | right function
由于3²+4²=5²,所以称‘3,4,5‘为勾股数,求n(包括n)以内所有勾股数数组。
C language to achieve address book - (static version)
Preview of converting doc and PDF to SWF file
A set of C interview questions about memory alignment. Many people make mistakes!
MAUI初体验:爽
ASP.NET 6 中间件系列 - 自定义中间件类