Understand interface testing in one article (practical + documentation)

Interface test definition

The interface is a bridge for front-end and back-end communication and a channel for data transmission, including external interfaces and internal interfaces. Internal interfaces also include: upper-layer service and lower-layer service interfaces, peer interfaces

Common interfaces in life: computer keyboard, USB interface, elevator buttons, KFC ordering

Interface testing: testing the interface between systems or components, mainly verifying the exchange, transmission and control management process of data, as well as mutual logical dependencies

Interface automated testing: the process of letting programs replace humans in automating verification testing of interface projects

The meaning of interface testing

Interface testing makes the phrase "test input earlier" a reality

Interface testing can test some areas that are very difficult or impossible to test in interface testing

From the impact on the project, interface testing directly tests the back-end service, which is closer to the code running on the server and can better detect bugs with a wide range of impacts.

Interface testing is easier to integrate with automated testing systems

Summary: Being proficient in interface testing and being able to independently build an interface testing framework is a watershed reflection of a test engineer’s ability.

At the same time, I have also prepared a software testing video tutorial for everyone (including interviews, interfaces, automation, performance testing, etc.), which is below. If you need it, you can watch it directly, or you can directly click on the small card at the end of the article to get the information document for free.

Where to watch software testing video tutorials:

Bilibili Fengshen’s interface testing tutorial, complete 70 projects in 30 days (including automated testing and performance testing), you will be employed immediately after completing the course, and you will be free of charge forever!

Implementation of interface testing

Method to realize

1. Use interface testing tools to implement, such as jmetey, postman
2. Implement by writing code, such as python+requests

Compare the two

1. Interface tools: easier to use; test data is difficult to control; inconvenient to test encryption interfaces; insufficient expansion capabilities
2. Code implementation: difficult; test data is easy to control; encryption functions can be used to encrypt the interface; easy to expand

The principle of interface testing

Interface testing is based on protocols and is actually a black box test. The basic testing idea is to judge
whether the logic of the system or object under test meets user needs through input and output.

HTTP protocol

http (Hypertext Transfer Protocol): Hypertext Transfer Protocol, a simple request response protocol

https: It is an HTTP channel aimed at security. Based on HTTP, the security of the transmission process is ensured through transmission encryption (SSL) and identity authentication.

FTP (File Transfer Protocol): File transfer protocol. This protocol is generally used when transferring large files on the network.

HTTP composition

HTTP messages are the way data is exchanged between the server and the client. There are two types of messages:

1. Request: sent by the client to trigger an action on the server

A request consists of three parts: request line, request header, and request body.

2. Response: response from the server

The response also consists of three parts: status line, response header, and response body.

What are the request methods for http?

GET: Send a request to a specific resource
Post: Submit data to the specified resource for processing request
HEAD DELETE TRACE CONNECT OPTINONS PUT

Interface testing process

Interface testing is also a functional test, so it is not much different from our previous functional testing process. The testing process is still:

1. Analyze test interface documents
2. Write test cases based on interface documents
3. Prepare interface test scripts, usually done with tools
4. Execute interface test activities
5. Get interface test reports

A little help

PS: Here is a collection of self-study tutorials for software testing. It should be very helpful for those who are developing in the testing industry. In addition to basic introductory resources, bloggers also collect a lot of advanced automation resources. From theory to practice, only by integrating knowledge and action can you truly master it. The full set of content has been packaged on the network disk, and the total content is close to 500 G.

☑ 240 episodes - a complete set of video courses from zero to mastery
☑ [Courseware + Source Code] - complete supporting tutorials
☑ 18 sets - source code of practical testing projects
☑ 37 sets - testing tool software package
☑ 268 - real interview questions
☑ 200 templates - Interview resume template, test plan template, software test report template, test analysis template, test plan template, performance test report, performance test report, performance test script case template (complete information)

These materials should be the most comprehensive and complete preparation warehouse for friends who do [software testing]. This warehouse has also accompanied me through the most difficult journey. I hope it can also help you! Everything must be done early, especially in the technical industry, where technical skills must be improved.

 

Guess you like

Origin blog.csdn.net/huace3852/article/details/132984840