当前位置:网站首页>Test case design method
Test case design method
2022-06-11 23:38:00 【Channeling monkey__】
1. Test case introduction
Definition of test cases :
For a business goal , And a set of test inputs , A case of execution conditions and expected results
2. Why learn test cases ?
- Design test cases before you start testing , It can avoid blind testing and improve testing efficiency .
- The use of test cases highlights the implementation of software testing 、 Have a clear purpose .
- After the software version is updated, only a few test cases need to be corrected to start the testing work , Reduce work intensity 、 Shorten the project cycle .
- Verify that the software meets customer requirements 、 Reflect the workload of a tester 、 Show the design idea of test case .
3. Use case core elements
- Must master : Use case number ( How to name )、 The module it belongs to 、 Use case title ( Verify who and under what circumstances , What will you do? , What's the end result )、 priority 、 precondition 、 Operation steps 、 Test data 、 Expected results 、 The actual result
Understand the content : Pass or not 、bugID、 Prepared by 、 Time of writing 、 Testers 、 Test time 、 remarks
4. What is a high quality test case
- Test cases cover all user requirements
- Test cases should be simple and clear
- All types of test cases should be complete
- Cover the most requirements with the least use cases
① Division of equivalence class
Definition : Equivalence class division It is to divide all the possible input data into several areas , Then take a small number of representative from each area Test the data of .
Equivalence class : What is equivalent class , A collection of input fields , In this set, each input condition is equivalent .
Equivalence class classification :
Generally, it can be divided into effective equivalence class and invalid equivalence class .
- Effective equivalence class : To conform to 《 Requirements specifications 》, Enter a reasonable set of data
- Invalid equivalence class : Means not in conformity with 《 Requirements specifications 》, Input unreasonable data set
type
Value range type : Enter student grades 0-100
Identity type : Only one result is correct , Everything else is wrong for example The grand prize in the lottery
Boolean type : Choose by whether or not , Agree to an agreement
Enumeration type : Give the options , As long as any one of them fits For example, choosing a degree
Type of rule : Given requirements , Just meet the requirements , Like email
The type of character that can be filled in any text input box : chinese 、 english 、 Special symbols 、 Space 、 Numbers .
Case a :
Divide equivalence classes and number , The following table is the result of equivalence class partition

Case 2 :

② Boundary value analysis
Definition
Definition : Boundary value analysis It is to take some data slightly higher or lower than the boundary for testing .
reason : When developing the loop body, the access may be due to <,<= mistake .
For example, the following code :
// Efficient equivalence partition -1 0 100 101
for(int i = 0;i <100; i ++) {
int j = i+1;
System.out.println(" Circle the first “+j+" Time ")// Do something in a cycle
} The program here is a loop 100 Time , So I can do 100 Time ;
If the programmer is not careful , hold i <100 It's written in i <= 100, It will overflow , In this case, boundary value checking is a good test method .
The way to determine the boundary value :
- Upper point : A point on a boundary , Whether the field is an open interval or a closed interval , Open range , The last point is outside the territory , If it's a closed interval , The last point is in the domain .
- Departure point : The point closest to the upper point , It has something to do with whether it is a closed interval or an open interval , If it's an open interval , So the departure point is in the domain , If it's a closed interval , So the departure point is outside the territory .( Open the inside and close the outside )
Principles to follow : Open the inside and close the outside Open the interval and look in the middle , Close the interval and look outside - Inside point : Any point in a field is an interior point .
0<=x<=10 Top left 0 Left off point -1 Right away 11 Top right 10 Inside point 5
0<x<10 Top left 0 Left off point 1 Right away 9 Top right 10 Inside point 5
0<=x<10 Top left 0 Left off point -1 Right away 9 Top right 10 Inside point 5Boundary value and equivalence class de duplication
1. Case a :
File management system , The format of user input date is “ Specific date ”, The scope is 1990 year 1 month ~2049 year 12 month . Example :19900101-20491231

Case 2 :

Test point analysis :
1、 Read the needs 3-5 All over
2、 Punctuation
3、 Converse thinking
4、 Questions ③ Cause and effect diagram
Definition
Causality diagram method is more suitable for the situation with more input conditions , Test the permutation of all input conditions . The so-called reason is input , The result is the output .
The writing process of causality diagram test case
1、 Determine the cause 、 result 、 The middle process
2、 Connect the cause and effect diagram
3、 Indicate constraints
4、 Output test cases
Case a : Vending machine
Requirement specification :
There is a processing unit price of 2.5 The vending machine software for boxed drinks . If you put in 2.5 Yuan coins , Press “ coke ”、“ beer ”、 or “ Milk tea ” Button , The corresponding drink will be delivered . If the investment is 3 Yuan coins , Return the drinks as they are delivered 5 Dimes .
analysis :
reason ( Input ): In the middle result ( Output )
input 2.5 Yuan coins ; The coin has been put in / Button has been pressed return 5 Dimes ;
input 3 element ;
Press “ coke ” Button ; Send out “ coke ” drinks ;
Press “ beer ” Button ; Send out “ beer ” drinks ;
Press “ Milk tea ” Button . Send out “ Milk tea ” drinks ;④ Wrong guess
Definition
Error guessing is a test case design method that people with rich test experience like to use .
Generally, this method is based on experience and intuition to infer various errors that may be sent in the program , Targeted design . Only as a supplement .
application
Enter a string of numbers , The program can automatically sort from small to large
Email format @ In accordance with the full angle and half angle case
Case study
Test the call function of mobile terminal , Various call failures can be designed to supplement the test example :
nothing SIM Exhale when the card is inserted ( Non emergency call )
Insert overdue SIM Card for exhalation
If the RF device is damaged or no signal area is inserted, it is effective SIM Card exhaled
Normal network , Insertion works SIM card , Invalid number ( Such as 1、888、333333、 Don't enter any number, etc )
Normal network , Insertion works SIM card , Use “ Speed dial ” The number of invalid number set by function call out
skill
The most important thing is to think about and analyze all aspects of the test object , Refer to what you found before bug Relevant data , Lessons learned , Individuals think more about abnormal situations 、 On the other hand 、 Special input , Treat the program as an attacker , Can design a more perfect test case to .
⑤ Decision table
Definition :
When designing test cases , Analysis and expression of multi input conditions to perform different operations of the black box test method .
Be careful : This method is similar to the cause and effect diagram method .
Decision table test case writing process
1、 Determine the cause and action
2、 Permutation and combination
3、 Mark the relationship between the results
4、 Output test cases
Case study
requirement :
Scanning gun scanning body machine code, automatic identification of car brand and model , For engine power greater than 100 A powerful car also The maintenance record is incomplete or the mileage exceeds 20 Ten thousand kilometers of cars , Cooperation should be given 4s Store priority maintenance
Conditions 1 2 3 4 5 6 7 8
The power is greater than 100 horsepower
Incomplete maintenance records
More miles than 20 Thousands of kilometers
action
4s Store priority
Other treatments ⑥ Orthogonal experiment
- Using tools : Orthogonal table
- The orthogonal experiment method is to use a well arranged table - Orthogonal table to design the experiment as a whole 、 Comprehensive comparison 、 Statistical analysis , Through a small number of experiments to find better production conditions , In order to achieve the highest production process effect .
- This experimental design method is to select an appropriate amount of representative points from a large number of test points , Use the form you've made — Orthogonal table to arrange experiments and data analysis method .
- Orthogonal table can sample evenly within the range of factors , So that each test has a strong representativeness , Because the orthogonal table has the characteristics of balanced dispersion , Some requirements of comprehensive experiment are ensured , These experiments often can better or better achieve the purpose of the experiment .
- The design of orthogonal experiment includes two parts : First of all , How to arrange the experiment ; second , How to analyze the experimental results .
Application scenarios
There are multiple controls in an interface , Each control has multiple values , Controls can be combined with each other , impossible ( There's no need ) Write a use case for each combination , How to test with the least optimal combination .—— Orthogonal array method


Use the orthogonal design assistant
(1) Download and unzip the orthogonal design assistant
(2) File new project
(3) Experiment new experiment
One . Experimental instructions

Two . Choose an orthogonal table

3、 ... and . Factors and levels

Four . determine

What are the characteristics of orthogonal table test case design method ?
1、 Cover the most operations with the least number of experiments , There are few test case designs , Efficient , But it's complicated ;
2、 For basic verification functions , And the defects caused by secondary integration , You can usually find out ; But deeper flaws , More complex defects , There's nothing I can do about it Of ;
3、 In a physical environment , Orthogonal arrays are generally difficult to do . majority , Use this method only for system testing .
⑦ Scene method
Definition
Describe the function point or business process of the system by simulating the business scenario , So as to improve the test effect of the black box test method
ATM Introduce the scene method

Schematic diagram

Two streams
Basic flow
- Concept
The right process - technological process
Card insertion → Input password → Choose services → Withdraw money → Select amount → Waiting for cash out → Take out the card
Alternative streams
- Concept
There are abnormal processes , For elementary flows, every step is reversed - technological process
Card insertion → Input password → Wrong password → Re input → The password is correct → Choose services → Withdraw money → Select amount → Waiting for cash out → Take out the card
Scenario method test case writing process
- Analyze user scenarios
- The design scenario covers basic flow and alternative flow
- Output test cases
Case study
- Requirement specification :
There are three steps to registering a website , Enter phone number , password , Enter the correct phone verification code 、 And agree to the service agreement , Click Apply now , Registered successfully . Give a friendly prompt when the information is filled in incorrectly , Explain the cause of the error . After successful registration, send a message to the registered user , The information is as follows :“ Hello! !Xxx user , Welcome to register , Please complete the real name authentication in time .” - Analysis method :
① Read the needs : Familiar with 3-5 All over , Reading needs
② Punctuation : Organize the requirements into requirements
③ classification : technological process / The rules
④ Converse thinking : Think about it in different ways
⑤ question : Find out where you have doubts
⑥ Apply test case analysis method

Use the corresponding test case method to write test cases for test points , One test point corresponds to one or more test cases , The test case can only correspond to a test point .
边栏推荐
- Are you still struggling with the gold content of PMP
- Software installation and use, etc
- RF中使用reuqests的两种方式
- Antigen products enter the family, and Chinese medical device enterprises usher in a new blue ocean
- Queue (C language)
- A new product with advanced product power, the new third generation Roewe rx5 blind subscription is opened
- Si4432 RF chip scheme typical application of data transmission of wireless communication module of Internet of things
- [day4 literature intensive reading] space – time interdependence: evidence against Asymmetric mapping between time and space
- 2022 high place installation, maintenance and removal of simulated examination platform for operation certificate examination question bank
- Postgresql错误码是如何构造的
猜你喜欢

Lake Shore—SuperVariTemp 低温恒温器

Lake Shore VNF 系列低温恒温器系统——流动蒸汽中的样品

CVPR 2022 | meta learning performance in image regression task

Here we go! Dragon lizard community enters PKU classroom

2022 operation of simulation examination platform for safety officer C certificate

一文读懂Logstash原理

Jenkins基本配置

2022 high place installation, maintenance and removal of simulated examination platform for operation certificate examination question bank

MySQL 8.0 decompressed version installation tutorial

(linear DP | monotone queue) acwing 895 Longest ascending subsequence
随机推荐
Two way leading circular linked list (C language)
MySQL some simple commands
Jetpack架构组件学习(3)——Activity Results API使用
require. context
loading
[day13-14 intensive literature reading] cross dimensional magnetic interactions arise from memory interference
Introduction and installation steps of sonarqube
Two ways of using reuqests in RF
HMS core shows the latest open capabilities in mwc2022, helping developers build high-quality applications
Unity3d C # development of wechat games audio / sound playback problem solving process sharing
My creation anniversary
2022年安全员-B证理论题库及模拟考试
2022年安全员-B证理论题库及模拟考试
Remix localization, loading local contract file, local link Remix
A new product with advanced product power, the new third generation Roewe rx5 blind subscription is opened
[day15 literature extensive reading] numerical magnetic effects temporary memories but not time encoding
QR code
2022年安全员-A证考题模拟考试平台操作
Solve the problem of slow downloading plug-ins for idea
Beginner JS BOM implementation window centered