Summary of the enterprise interface testing process, what detours have you taken? There is no blame...


foreword

First of all, we must make it clear that usually the interface test is actually a functional test, which mainly verifies whether the interface achieves the predetermined function, although in some cases it may be necessary to perform performance testing and security testing on the interface.

Composition of URLs

In order to better understand the interface test, we need to understand the URL of the interface. The following takes the GET request URL as an example. The composition example is as follows:

D1

As can be seen from the figure above, a typical GET request URL can be divided into the following parts:

Transmission protocol: The interfaces encountered during work are generally http/https protocols
Server domain name/IP address: Refers to the server address deployed by the system that provides the interface Port
: If left blank, the default port is 80
Resource path: The server path request where the resource is
requested Parameters: For GET requests, parameters are separated by ? after the resource path, and separated by & between parameters.

Such as http://127.0.0.1:8080/message?wd=pytest&ie=utf-8, there are 2 parameters wd and ie.

The difference between the URL of the POST request and the URL of the GET request is that the parameters of the POST request are placed in the request body instead of directly in the URL.

Interface testing process

The process of manual interface testing is as follows:
check the requirements document and interface document, and clarify the test content, that is, the interface information.
Write test cases according to requirements documents and interface documents.
Execute tests against test cases.
Record test results, send interface test report (if required).

Next, take a login interface as an example to explain the process of interface testing.

interface documentation

To test an interface, you must first clarify the specific information of the interface: request url, request method, request header, request body (fields and descriptions), response body (fields and descriptions).

You can view the information through the interface documents provided by the development, and then design test cases according to the interface information (the design of interface test cases mainly refers to the interface documents).

The following example is an interface document for a login interface:

D2

From this interface document, we can see the specific information related to the interface, but this document does not explain the request header, so there is no requirement for the request header when requesting.

use case design

Use case design method
When designing interface test cases, consider input, logic processing, and output from three aspects:

Input, design use cases according to whether it is required, parameter type, byte length, parameter combination, etc.;
logic processing, that is, design use cases according to business logic;
output, that is, analyze and design use cases based on output results;
except whether the positive verification function is realized , some abnormal scenarios should also be considered based on business scenarios and processing logic.

For example:

D3

use case authoring tool

There are many carriers for use case design, such as Excel, XMind, or some test management platforms such as testlink, etc., which are in line with your own habits, easy to manage, and clear at a glance.

If you use Excel to design test cases, you can refer to the following principles:
a module corresponds to an Excel table;
an interface corresponds to a sheet; a
row in the sheet corresponds to a test case;

Indicate pre-conditions and post-operations. If the login use case needs to register a user first, the user may need to be deleted after the test is completed. At this time, the corresponding operation can be written in.

For the above login interface, use Excel to design test cases as follows:

D4

test execution

There are two ways to perform interface testing, using tools or writing codes, tools such as: postman, soupUI, etc., generally using Java and Python to write codes.

Interface testing is performed according to test cases. Manual interface testing is generally recommended to use postman, which is convenient and fast.

Here, take the above login interface as an example, use postman to perform request testing, the example is as follows:

D5

The test result is directly recorded in the test result column corresponding to the test case. If a test report is required, all test cases of the use case must be integrated in the test report.

General interface testing is actually functional testing. Here we take manual interface testing as an example to illustrate the process. The steps of interface automation testing are actually similar to this process, except that scripts need to be used instead of interface debugging tools.

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

Persevere in pursuit, overcoming thorns and thorns; arduous struggle, creation and handing down. Step over the shadow of failure and chase the light of success. Keep surpassing yourself and go forward bravely, you will write your own glorious legend! Struggle unceasingly, bloom the magnificence of life!

Be firm and ignite the fire in your heart; forge ahead against the wind and surpass your own limits. Every step is a forward force, and every effort creates a brilliant miracle. Only by persisting in the journey of struggle can you bloom your own brilliant life! Embrace your dreams and move forward bravely!

Jump over the ups and downs of life, let go of the dream in your heart; strive to climb the peak of life, and write your own legend handed down from generation to generation. Believe in your own strength and go forward bravely, you will surely create a brilliant chapter in your life!

Guess you like

Origin blog.csdn.net/csdnchengxi/article/details/132147181