[2023 The most complete tutorial on the whole network] Introduction to interface automation testing summary and sharing

Last night in a test exchange group, I listened to an old test driver share the content of interface automation testing, and gained a deeper understanding of interface automation, which also provided more ideas for the company's next implementation of interface automation.

In this article, I will talk about the advancement from functional testing to interface automation , and some things about interface automation. . .

foreword

Automated testing is a hot topic in recent years. Of course, it is a development trend of software testing in the future. In the future, non-core testing work such as functional testing will be outsourced.

If you want to continue to move forward in the software testing industry, you must have core competitiveness, and mastering automated testing technology is an essential skill .

It is introduced in the book "The Way of Google Software Testing": At Google, 70% of the automated testing work is focused on unit testing, 20% is focused on interface testing, and the remaining 10% is UI testing.

It is true that we do not have such a complete mechanism and engineer culture as Google, and there is no need to copy everything from Google, but Google, as the most dazzling company in the Internet 2.0 era, its technology development direction, process management, etc. can be said to be in the near future, we also have to direction of arrival. Choosing the one that suits us and implementing it is what we should do now.

At present, the domestic Internet industry is still in a period of rapid development in terms of the general environment and requires process standardization . How to keep up with the changing pace of development requires continuous learning and self-improvement in addition to constantly understanding and contacting new things. Keep up with the tide of the times with the inner driving force. Even if you can't be a waver, you can't become the group eliminated by the times.

01. The necessity and significance of interface testing

Interface, namely API, application programming interface, introduction about interface.

Here we mainly talk about the necessity and significance of interface testing:

The interface test is implemented under the multi-system platform architecture, which has an extremely efficient cost-benefit ratio (of course, the unit test has higher benefits, but the cost of implementing unit tests is greater and the technical requirements are higher, so you should choose a talent that is more suitable for you. is the best solution).

Interface testing inherently brings efficient defect detection and quality supervision capabilities to highly complex platforms. The more complex the platform, the larger the system, the more obvious the effect of interface testing.

In general, interface testing is the best solution driven by the inherent requirements of high-complexity system quality and low-cost economic interests, mainly reflected in the following three aspects:

1. Save the test cost

According to the data model calculation, a program bug at the bottom layer may cause about 8 bugs at the upper layer, and a bug at the bottom layer is more likely to cause a crash of the entire network; interface testing can provide a low-cost and high-efficiency solution when the system complexity increases.

2. Interface testing is different from unit testing

Interface testing is a comprehensive, efficient and continuous detection of system interfaces from the perspective of users.

3. Higher benefit

Realize interface testing as automation and continuous integration. When the complexity and size of the system increase, the cost of interface testing will be lower, and correspondingly, the benefit output will be higher.

02. What skills are needed for interface testing

To do interface testing, the skills required are basically the following:

Business flow : understand the business logic interaction between the system and internal components;

Data flow : understand the I/O of the interface (input/output: input and output);

Protocol : including http protocol, TCP/IP protocol family (previous blog has systematically introduced the protocol, portal: http protocol: rookie entry series)

Tools : Tools can assist us to complete work better and more efficiently. Commonly used interface testing tools include: jmeter, loadrunner, soapui, postman, etc.;

Database knowledge : Whether it is acquiring knowledge from the database, confirming the landing of data, or what operations the interface performs on the data, it needs to be confirmed, so database knowledge (actually adding, deleting, modifying and checking) is necessary;

Supplement: Several necessary points of the interface document: completeness, consistency, fault tolerance ;

03. Interface automated testing

1. How to carry out

First, debug a single interface to ensure the correctness and smoothness of a single interface (similar to the benchmark test in performance testing);

Secondly, clarify the data flow and business flow;

Finally, string together N interface test scripts and execute them;

The most important point is, don’t think too much and make it too complicated. Do the most basic and simple things first, and you will be more than half successful. As for scalable third-party interfaces, https, scheduled tasks, automatic test reports, automatic emails, etc. and other functions, which are continuously accumulated and optimized,

It’s enough to act. If you think too much, it’s better to act. Let the interface automation test be implemented, which is the first thing we need to consider!

2. What you need to know before starting

How many pages does the current test object contain?

How many interfaces are involved in each page?

In which step are they called?

What fields does each interface contain?

Which table in the database does each field correspond to?

What do the fields in each table mean?

What kind of operation does each interface have on the table?

3. Automation framework

What is a framework? You can understand it as a complete ring, or as a complete set of environments, platforms, and anything you want for interface test scripts to run. Generally, an automated test framework includes the following points:

Data pool: that is, the storage management of test data, generally integrated into a data package, including:

log (log file), report (test report file, generally in xml format), case-data (test data of a single interface, generally in json format), server-data (data in serial connection of interface services, which can be managed by excel)

Script management center: the unified management, storage, and scheduling center of interface test scripts. Commonly used tools include maven, ant, etc., or you can use the functions provided by the unit test framework in the programming language and choose the one that suits you;

Running platform : Generally, these test scripts are run with the help of tools. The tools can use the above-mentioned ones (jemter, loadrunner, soapui, etc.). Similarly, it is important to choose the right one;

Continuous integration tool: the most common one is Jenkins, its function is to monitor the call execution of external programs, schedule or trigger scheduling tasks, test script execution and other functions;

Communication services: dubbo, spring_boot, thrift and other RPC, REST synchronous calling services;

Test result statistics management center: such as testlink, the purpose is to automatically update and upload test results, better statistical test results for later optimization;

So much has been said above, in fact, its meaning is: separation of data and scripts, automatic submission of test results notifications, improved maintenance convenience of test scripts and test data, etc. . .

The framework I am using is: jemter+maven+Jenkins+dubbo+MySQL …

Regarding interface automation testing, it is basically the above content. Of course, choosing a framework that suits your actual situation and implementing it is the key point. Only by taking action can salty fish turn around. . .

Finally, I would like to thank everyone who has read my article carefully. Seeing the fans’ growth and attention all the way, there is always a need for reciprocity. 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 friends who want to advance [automated testing]. This warehouse has also accompanied me through the most difficult journey, and I hope it can help you too! Everything should be done as early as possible, especially in the technical industry, we must improve our technical skills. I hope it will be helpful to everyone... These are all in the learning exchange group I created. In the group, there are not only free resource acquisition, but also technical exchanges with peer leaders....

Supongo que te gusta

Origin blog.csdn.net/m0_58026506/article/details/130172121
Recomendado
Clasificación