If you want to understand the difference between interface testing and functional testing, you must know their basic principles

This article is mainly divided into two parts:

The first part: mainly starts from the problem, introduces the relevant content of the interface test and makes a simple comparison with the front-end test, and summarizes the differences and connections between the two. But this part only explains how and how? And doesn't explain why it's done?

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

first part:

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

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

Therefore, in order to explain the above problems to the development and popularize the basic common sense of testing, the relevant content of interface testing and the difference between it and the front-end testing are deliberately sorted out, so that the development team and the testing team can reach a basic consensus on testing and improve teamwork. Efficiency, so as to better guarantee product quality.

Then, we try to answer the questions above:

What are the backend interfaces tested?

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

 

How do we do interface testing?

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

The back-end interface is tested once, and the front-end is also tested again. 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:

 

From the comparison of the above two figures, it can be seen that the same parts of the two test activities include functional testing, boundary analysis testing and performance testing, and 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 the test is aimed at basic business functions, this part is the part with the highest overlap between the two tests, and developers usually refer to this part.

2. Boundary analysis test:

  Consider the boundary conditions of input and output on the basis of basic functional testing, and this part will also have repeated parts (such as the boundary of business rules). However, the input and output of the front end often provide sticky values ​​for users to choose (such as drop-down boxes). In this case, the boundary range of the test is very limited, but there is no such limitation in the interface test. Relatively speaking The interface can cover a wider range. Similarly, the probability of interface problems is also higher.

 3. Performance test:

  This is relatively easy to distinguish. Although performance testing is required for both, the focus is quite different. App-side performance mainly focuses on features related to mobile phones, such as mobile phone cpu, memory, traffic, fps, etc. The interface performance mainly focuses on the 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?

 

Before doing interface testing, you need to master those knowledge

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

2. Why do interface tests?

a) The complexity of today's systems is increasing, the cost of traditional testing methods has increased sharply and the testing efficiency has dropped significantly, and interface testing can provide a solution in this case.

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

  c) Nowadays, the front-end and back-end architectures of many systems are separated. From the perspective of security:

        1. Relying only 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 also needs to be controlled. In this case, it is necessary to verify from the interface level.

        2. It also needs to be verified whether the information such as front-end and back-end transmission and log printing is encrypted and transmitted, especially when it involves user's private information, such as ID card, bank card, etc.

3. Continuous integration of interface testing:

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

  a) In terms of process: In the regression stage, the coverage of interface exception scenarios is strengthened, and gradually extended to the system test and smoke test stages, and finally achieves full process automation.

  b) Result display: richer result display, trend analysis, quality statistics and analysis, etc.

  c) Troubleshooting: Error messages and logs are more accurate, making it easier to reproduce and troubleshoot problems.

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

  e) Code coverage: Constantly try to drop from the current black box to the white box to improve 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 criteria:
  

a) Whether the business function coverage is complete

b) Whether the business rule coverage is complete

c) Whether the parameter validation 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

 

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

These materials should be the most comprehensive and complete preparation warehouse for [ software testing ] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey, and I hope it can help you! Partners can click the small card below to receive

Guess you like

Origin blog.csdn.net/okcross0/article/details/132582543