In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the knowledge of "what is the core concept of interface testing". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
What is the interface in the developer port?
I believe that the vast majority of test students have heard that the word "interface" comes from the developer. The standard interface definition in books is called Interface. In the JAVA programming language, an interface is an abstract type, a collection of abstract methods, and an interface is usually declared in interface. A class overrides abstract methods in the interface by implementing the interface through the implements keyword.
For example:
Interface Animal {public void eat (); public void travel ();} class Cat implements Animal {public void eat () {/ / TODO Auto-generated method stub} public void travel () {/ / TODO Auto-generated method stub}}
In practical work, the interface that developers often talk about is not the theoretical interface interface, but is usually reflected in the following two ways:
1. It's a http request.
For example: http://host:port/getAllPeople
This request is an interface, and when you send the url, you will receive the request from the server. The core code on the server side is that there is a method to determine what url is, and if it matches getAllPeople, the relevant method is called, such as getAllPeople () {/ / specific implementation code}
two。 That is, the method getAllPeople () {/ / specific implementation code} is called directly without a http request.
What we testers are most concerned about is the first way, that is, calling the back-end service code through the http request. Because the test student code is relatively weak, it is difficult to test the interface directly through code invocation. In addition, the R & D code of many companies is absolutely confidential, and it is difficult for people outside the R & D team to obtain the code.
Why is interface testing so popular in recent years?
The traditional development model has changed from waterfall in the past to agile today.
With the popularity of mobile Internet, the requirements of user pages change frequently, but the server interface is relatively stable.
With the rise of microservices, many services simply do not have a UI for testers to click on, so we can only test the interface on the server side.
Common interface types
HTTP interface
RPC interface
Web Service interface
Dubble interface
RESTful interface
RESTful interface is based on HTTP interface, Web Service and Dubble belong to RPC interface. At present, HTTP interface is the most core and the most widely used interface!
Core test points of interface testing
Verify whether the interface parameters meet the requirements (boundaries, business rules)
Verify the correctness and format of the data returned by the interface
Verify whether the interface coverage meets the requirements (generally, core interfaces are required to achieve 100% test rate, while non-core interfaces are based on)
Whether the performance metrics meet the requirements (response time, processing capacity of the interface)
Whether the security indicators meet the requirements (general APIs will not be exposed to be called arbitrarily on the Internet, and some restrictions need to be made, such as authentication or authentication.)
Advantages of interface testing over UI testing
1. Interface testing is relatively easy to realize automation and continuous integration, and is relatively stable compared with UI automation.
two。 Testing can be involved earlier (the specific time should be when the interface debugging between modules is needed after the background interface development is basically completed)
3. Server problems that can not be covered by functional tests can be found.
Four steps for interface testing
1. Confirm the accuracy of the interface document, which is the standard for whether the interface test passes or not
two。 Prepare interface test data
3. Build an interface
The code selects either the httpclient jar package of java or the requests module of python
Tool selection postman, jmeter, etc.
4. Verify the interface request, obtain the response data of the interface after the successful call of the interface, and judge whether the interface test is passed or not according to the interface document.
Do well the necessary knowledge points for interface testing
Understand OSI network model, TCP/UDP protocol, HTTP/HTTPS protocol, RPC, Web Service and REST, Session and Cookie
Master the commonly used interface testing tools such as Postman,Jmeter,SoupUI
Master basic package grabbing tools such as Chrome developer tools, Fiddler,Wireshark, etc.
Master a programming language Python or Java
Understand Nginx, Apache, Tomcat and other server middleware
Master the basic database query commands and Redis operations to check the response results
Master basic Linux log query and filtering commands.
This is the end of the content of "what is the core concept of interface testing". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.