In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
The following is selected from "lie Software testing-performance, Automation, Security and team Management"
What is the interface test? How to do interface testing? Such questions are asked dozens of times almost every day, it can be seen that many friends do not know much about interface testing, and interface testing is now the top priority in Internet product testing, so it is necessary to learn and master it. In this chapter, we strive to lift the veil of interface testing and let everyone see its essence.
In particular, it should be pointed out that interface testing is also explained in other chapters of this book, such as LoadRunner, Jmeter, SoapUI, etc., so it is best to read this book if you want to master interface testing.
9.1 what is the interface test
Interface is sometimes called API, no matter what it is, it is essentially an interface, just like calling your full name and nickname, essentially you. We give you two explanations for what interface testing is.
Unpopular explanation: send a request to the server, and the server returns a response after processing. We verify whether the response is in line with the expected results. We don't care how the server handles the request. All we care about is input and output, as shown in figure 9.1.
Figure 9.1 request and response
Popular explanation: the interface is the same as the USB of a computer, you don't need to care about how it is implemented internally, you just need to know where the interface is, how to use it, and what you can do when plugged in. For example: I want to verify that this USB can be used, then insert the mouse, the mouse can work normally to show that USB can be used, we do not care about the implementation logic of USB. In the same way, our interface tests are the same.
9.2 Interface documentation Specification
The premise of interface testing is that there must be interface documentation, through which we need to obtain the description of the interface, request parameters, response parameters and some dependencies. In general, companies will have interface documentation, after all, developers also have to do interface maintenance, if there is no documentation later, it is more troublesome to maintain. Of course, some companies do not have interface documentation, so test engineers can only analyze requests and responses by grabbing packets.
The standard interface documents are beneficial to both development and testing, and generally include interface name, interface description, interface address, request method, request parameters and format, response parameters and format, and so on. Specific examples are as follows:
L API name: mLogin
L API description: mobile login API
L interface address: http://xxx/mLogin
L request method: POST
L supported format: JSON
L request parameters:
Username required type string user name
Pwd required type string password
L response parameters:
ErrorCode status code 0 indicates success; 1 indicates failure
Username user name
Here is just an example of what descriptions are actually needed that need to be adjusted according to the actual situation.
The maintenance of interface documents is also a headache, especially when there are a large number of interfaces. The maintenance methods I have seen are as follows:
L Word or Excel maintenance. It is not recommended, it is OK when the quantity is small, but it is too difficult when the quantity is large.
L Wiki maintenance. Recommendation is relatively easy to manage.
L interface document maintenance tool. For example: apizza, apiview, Yaoji, etc., as shown in figure 9.2.
Figure 9.2 Interface document maintenance tool
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.