Talking about Interface Testing

First, the necessity and significance of interface testing

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

Interface testing is implemented in a multi-system platform architecture, which has a very efficient cost-benefit ratio (of course, unit testing is more profitable, but the cost of implementing unit testing is larger 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 high-complexity platforms. The more complex the platform and the larger the system, the more obvious the effect of interface testing.

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

1. Save the cost of testing

   According to the calculation of the data model, a program bug in the bottom layer may cause about 8 bugs in the upper layer, and the bug in the bottom layer is more likely to cause the crash of the whole network; the interface test 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 inspection of the system interface from the user's point of view.

3. Higher efficiency

   Implementing interface testing as automation and continuous integration, the greater the complexity and volume of the system, the lower the cost of interface testing, and correspondingly, the higher the benefit output.

 

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 various internal components;

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

Protocol : including http protocol, TCP/IP protocol

Tools : Tools can help us complete our work better and more efficiently. Commonly used interface testing tools are: jmeter, loadrunner, soapui, postman, etc.;

Database knowledge : Whether it is acquiring knowledge from the database, confirming the data landing, 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: integrity, consistency, fault tolerance ;

 

3. Interface automation test

1. How to carry out

First, debug a single interface to ensure that the single interface is correct and unobstructed (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, don’t think too much or too complicated, do the most basic and simple first, and you will be successful. As for the extensible third-party interface, https, scheduled tasks, automatic test report, automatic email, etc. and other functions, which are continuously accumulated and optimized,

Just act, think too much, it is better to act, let the interface automation test land, which is the first thing we need to consider!

2. What you need to know before launching

How many pages does the current test object contain?

How many interfaces does each page involve?

At which step are they called?

What fields does each interface contain?

Which database table does each field correspond to?

What does each field in each table mean?

How does each interface operate on the table?

3. Automation Framework

What is a frame? You can understand it as a complete ring, or it can be understood as a complete set of environments, platforms, and anything for the interface test script to run; generally, an automated test framework includes the following points:

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

       log (log file), report (test report file, usually in xml format), case-data (test data for a single interface, usually in json format), server-data (data connected to interface business, which can be managed with excel)

Script management center: unified management, storage, and scheduling center for interface test scripts. Common tools include maven, ant, etc., or you can use the functions provided by the unit testing framework in the programming language, and you can choose the one that is suitable for you;

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

Continuous integration tools: The most common is Jenkins, its role is to monitor the execution of external program calls, time or trigger scheduling tasks, test script execution and other functions;

Communication services: RPC and REST synchronous invocation services such as dubbo, spring_boot, and thrift;

Test result statistics management center: such as testlink, the purpose is to automatically update and upload test results, better statistics 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, and improved maintenance of test scripts and test data. . .

The framework I am using is: python+mysql

 

For in-depth understanding and communication, please add QQ group: 49044146

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324821184&siteId=291194637