Comprehensive organization, interface testing + summary of why interface testing is needed, and a thorough understanding...


Preface

1. What is interface testing?

Interface testing is a type of testing that tests the interfaces between system components. Interface testing is mainly used to detect interaction points between external systems and systems and between internal subsystems.

The focus of testing is to check the exchange of data, transmission and control management processes, as well as the mutual logical dependencies between systems, etc.

Generally speaking, testing the interface refers to testing the function, performance and stability of the interface, and of course there may be security testing. This introductory series will enable you to master the functional testing of interfaces.

Generally speaking, the interfaces we hear about basically refer to the interface testing of HTTP or HTTPS protocols, that is, some web service requests.

In a software project, there are many interfaces, ranging from dozens to hundreds or thousands of interfaces. At this time, we have no software interface, no specific test scenarios, only an interface description document. We need to use abstract things like interfaces to test interfaces through software testing theories and methods to find out the functional and security flaws of the interface.

Interfaces include internal interfaces and external interfaces. The internal interface is the interface developed by the developer himself. External interfaces, such as websites calling WeChat payment and Alipay payment interfaces. There are also interfaces between modules.

2. Why do we need to do interface testing?

1) Nowadays, the front-end and back-end architecture of many systems are separated, because the work progress of different ends (front-end, back-end) is different, so we have to focus on the interfaces that came out at the beginning, and those that need to be called by other companies (banks, Alipay, WeChat, qq, etc.) Some interfaces are used for interface testing and data verification.

From a security perspective, relying only on the front-end for restrictions is completely unable to meet the security requirements of the system (it is too easy to bypass the front-end). The back-end needs to be also controlled. In this case, verification needs to be done at the interface level.

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 involves users' private information, such as ID cards, bank cards, etc.

2) Nowadays, the system is becoming more and more complex, and the traditional front-end testing has greatly reduced the efficiency, and now we all advocate moving testing forward, also called testing left shifting, and hope that testing can intervene in testing earlier, so interface testing is a way to early way of intervention.

For example, in traditional testing, you have to wait until the front and back ends are completed before you can test and write automated code. If it is an interface test, you only need to define the interface on the front and back ends, and then automation can intervene to write the interface automation test code. Manual testing only needs the back-end code to be completed, and you can intervene to test the back-end logic without waiting for the front-end work to be completed.

The principle of shift-left testing enables testing teams to collaborate with all stakeholders early in the software development cycle. Therefore, they can clearly understand the requirements and design test cases to help the software "fail fast", prompting the team to fix all bugs earlier.

There is nothing unique about shift-left testing. It just allows testers to participate earlier in the software development life cycle. At the same time, it allows them to understand requirements, software design, software architecture and software functions, and also allows them to communicate with customers and business analysts. Ask questions, find answers, and provide feedback to developers to support the team's work.

3. Pyramid model

1) The lower the level, the more stable
it is. The main point of view of the pyramid is that unit testing has high stability and requires more investment.

2) The lower the level, the more efficient
the program. Problems in the program will eventually fall on the specific code, so it is easier to find problems through testing at the bottom.

3) The lower the layer, the lower the cost.
The lower the layer, the earlier the problem can be discovered. The earlier the problem is discovered, the lower the cost of repair will naturally be.

4) The lower it is, the more difficult it is to implement.
The lower the level of implementation, the higher the requirements for technical expertise. This is somewhat contradictory to the third point. More professional talents often mean higher labor costs.

The interface separates the front-end and the back-end well, and helps the front-end and back-end realize data interaction. In this way, in the early stage of the project, you can discuss the required back-end data with the front-end engineer, and then the back-end develops the back-end interface according to the needs and returns the data to the front-end. Testers enter the test interface in advance, and the front and back ends develop their own modules.

Project migration, as well as later maintenance, the convenience brought by the interface, imagine if after no project delivery, the back-end staff modified the length and type of a certain field in the database before releasing it, but for some reason did not notify the front-end in time Engineer, at this time, the type and length of the field obtained by the front end are the previous ones, which may cause an online accident.

If the front-end technology is excellent, the storage and acquisition field is a variable, and the workload is relatively small. Just change the variable type and length.

If it is an almost useless variable, and hundreds of front-end pages use this field, the consequences will be unimaginable, but the interface will be different. If a similar situation occurs, later The terminal personnel only need to process this field through the interface and keep the returned fields consistent, which is a matter of minutes, and may be fixed without the user noticing.

Moreover, front-end, back-end, and testing are also very easy to troubleshoot problems. If you run the interface and check the interface document to return data if there is a difference, you can just fix the interface. This will greatly improve the efficiency of handling problems.

Brief summary:

①The lower a bug is found, the lower its repair cost is.
② The front-end can be changed at will, and the interface has been tested. The back-end does not need to be changed. The front-end and back-end are developed by two groups of people.

③ Check the security and stability of the system. The front-end parameters cannot be trusted. For example, in JD.com shopping, it is impossible to pass -1 yuan for the front-end price, but -1 yuan can be passed in through the interface.

④Today's system complexity continues to rise, the cost of traditional testing methods has increased sharply and testing efficiency has dropped significantly. Interface testing can provide a solution in this case.

⑤ Interface testing is relatively easy to implement automated continuous integration, and is relatively stable compared to UI automation. It can reduce the labor cost and time of manual regression testing, shorten the testing cycle, and support the rapid release requirements of the backend. Continuous integration of interfaces is the root of low cost and high profits.

⑥Nowadays, the front-end and back-end architecture of many systems are separated. From a security perspective:

Relying only on the front-end for restrictions is completely unable to meet the security requirements of the system (it is too easy to bypass the front-end). The back-end needs to be also controlled. In this case, verification needs to be done at the interface level.

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 involves users' private information, such as ID cards, bank cards, etc.

The following is the most comprehensive software testing engineer learning knowledge architecture system diagram in 2023 that I compiled.

1. Python programming from entry to proficiency

Please add image description

2. Practical implementation of interface automation projects

Please add image description

3. Web automation project actual combat

Please add image description

4. Practical implementation of App automation project

Please add image description

5. Resumes of first-tier manufacturers

Please add image description

6. Test and develop DevOps system

Please add image description

7. Commonly used automated testing tools

Please add image description

8. JMeter performance test

Please add image description

9. Summary (little surprise at the end)

Only through unremitting efforts can you reach the other side of success; every day is your opportunity to change your destiny, move forward courageously and fearlessly. Believe in yourself, chase your dreams, and create a brilliant future!

Difficulties are the catalyst for growth, and challenges are the motivation for struggle. No matter how bumpy the road ahead is, as long as you have faith and perseverance and pursue unremittingly, success will belong to you!

Every attempt is an opportunity for growth; every step of exploration is the beginning of success. As long as you keep moving forward and strengthen your faith, realizing your dreams is no longer far away!

Guess you like

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