Today, I will introduce the interface tools (jmeter, postman, swagger, etc.)

1. What types of interfaces are there?

The interface is generally divided into two types: 1. The internal interface of the program 2. The external interface 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. He can only provide you with a method they wrote to obtain data. You quote him to provide 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 and methods, the interaction between modules and modules, the interface thrown inside the program, such as the bbs system, there are login modules, post modules, etc., then you must log in before you 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 the HTTP protocol through the soap protocol. The request message and the return message are in xml format. When testing, we use tools to call and test.

  The http api interface is based on the http protocol, and the method of calling is distinguished by the path. The 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 two most commonly used. request method.

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

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

The front-end uses the interface: the Ajax design is carried out through the interface document given by the back-end personnel, the request is sent to the service through the interface, the response data is obtained, and then the next page jump and display are performed through the returned data.

Back-end generation interface: Provide a channel for the front-end to interact with the server and data requests by writing an interface. Write the corresponding interface, parameters to be passed, parameter types, etc. 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 an error interface. You can also pass the interface process test to know whether the interface between the entire system is correct. Correspondingly, there is no interface that is wrong, or is not functioning 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: use swagger, apipost, postman and other interface document generation tools and testing tools

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

4. Introduction to jmeter, postman, apipost, and swagger tools

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


 

Postman is an interface testing plugin developed by Google and also has a client. After Google is disabled in China, the postman plugin is not easy to download and use. Postman, an interface testing tool, is a very lightweight interface verification tool. You can directly request access to the interface by entering the request method, url, and parameters to verify whether the interface is open. You can also 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 is an interface testing tool, mainly for interface verification and interface document generation. apipost, an interface testing tool, is a very lightweight interface verification tool. You can directly request access to the interface by entering the request method, url, and parameters to verify whether the interface is open. You can also check the returned response value to check whether the interface development is normal. According to the verification information of these interfaces, online documents and offline versions of word documents can be generated directly. It is a great tool for interface testing and interface documentation generation. Unlike the interface documentation generated by swagger, it is not very convenient to read in English. apipost also has collaborative work, which can effectively implement front-end interface debugging.

Swagger is a tool for generating documentation through an interface with back-end developers. A tool that generates interface documents mainly through comments in the code, but the generated interface documents are in English 

 

 Download address: You can go to the official website to download it yourself, or move to gzh [clear 0] to get it

Guess you like

Origin blog.csdn.net/qq_60168783/article/details/123487338