History of the most detailed test case design methods and case

Test case design methods

Equivalence classes

Individualized examples:

In principle, all teachers should be developed according to each student's learning in line with the corresponding learning programs, but in fact too many students, teachers pipe, however, can only speak the students were divided into three rank or grade, honors emphasize knowledge of expansion and upgrading of capacity, secondary students stressed that solid foundation, Network access, poor students stressed the priority master key and temporarily escape the difficulty .......

Ideas: a set of inputs is infinite, can not cover all

Equivalence classes: according to demand input into several equivalence classes, choose a test case from the equivalence class , if the test case test passes, the test that the whole equivalence class represented by, so you can fewer test cases to reach as many functional coverage, to solve the problem can not be exhaustive tests

Drawbacks: equivalence class only consider the classification of input fields, without considering the combination of input fields , the need for other design methods and supplements 

  • Effective equivalence classes : for the specification of the program is a collection of reasonably meaningful input data constituted by the effective equivalence class verify the program to achieve the functions and performance specifications as specified
  • Invalid equivalence class : According to the specification requirements, does not meet the requirements set

The supermarket to buy fruit

Effective equivalence class: apples, bananas, peaches ...

Invalid equivalence class: vegetables, rice, drinks ...  

Boundary value

Everyday language of vulnerabilities:

Exam made the score, the teacher arranged winter operations: more than 60 minutes to transcribe all the questions again, less than 60 minutes, three times transcribe all topics

So Xiao Ming ~ ~ ~ there is no job, because he was just 60 points

Boundary value : boundary value analysis is to input or output by the boundary values A black box test method , boundary value analysis is usually used as the supplement to the equivalence partitioning method in this case, and the like from which test border price class 

1. The input box length 1-11, a boundary value Value: 0,1,11,12

2. athletes project 1-3, boundary value values: 0, 1, 3, 4

3. Query face page has 999 lines, each 50 acts a boundary value Value: 0 line, 1-line, 50 lines, 51 lines, 999 lines 

Cause and effect diagram

FIG Causality: cause and effect diagram is a simplified logic diagram, indicating that the program can directly input the condition (cause) and output operation (results) the relationship between the Hi, cause and effect diagram is a method by means of a graphic system to design test cases method is particularly applicable to a variety of input conditions of the test program, the program output depends on the input conditions and circumstances

Causal map the basic knowledge needed to master:

  • Identity

                                             

Identity: If the cause is true, then the result must be true

                           

  •  versus

And: Only when two reasons are true only when the result is true  

  • or 

                          

Or: two reasons, there is true, then the result will be true 

  • non- 

                        

Non-: Only reason is false, the result will be true 

Cause and effect diagram design test cases steps:

  1. Analysis of all possible input and output possible
  2. Find out the relationship between input and output
  3. Draw cause and effect diagram
  4. FIG converted into causal determination table
  5. Determining the correspondence table to each of a test  

 Case:

Taobao quit in double eleven discount promotions, order has been submitted, the order amount is greater than 300 or red, the preferential

1. For the business rule, first by analyzing all possible inputs and outputs may be possible to obtain the following results:

  • Enter: the order has been submitted, the order amount is greater than 300, there is a red envelope
  • Output: concessions, no concessions

2. The second step is then to find the relationship between the output of the input fields, obtained by analyzing the correspondence relation

  • Order has been submitted, the order amount is greater than 300, then deals
  • Order has been submitted, the order amount is less than equal to 300, no envelopes, no concessions
  • Order has been submitted, the order amount is less than equal to 300, there is a red envelope, concessions
  • Order has been submitted, there is a red envelope, concessions
  •  Uncommitted orders, not concessions

3. In order to facilitate the determination and causality diagram shown in FIG, numbering all inputs and outputs, numbered as follows:

  •  1: The order has been submitted
  •  2: order amount greater than 300
  •  3: There is a red envelope
  •  21: Offer
  •  22: No deals 

4. draw cause and effect diagram

             

The determination table Videos

    1 2 3 4 5 6 7 8
condition 1 Y Y Y Y N N N N
  2 Y Y N N Y Y N N
  3 Y N Y N Y N Y N
Intermediate results 11 Y Y Y N Y Y Y N
action 21 Y Y Y N N N N N
  22 N N N Y Y Y Y Y

 6. The final test

1,2,3,4,5(包括6,7,8)

正交排列

因果图法测试用例太多怎么办?

正交法的目的是为了减少用例数量,用尽量少的用例,覆盖输入的两两组合

正交试验设计是研究多因素多水平的一种设计方法,它是根据正交性,由实验因素的全部水平组合中挑选出部分有代表性的点进行实验,通过对这部分实验结果的分析了解全面试验的情况,找出最优的水平组合,正交试验设计是一种基于正交表的,高效率,快速,经济的试验.

因素(Factor):在一项试验中,凡是考虑的变量都称为因素(变量)

水平(位级)  Level :在试验范围内,因素被考查的值称为水平(变量的取值)

正交表的构成:

  • 行数(Runs):正交表中行的个数,即试验的次数,用N表示
  • 因素数(Factors): 正交表中列的个数,用C表示
  • 水平数(Levels): 任何单个因素能够取到的值的最大个数,正交表中包含的值为从0到数"水平数-1"或者从1到"水平数",用T表示

正交表的表示形式: L=行数(水平数*因素数)  L=N(TC)

正交表的两条性质:

  • 每一列中各数字出现的次数都一样多
  • 任何两列锁构成的各有序数对出现的次数都一样多

正交法设计测试用例的步骤: 

  • 1、有哪些因素(变量)
  • 2、每个因素有哪几个水平(变量的取值)
  • 3、选择一个合适的正交表
  • 4、把变量的值映射到表中
  • 5、把每一行的各因素水平的组合作为一个测试用例
  • 6、加上你认为可疑且没有在表中出现的用例组合 

案例

以注册为例:

1.因素:姓名,邮箱,密码,确认密码,验证码

2.水平: 填写,不填写

实验说明 选择正交表 因素与水平      
序号 1 2 3 4 5
因素名称 姓名 EMAIL 密码 确认密码 验证码
水平1 填写 填写 填写 填写 填写
水平2 不填写 不填写 不填写 不填写 不填写

3.表中的因素数:5

表中至每个因素数的水平数=2

行数取最少的一个,即试验次数最少的一个

L=N(TC)=(2-1)*5+1=6(25)     N试验次数   T水平数   C因素数

 4.生成测试用例

实验计划表            
所在列 1 2 3 4 5 6
因素 姓名 EMAIL 密码 确认密码 验证码 实验结果
实验1 填写 填写 填写 填写 填写  
实验2 填写 填写 不填写 填写 不填写  
实验3 填写 不填写 填写 不填写 不填写  
实验4 不填写 填写 不填写 填写 不填写  
实验5 不填写 不填写 填写 不填写 填写  
实验6 不填写 不填写 不填写 不填写 填写  

 

场景设计法

现在的软件几乎都是用事件触发来控制流程的,事件触发时的情景便形成了场景,而同一事件不同的触发顺序和处理结果就形成事件流,该方法可以比较生动地描绘出事件触发时的情景,有利于测试设计者设计测试用例,使测试用例更容易理解和执行

案例

以注册为例

                                                     

 

错误猜测法

错误猜测法是经验丰富的测试人员喜欢使用的一种测试方法

基于经验和直觉,找出程序中你认为会出现的错误,有针对性地设计测试用例,经验可能来自于对某项业务的测试较多,也可以来自售后用户的反馈意见,或者从故障管理库中整理出bug,整理出产品越往哪些地方越容易出现问题,问题越多的地方,潜在的bug越多

案例

以注册为例

1、校验中特殊字符空格的处理?
2、密码校验中的大小写?
3、姓名中的特殊字符?
4、密码发送是否明文

 

Guess you like

Origin blog.csdn.net/weixin_43224539/article/details/90180035