10-year software testing engineer——Talking about interface automation testing

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 blog, I will talk about the advancement of 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 the direction we will reach in the near future. 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 ever-changing pace of development, in addition to constantly understanding and contacting new things, you also need to continue to learn, improve yourself, and use the internal driving force to keep up with the tide of the times. Even if you can't be a waver, you can't become the group eliminated by the times. Speaking of which, I recommend 2 books: Wu Jun's books "Top of the Wave" and "The Mystery of Silicon Valley". Interested children's shoes can go and have a look. . .

1. The necessity and significance of interface testing

Interface, namely API, application programming interface, here mainly talk about the necessity and significance of interface testing:

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

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.

2. What skills are needed to do 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 ( Introduction to HTTP protocol ), TCP/IP protocol family ( Introduction to TCP protocol )

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 to obtain knowledge from the database, or to confirm the landing of the data, or what operations the interface performs on the data, it needs to be confirmed, so database knowledge (in fact, adding, deleting, modifying, and checking) is very necessary;

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

3. 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 first, and you will be more than half successful. As for the scalable third-party interface, https, scheduled tasks, automatic test report, automatic email and other functions, these are constantly 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-mentioned 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. . .

The following is the supporting information. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/myh919/article/details/131831413