当前位置:网站首页>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
边栏推荐
- Use of slice grammar sugar in C #
- xutils3修改了我提报的一个bug,开心
- 使用栈来解决”迷你语法分析器“的问题
- ASP. Net 6 middleware series - conditional Middleware
- Tips in MATLAB
- Load view Caton
- 2022g2 boiler stoker examination question bank and online simulation examination
- 2022t elevator repair test simulation 100 questions and online simulation test
- c#语法糖模式匹配【switch 表达式】
- Use split to solve the "most common words" problem
猜你喜欢
![[Mysql] LEFT函数 | RIGHT函数](/img/26/82e0f2280de011636c26931a74e749.png)
[Mysql] LEFT函数 | RIGHT函数

svg标签中利用<polygon/>循环数组绘制多边形

Use of slice grammar sugar in C #

Ide-idea-problem

ASP.NET 6 中间件系列 - 执行顺序

宁德时代地位不保?

MYSQL05_ Ordr by sorting, limit grouping, group by grouping

Blazor University (11)组件 — 替换子组件的属性

2022 Shandong Province safety officer C certificate work certificate question bank and online simulation examination

ASP. Net and ASP NETCORE multi environment configuration comparison
随机推荐
Source code interpretation of Flink index parameters (read quantity, sent quantity, sent bytes, received bytes, etc.)
Array and collection types passed by openfeign parameters
[MySQL] left function | right function
C syntax pattern matching [switch expression]
二进制文件版本控制工具选择难?看完这篇你会找到答案
. net tip: talk about the problem that the scoped service cannot be obtained in the middleware structure
TP5 where query one field is not equal to multiple values
Use of slice grammar sugar in C #
使用DFS来解决“字典序排数”问题
Distributed system services
再战leetcode (290.单词规律)
The backtracking of stack is used to solve the problem of "the longest absolute path of file"
C language to achieve address book - (static version)
Laravel's own paging query
C syntax sugar empty merge operator [?] And null merge assignment operator [? =]
What kind of experience is it to prepare for a month to participate in ACM?
[new version release] componentone added Net 6 and blazor platform control support
A set of C interview questions about memory alignment. Many people make mistakes!
Find the number of leaf nodes of binary tree
Recursion - outputs continuously increasing numbers