当前位置:网站首页>[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 .
边栏推荐
- 数据运营平台-数据采集[通俗易懂]
- The programmer refused the offer because of low salary, HR became angry and netizens exploded
- SuperSocket 1.6 创建一个简易的报文长度在头部的Socket服务器
- 为什么完全背包要用顺序遍历?简要解释一下
- iMeta | 华南农大陈程杰/夏瑞等发布TBtools构造Circos图的简单方法
- 刘永鑫报告|微生物组数据分析与科学传播(晚7点半)
- Common modification commands of Oracle for tables
- Quickly use various versions of PostgreSQL database in docker
- Today, I met a senior test developer from Tencent and saw the ceiling of the foundation
- Unity color palette | color palette | stepless color change function
猜你喜欢

leetcode:236. 二叉树的最近公共祖先

rancher集成ldap,实现统一账号登录

Entropy information entropy cross entropy

服务器SMP、NUMA、MPP体系学习笔记。

How rider uses nuget package offline

ldap创建公司组织、人员

《数字经济全景白皮书》保险数字化篇 重磅发布

MATLIB reads data from excel table and draws function image

Why is bat still addicted to 996 when the four-day working system is being tried out in Britain?

Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform
随机推荐
[CVPR 2022] semi supervised object detection: dense learning based semi supervised object detection
从外企离开,我才知道什么叫尊重跟合规…
DAY ONE
Server SMP, NUMA, MPP system learning notes.
DAY TWO
Supersocket 1.6 creates a simple socket server with message length in the header
【无人机】多无人协同任务分配程序平台含Matlab代码
GPIO簡介
Gold three silver four, don't change jobs
[unmanned aerial vehicle] multi unmanned cooperative task allocation program platform, including Matlab code
Please help xampp to do sqlilab is a black
Use source code compilation to install postgresql13.3 database
Use package FY in Oracle_ Recover_ Data. PCK to recover the table of truncate misoperation
Yaduo Sangu IPO
Oracle对表进行的常用修改命令
MVC and MVVM
[CVPR 2022] target detection sota:dino: Detr with improved detecting anchor boxes for end to end object detection
刘永鑫报告|微生物组数据分析与科学传播(晚7点半)
PostgreSQL uses pgpool II to realize read-write separation + load balancing
Wasserstein Slim GAIN with Gradient Penalty(WSGAIN-GP)介绍及代码实现——基于生成对抗网络的缺失数据填补