当前位置:网站首页>[2022 the finest in the whole network] how to test the interface test generally? Process and steps of interface test
[2022 the finest in the whole network] how to test the interface test generally? Process and steps of interface test
2022-07-06 23:58:00 【Test Xiaona】
One 、 What is interface testing
We want to know how to do interface testing , First, understand what interface testing is ? In general, it is like in the system Component interface data Interactive testing 、 Between different systems Interface data interaction Testing, etc , We can all call it The interface test
!
So how does interface testing test interfaces ?
Interface testing is the relationship between the input and output under different conditions of the interface , See if it meets the requirements specified in the interface specification Functionality 、 Security as well as Performance aspect The requirements of .
To put it simply :“ Interface testing is when there is no front-end page or the front-end has not been completed , Replace front-end pages or third-party users , To verify whether the interface implementation of the back-end conforms to the interface specification .”
Two 、 The benefits of interface testing
- Pass the interface test , We can test the stability and correctness of the interface , You can put aside the influence of the front end , Quickly locate defects on the back end , Improve the efficiency of testing .
- Pass the interface test , It can bring efficient defect monitoring and management capability to the project , You can mention the overall quality of the software ;
The more complex the project , The bigger the system , The more frequently the interface test is used, the more obvious the effect is
3、 ... and 、 The principle of interface test
By simulating client or Web browser To the server Send a request
, After receiving the request, the server processes the received data , At the same time, a reply is returned to the client , Our simulated client , After receiving the returned data, judge the data , How to judge ?
1、 Judge the request : Whether it is right , The default request is successful , Returns the 200 Status code , If the request is wrong, return 400, 404, 500 Wait for the status code
2、 Judgment data : The correctness and integrity of the returned data
3、 Judge security : Generally, the interface will not be exposed on the Internet and called arbitrarily by others , Generally, we will make some restrictions on the interface , For example, the number of requests 、 Request frequency limit, etc
Simply speaking : Find a tool that can connect to the Internet according to the interface document , Send a request to the interface server , Get a response , Check whether the response complies with the specification of the interface document
The principle of interface test
Four 、 Interface testing tools
The interface test needs to simulate the client to send a request and get a response , So we need a tool to get a response to a request , That is, networking tools :
Interface testing through tools
The most famous is postman, Of course, restclient And so on. . You can also use it jmeter,jmeter It can also be used for interface performance testing , Of course, we can also write scripts ( Code ) Conduct interface test .
Generally we use python The most popular online library in the language requests
!
5、 ... and 、 How to do interface test well
Interface testing should follow some key points :
- Function realization of test interface . When checking data requests with different parameters , The data returned by the interface is consistent with the expected result, that is, the specification of the interface document .
- Test the robustness of the interface ( Fault tolerance ), For example, the data type passed is wrong or empty data is passed , Whether the special characters that are inconsistent with the interface specification can be handled normally .
- Test the boundary value of interface parameters . For example, the transmitted data exceeds the scope specified in the interface specification , Or whether the data can be processed normally when it is large enough or negative
- Test the performance of the interface , The time for the interface to process and respond to data , Concurrency and so on , Of course, this involves the optimization of code implementation , Need to communicate with developers
- Test the security of the interface . For example, whether the login user name, password and other sensitive data are displayed in clear text , Whether the interface requiring permission is exposed
6、 ... and 、 Interface test process
1、 Analyze interface documents and requirements documents
When analyzing interface documents or requirements documents, you usually find test points , Then we generally look for the test points of interface test from several directions
· Functional test points
· Performance test points
· Security test point
2、 Write interface test plan
A test plan is a functional test plan. It is basically the same as a well-known test plan 5w1h 了
1) why—— Why interface testing ;
2) what— What are the test interfaces ;
3) when— Start and end time of different stages of test interface ;
4) where— Corresponding interface documents , Storage location of interface defects , Test environment, etc ;
5) who— Project related personnel composition , Which interfaces are assigned to whom ;
6) how— What testing tools and methods are used for testing .
3、 Write interface test cases
Test cases are written according to which specific interface , Generally, test cases are written in two scenarios: single interface and multi interface
1) Test of single interface scenario
- Forward data : That is, it can send requests normally , Get the data of the response normally , Generally, we organize from three aspects :
- All required parameters
- All parameters ( Required parameters + Optional parameters )
- Parameter combination ( Required parameters + Some optional parameters )
- Reverse test : Send a request with a data area that does not belong to the specified range, and check whether the server can handle it normally
- Abnormal data : Data is empty , Too much or too little length ( Outside boundary value ), The type doesn't match ( Numeric type passing is required str type ), bad data
- Exception parameters : Don't pass parameters , Pass fewer parameters , Multi pass parameters , Pass wrong parameters
- Abnormal business data : Consider various abnormal return conditions of output in combination with business functions
2) Multi interface scenario testing
- Business scenario function test ( Consider common usage scenarios from the perspective of users )
- Multi business scenario function test is mainly to test the data dependency between interfaces
4、 Interface test execution
According to the designed test cases, the test cases can be executed. Of course, there are several ways to execute
1. Use postman Something like that , Test one by one , This method is called manual testing
2. Use jmeter And so on, there are automatic functional ways to test , This tool is called automated testing
3. We can write our own test scripts , Use test scripts to automatically load tests , This is automated testing
5、 Generate interface test report .
- After the test is completed, the test report can be generated
Interface test process
Finally, thank everyone who reads my article carefully , Watching the rise and attention of fans all the way , Reciprocity is always necessary , Although it's not very valuable , If you can use it, you can take it
These materials , For doing 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful …….
If you don't want to experience it again, you can't find information when you study on your own , No one answers the question , If you insist on giving up after a few days , You can add mine below qq Group discussion and Exchange , There are also various software testing materials and technical exchanges .
边栏推荐
- openresty ngx_lua子请求
- Designed for decision tree, the National University of Singapore and Tsinghua University jointly proposed a fast and safe federal learning system
- 专为决策树打造,新加坡国立大学&清华大学联合提出快速安全的联邦学习新系统
- 英国都在试行4天工作制了,为什么BAT还对996上瘾?
- [boutique] Pinia Persistence Based on the plug-in Pinia plugin persist
- DevOps可以帮助减少技术债务的十种方式
- [communication] optimal power allocation in the uplink of two-layer wireless femtocell network with matlab code
- 自动化测试工具Katalon(Web)测试操作说明
- I've been laid off, and I'll lose money for everything. The days when I once made a monthly salary of 20000 are not coming back
- AVL树到底是什么?
猜你喜欢
什么是响应式对象?响应式对象的创建过程?
Interface joint debugging test script optimization v4.0
MATLIB从excel表中读取数据并画出函数图像
1000 words selected - interface test basis
基于SSM框架实现的房屋租赁管理系统
What is AVL tree?
Close unregistering application XXX with Eureka with status down after Eureka client starts
Newsletter L Huobi ventures is in-depth contact with genesis public chain
Zero code and high return. How to use 40 sets of templates to meet 95% of the reporting needs in the work
1000字精选 —— 接口测试基础
随机推荐
SuperSocket 1.6 创建一个简易的报文长度在头部的Socket服务器
Wind chime card issuing network source code latest version - commercially available
After 3 years of testing bytecan software, I was ruthlessly dismissed in February, trying to wake up my brother who was paddling
《数字经济全景白皮书》保险数字化篇 重磅发布
谷歌百度雅虎都是中国公司开发的通用搜索引擎_百度搜索引擎url
How rider uses nuget package offline
The "white paper on the panorama of the digital economy" has been released with great emphasis on the digitalization of insurance
Wasserstein slim gain with gradient poverty (wsgain-gp) introduction and code implementation -- missing data filling based on generated countermeasure network
Interface joint debugging test script optimization v4.0
DAY TWO
[system analyst's road] Chapter 7 double disk system design (service-oriented development method)
【OFDM通信】基于深度学习的OFDM系统信号检测附matlab代码
Common modification commands of Oracle for tables
MIT 6.824 - Raft学生指南
亚朵三顾 IPO
How to find out if the U disk file of the computer reinstallation system is hidden
DAY THREE
GPIO简介
【通信】两层无线 Femtocell 网络上行链路中的最优功率分配附matlab代码
What is AVL tree?