Software test engineers must know: how to do interface testing well

This article is mainly divided into two parts:

  The first part: Mainly starting from the problem, introduce the relevant content of interface testing and make a simple comparison with front-end testing, and summarize the differences and connections between the two. But that part only explains what to do and how to do it? Does not explain why?

  The second part: mainly introduces why to do interface testing, and briefly summarizes the content of continuous integration of interfaces and assessment of interface quality.

first part:

First of all, in the process of doing interface testing, back-end developers often ask:

  1. What does the backend interface test? How did you measure it?
  2. The back-end interface is tested once, and the front-end is also tested once. Is the test repeated?

      Therefore, in order to explain the above problems to developers and popularize basic testing common sense, the related content of interface testing and the difference between it and front-end testing are specially sorted out, so that the development team and the testing team can reach a basic consensus on testing and improve team collaboration. efficiency, so as to better ensure product quality.

Then, we try to answer the question above:

Question 1.1. What are the back-end interfaces tested?

  --To answer this question, we can start from the perspective of the content of the interface testing activities. Take a look at the following picture, which basically reflects the main content of the current back-end interface testing of our project:

 

Question 1.2, how do we do interface testing?

  --Because the front-end and back-end calls of our project are mainly based on the http protocol interface, when testing the interface, we mainly simulate the sending and receiving of http requests through tools or codes. There are many tools such as: postman, jmeter, soupUI, java+httpclient, robotframework+httplibrary, etc.

Question 2. The back-end interface is tested once, and the front-end is also tested once. Is the test repeated?

--To answer this question, we can directly compare the content of interface testing and app-side testing activities. The following figure shows the content that needs to be covered or considered during app testing:

 

   As can be seen from the comparison of the two figures above, the same parts of the two testing activities include functional testing, boundary analysis testing and performance testing . Other parts require special testing due to their different characteristics or concerns, which will not be discussed here. . Next, we will analyze the same content of the above three parts:

1. Basic function test:

Since it is tested for basic business functions, this part is the one with the highest degree of overlap between the two tests, and developers usually refer to this part of the content.

2. Boundary analysis test:

On the basis of basic functional testing, the boundary conditions of input and output are considered, and this part of the content will also have repeated parts (such as the boundary of business rules). However, the front-end input and output are often provided with sticky values ​​for the user to choose (such as a drop-down box). In this case, the boundary range of the test is very limited, but the interface test does not have this limitation, relatively speaking The interface can cover a wider range, and similarly, the probability of interface problems is higher.

 3. Performance test:

This is relatively easy to distinguish, although both require performance testing, but the focus is quite different. App-side performance mainly focuses on characteristics related to mobile phones, such as mobile phone cpu, memory, traffic, fps, etc. The interface performance mainly focuses on interface response time, concurrency, and server resource usage. The strategies and methods of the two tests are very different, so this part of the content needs to be tested separately. In theory, this is also a different part.

 

Summary:

1. The activities of interface testing and app testing have some repetitive content, mainly focusing on business function testing. In addition, the tests for their respective characteristics are different, and targeted tests need to be carried out separately to ensure the quality of the entire product.

2. Interface testing can focus on server logic verification, while UI testing can focus on page display logic and interface front-end and server integration verification

 

the second part:

1. What is interface testing?

Interface testing is a type of testing that tests the interface between system components. Interface testing is mainly used to detect the interaction points between the external system and the system and between the various internal subsystems. The focus of the test is to check the data exchange, transfer and control management process, as well as the mutual logical dependencies between systems.

 

2. Why do interface testing?

a) The complexity of today's systems continues to rise, the cost of traditional testing methods has increased dramatically and the testing efficiency has dropped significantly. Interface testing can provide a solution in this situation.

b) Interface testing is relatively easy to achieve automated continuous integration, and is relatively stable compared to UI automation, which can reduce labor costs and time for manual regression testing, shorten the testing cycle, and support the needs of rapid back-end release. Interface continuous integration is the root of why it can be low-cost and high-yield.

c) The front-end and back-end architectures of many systems are now separated. From a security perspective:

1. Only relying on the front-end for restrictions can no longer meet the security requirements of the system (it is too easy to bypass the front-end), and the back-end needs to be controlled as well. In this case, it needs to be verified from the interface level.

2. Whether the front-end and back-end transmission, log printing and other information are encrypted and transmitted also needs to be verified, especially involving the user's private information, such as ID cards, bank cards, etc.

 

3. Continuous integration of interface testing:

For interface testing, continuous integration automation is the core content. Only by maintaining automation can we achieve low cost and high profit. At present, we have realized interface automation, which is mainly used in the regression phase, and the degree of automation needs to be strengthened in the future, including but not limited to the following:

a) Process: In the regression phase, the coverage of abnormal interface scenarios will be strengthened, and it will gradually extend to the system testing and smoke testing phases, and finally achieve full-process automation.

b) Results display: richer results display, trend analysis, quality statistics and analysis, etc.

c) Problem location: The error information and logs are more accurate, which is convenient for problem recurrence and location.

d) Result verification: strengthen automatic verification capabilities, such as database information verification.

e) Code coverage: Constantly try to explore from the current black box to the white box to improve the code coverage.

f) Performance requirements: Improve the performance testing system and monitor whether the interface performance indicators are normal through automated means.

 

4. Interface test quality evaluation standard:

a) Whether the business function coverage is complete

b) Is business rule coverage complete?

c) Whether the parameter verification meets the requirements (boundary, business rules)

d) Whether the coverage of interface exception scenarios is complete

e) Whether the interface coverage meets the requirements

f) Whether the code coverage meets the requirements

g) Whether the performance indicators meet the requirements

h) Whether the safety indicators meet the requirements

 

Original address: http://www.51test.space/archives/2029

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326646398&siteId=291194637