当前位置:网站首页>Introduction to interface test, interface protocol and common interface test tools
Introduction to interface test, interface protocol and common interface test tools
2022-06-25 20:32:00 【Programming simplicity】
One 、 Preface : What is an interface
1. Interface refers to a kind of service provided by software to the outside world . The function is to make the internal data can be modified by the external interaction .
for example :USB Interface , The data in the computer can be regarded as content data , and U The data in the disk can be regarded as external data , that USB The function of the interface is : Computer and U Disk interaction data , In other words, the data inside the computer can be compared with the data outside U Disk exchange data .
for example : Withdrawal and recharge of wechat , Call the bank's open interface , These interfaces have access control , Authentication code is generally required token To access . So why authentication code ? If there is no authentication code constraint , Is it possible for anyone to modify the internal data of the bank ? That's got it. , Then you can really set a small goal !
2. Generally speaking, there are two kinds of interfaces : One is the interface inside the program , One is the external interface of the system .
External interface of the system : For example, you need to get resources or information from other websites or servers , No one else will share data with you , He can only give you a way they've written to get the data , You can use the method he wrote by referring to the interface provided by him , In order to achieve the purpose of data sharing , For example, we use app It is called through the interface when it processes data .
Program internal interface : Between methods , Interaction between modules , The interface thrown inside the program , such as bbs System , There are login modules 、 Post module and so on , If you want to post, you have to log in first , To post, you have to log in , Then the two modules have to interact , It will throw out an interface , For internal system call .
Two 、 Interface protocol and corresponding interface testing tools
1、 be based on http Interface to protocol :
http The protocol is also called hypertext transfer protocol , It is mainly used for data interaction between browser and server , This interface often uses get and post Two ways to request , The interface based on this protocol is the most popular one on the market ! The commonly used interface testing tools are :
Postman
Jmeter
2、 be based on webService Interface to protocol
webService Is based on soap Communication protocol of , Request and return messages are generally xml Format . The commonly used interface testing tools are :
SoapUI
3、 be based on Dubbo Interface to protocol
1、dubbo default protocol Using a single long connection and NIO Asynchronous communication , It is suitable for small data and large concurrent service calls , And the situation that the number of service consumer machines is far greater than the number of service provider machines
2、 It's not suitable for services that transmit large amounts of data , For example, file transfer , Video transmission, etc , Unless the number of requests is very low .
3、 be based on Dubbo The interface of the protocol is also used SoapUI Tools to test .
3、 ... and 、 How to design test cases for interface testing ?
Interface testing generally considers the change of input parameter form and the business logic of interface , The general design interface test case uses equivalent class 、 The boundary value 、 Scene method is in the majority !
The idea of designing test cases for interface testing is as follows :
1. Interface business logic test ?( Example )
Interface logic testing is based on business logic 、 Input parameters 、 Description of the output value , For the output value obtained under normal input condition
Whether the correct test , That is to test whether the interface service provided by the external service works normally .
2. Module interface test ?( Counter example )
Module interface test is to ensure the safety of data and the correctness of program logic under abnormal conditions .?
Module interface testing mainly includes the following aspects ?
a. Authentication code token abnormal ( The authentication code is empty < No authentication code >, Wrong authentication code , Expired authentication code ).
b. Other parameters are abnormal .
1、 Required items check
2、 Length of parameter 、 type 、 Format exception :
Conventional parameters :( Numbers 、 character string 、 date )
Parameter length :6-18 position . Or ID card 、 The length of the phone .
Parameter type : Numbers ( precision ), Letter , chinese , Parameters with spaces , Special characters .
Date format : date : Specific date , Mm / DD / yyyy HHM / S , Date format ( Include /,-,: etc. ).
a. Error code exception coverage .
b. Other concerns of interface testing
When the interface has page flipping , Page number and page number outlier test
Add, delete, change and check the database , For example, a post After the interface operation is completed , Use the list page interface to see if the new data is the same as the previous one post Agreement
Whether the picture address returned by the interface can be opened , Whether the picture size meets the requirements
When the output parameters have linkage , You need to verify whether the actual results of the returned two parameters meet the requirements .
All list page interfaces must consider sort values
All functions should be compatible with the old version
Four 、 Interface composition ?
1. What are the components of interfaces ?
From the interface documentation , The interface should have at least : Request address 、 Request method 、 Request parameters ( In and out ) form , Some interfaces have request headers header.
2.header The request header and the input parameter are sent to the server. What's the difference between them ?
First , They are really parameters sent to the server , But they are different ,header The parameters stored in are usually some verification information , such as cookie, It is to verify whether the request has permission to request the server , If there is , It can request the server , Then the request address is sent to the server along with the input parameter , Then the server will return out parameters according to the address and in parameters . in other words , The server first accepts header Information to determine whether the request has permission request , After judging that you have authority , Will accept the request address and parameters .
5、 ... and 、 summary
No winter will pass , No spring will not come .2020 It's an extraordinary year for the whole world ,2021 Let's get ready for the new year , Starting from the heart , come on. .
边栏推荐
- How does zhiting home cloud and home assistant access homekit respectively? What is the difference between them?
- [harmonyos] [arkui] how can Hongmeng ETS call pa
- Redis core principle and design idea
- Matlab_ two point zero five
- TypeError: __ init__ () takes 1 positional argument but 5 were given
- How does jest expose specific problems in complex judgment conditions?
- <C>. Calculation date to day conversion
- [distributed system design profile (1)] raft
- Recommend a free screen recording software
- "Space guard soldier" based on propeller -- geosynchronous geostationary orbit space target detection system
猜你喜欢

Sonar series: continuous scanning through Jenkins integrated sonarqube (IV)
Uncover n core 'black magic' of Presto + alluxio

CG kit explore high performance rendering on mobile terminal

Slenium tips: how to handle some dialog boxes that may appear on Web pages
laf. JS - open source cloud development framework (readme.md)
Interviewer: why does TCP shake hands three times and break up four times? Most people can't answer!

Does redis transaction support acid?

Lantern Festival, learning at the right time! Novice training camp attacks again, learning buff continues to fill up
Section 13: simplify your code with Lombok

Node installation method you don't know
随机推荐
R language quantile autoregressive QAR analysis pain index: time series of unemployment rate and inflation rate
A new paradigm for large model application: unified feature representation optimization (UFO)
Understanding C language structure pointer
SaaS privatization deployment scheme
Interface automation -md5 password encryption
C language PTA -- continuity factor
Understand the offline mixing technology in the industry
Dice、Sensitivity、ppv、miou
App battery historian master
Png to NII
Connect the local browser to the laboratory server through mobaxterm
Png to NII
Attention to government and enterprise users! The worm prometei is spreading horizontally against the local area network
The secret of metaktv technology of sound network: 3D space sound effect + air attenuation + vocal blur
Several methods of obtaining function annotation text on pycharm
COMP9024
Usage Summary of str.format() function [not 'str****{}'.Format()]
Interviewer: why does TCP shake hands three times and break up four times? Most people can't answer!
Teach you how to create and publish a packaged NPM component
New features of redis 6.0: take you 100% to master the multithreading model