当前位置:网站首页>[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 .
边栏推荐
- 【CVPR 2022】目标检测SOTA:DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
- 英国都在试行4天工作制了,为什么BAT还对996上瘾?
- Introduction au GPIO
- The "white paper on the panorama of the digital economy" has been released with great emphasis on the digitalization of insurance
- 自动化测试工具Katalon(Web)测试操作说明
- 使用yum来安装PostgreSQL13.3数据库
- Tourism Management System Based on jsp+servlet+mysql framework [source code + database + report]
- Unity color palette | color palette | stepless color change function
- 【通信】两层无线 Femtocell 网络上行链路中的最优功率分配附matlab代码
- 零代码高回报,如何用40套模板,能满足工作中95%的报表需求
猜你喜欢
【精品】pinia 基于插件pinia-plugin-persist的 持久化
iMeta | 华南农大陈程杰/夏瑞等发布TBtools构造Circos图的简单方法
Rider离线使用Nuget包的方法
Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform
Automatic test tool katalon (WEB) test operation instructions
app通用功能測試用例
Competition between public and private chains in data privacy and throughput
量子时代计算机怎么保证数据安全?美国公布四项备选加密算法
The "white paper on the panorama of the digital economy" has been released with great emphasis on the digitalization of insurance
【2022全网最细】接口测试一般怎么测?接口测试的流程和步骤
随机推荐
Matplotlib draws a histogram and adds values to the graph
PostgreSQL高可用之repmgr(1主2从+1witness)+Pgpool-II实现主从切换+读写分离
Please help xampp to do sqlilab is a black
《LaTex》LaTex数学公式简介「建议收藏」
Introduction to GPIO
【通信】两层无线 Femtocell 网络上行链路中的最优功率分配附matlab代码
编译logisim
基于jsp+servlet+mysql框架的旅游管理系统【源码+数据库+报告】
How about the order management of okcc call center
求帮助xampp做sqlilab是一片黑
什么是响应式对象?响应式对象的创建过程?
在docker中快速使用各个版本的PostgreSQL数据库
DAY TWO
DAY THREE
Use package FY in Oracle_ Recover_ Data. PCK to recover the table of truncate misoperation
Basic chart interpretation of "Oriental selection" hot out of circle data
Zero code and high return. How to use 40 sets of templates to meet 95% of the reporting needs in the work
Wasserstein slim gain with gradient poverty (wsgain-gp) introduction and code implementation -- missing data filling based on generated countermeasure network
刘永鑫报告|微生物组数据分析与科学传播(晚7点半)
Rider离线使用Nuget包的方法