Smart test
The difference and connection between interface test and front-end test
Part: Mainly starting from the problem, introduce the relevant content of the interface test and make a simple comparison with the front-end test, and summarize the differences and connections between the two. But this part only explains how to do it and how to do it? Did not explain why to do it?
The second part: Mainly introduces why the interface test is to be done, and briefly summarizes the related content of interface continuous integration and interface quality assessment.
section:
First of all, in the process of interface testing, back-end developers often ask:
What are the back-end interfaces tested? How is it measured?
The back-end interface is tested once, and the front-end is tested again. Have you repeated the test?
Therefore, in order to explain the above issues to the development and popularize basic test knowledge, I deliberately sorted out the related content of interface testing and the difference between it and front-end testing, so that the development team and the testing team reached a basic consensus on testing, and improved team collaboration. Efficiency, so as to better ensure product quality.
Then, we try to answer the above question:
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 test activity. Take a look at the following picture, which basically reflects the main content of the back-end interface test of our project:
1.png
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, the testing of the interface is mainly to 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 tested again. Have you repeated the test?
--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:
It can be seen from the comparison of the above two figures that the same parts of the two test activities include functional testing, boundary analysis testing and performance testing. The other parts require special testing due to their respective characteristics or concerns, so we will not discuss them here. . Next, we will analyze the same content in the above three parts:
1. Basic function test:
Because the test is for basic business functions, this part is a part of the overlap of the two tests. The development students usually refer to this part of the content.
2. Boundary analysis test:
Consider the boundary conditions of input and output on the basis of basic functional testing. This part of the content will also have repetitive parts (such as the boundary of business rules). However, the input and output of the front-end are often provided with fixed values for the user to choose (draw the box below). 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 also higher.
3, performance test:
This is easier to distinguish, although performance testing is required, but the focus is quite different. App performance mainly focuses on mobile phone-related features, such as mobile phone cpu, memory, traffic, fps, etc. The interface performance mainly focuses on interface response time, concurrency, and server resource usage. The two kinds of testing strategies and methods 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 are partially repetitive, mainly focusing on business function testing. In addition, the tests for their respective characteristics are different, and specific tests are required 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 an interface test?
Interface test is a kind of test to test the interface between system components. The interface test 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 dependence between the systems.
2, why do interface tests?
A) Today's system complexity continues to rise, the cost of traditional test methods has increased sharply and the test efficiency has dropped significantly. Interface testing can provide a solution in this situation.
B) Interface testing is relatively easy to achieve automation and continuous integration, and it is relatively stable relative to UI automation, which can reduce the labor cost and time of manual regression testing, shorten the test cycle, and support the rapid release requirements of the backend. Continuous integration of interfaces is the root of why low-cost and high-yield.
C) At present, the front-end and back-end architectures of many systems are separated. From a security perspective:
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), 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 when it comes to 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 content. Only by holding automation can we achieve low-cost and high-yield. At present, we have achieved interface automation, which is mainly used in the regression stage. 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 phase, the coverage of abnormal scenes of the interface is strengthened, and gradually extended to the system test and smoke test phase, and finally the entire process is automated.
B) Results display: richer results display, trend analysis, quality statistics and analysis, etc.
C) Problem location: The error message and log are more accurate, which is convenient for problem reproduction and location.
D) Result verification: Strengthen automated verification capabilities, such as database information verification.
E) Code coverage: Constantly try to move from the current black box to the white box to improve the code coverage.
F) Performance requirements: Improve the performance test 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) Whether the coverage of business rules is complete
C) Whether the parameter verification meets the requirements (boundary, business rules)
D) Whether the coverage of the interface abnormal scene is complete
E) Whether the interface coverage meets the requirements
F) Does the code coverage meet the requirements?
G) Whether the performance index meets the requirements
H) Whether the safety index meets the requirements