Talk about interface tools (jmeter, postman, swagger, etc.)

1. What types of interfaces are there?

Interfaces are generally divided into two types: 1. Internal interfaces of the program 2. External interfaces of the system

The external interface of the system: For example, if you want to obtain resources or information from other websites or servers, others will definitely not share the database with you. They can only provide you with a method they have written to obtain data, and you quote it. The interface can use the method he wrote, so as to achieve the purpose of data sharing.

The interface inside the program: the interaction between methods, between modules and modules, the interface thrown inside the program, such as the bbs system, there are login modules, posting modules, etc., then you must log in first if you want to post, then this The two modules have to interact, and it will throw an interface for the internal system to call.

Classification of interfaces: 1. webservice interface 2. http api interface

The webService interface is transmitted through http through the soap protocol. Both the request message and the return message are in xml format. We only use the passing tool to call and test when testing.

The http api interface uses the http protocol to distinguish calls through paths. Request messages are in the form of key-value, and the returned messages are generally json strings. There are methods such as get and post, which are also the most commonly used two request method.

JSON is a universal data type that all languages ​​recognize. (The essence of json is a string. It has nothing to do with other languages. It can only be converted into data types in other languages ​​after a little processing. For example, it can be converted into a dictionary in Python, and the form of key-value can be converted into native in JavaScript. Object, can be converted into a class object in java, etc.)

2. Interface - front-end, back-end and testing

The front-end uses the interface: design Ajax through the interface document given by the back-end personnel, send a request to the service through the interface, obtain the response data, and then perform the next page jump and display through the returned data.

Back-end generation interface: By writing an interface, it provides a channel for the front-end to interact with the server and data requests. Write the corresponding interface, the parameters that need to be passed, the parameter types, and so on. Then generate an interface document, share it with the front end, and let it write the corresponding Ajax according to the interface document.

Test and verify the interface: You can verify the interface through the interface document, check whether the interface developed by the back end corresponds to the Ajax written by the front end, and whether there is any wrong interface. You can also test the interface process to know whether the interface between the entire system is correct. Correspondingly, whether there is an interface is wrong, or it is not working properly.

3. Interface tools for front-end, back-end and testing

Front end: generally use postman, apipost or jmeter to verify the interface and view the response value

Backend: multi-use interface document generation tools and testing tools such as swagger, apipost, and postman

Test: jmeter, apipost, postman, etc. can perform verification tests on the interface.

4. Introduction of jmeter, postman, apipost, swagger tools

jmeter can perform interface testing and performance testing, but jmeter is not as convenient to use as postman and apipost for simple interface testing. jmeter focuses on stress testing, stability testing and load testing. An interface testing tool designed for the stability of interfaces and programs, with software performance as the main interface test and supplemented by interface testing.

 Postman is a plug-in for interface testing developed by Google, and also has a client. After Google is disabled in China, the postman plug-in is not easy to download and use. postman, an interface testing tool, is a very portable interface verification tool. You can directly request access to the interface by inputting the request method, url, and parameters, verify whether the interface is opened, and check the returned response value to check whether the interface development is normal. However, because it is developed by Google, it only supports the English version. It is especially uncomfortable for people who are not good at English.

Apipost, an interface testing tool, is mainly aimed at interface verification and interface document generation. Apipost, an interface testing tool, is a very portable interface verification tool. You can directly request access to the interface by inputting the request method, url, and parameters, verify whether the interface is opened, and check the returned response value to check whether the interface development is normal. According to these interface verification information, online documents and offline word documents can be generated directly. It is a great tool for interface testing and interface document generation, and unlike the interface documents generated by swagger, which are all in English, it is not very convenient to read. Apipost also has collaborative work, which can effectively realize the joint debugging of the front-end interface.

swagger is an interface document generation tool for back-end developers. A tool that generates interface documents mainly through comments in the code, but the generated interface documents are in English  

 

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey, and I hope it can help you! Partners can click the small card below to receive  

Guess you like

Origin blog.csdn.net/okcross0/article/details/130629047