Interface automation testing overview and process combing

Next, start learning interface automation testing. Because I have never touched it before, I will understand some basic knowledge first.

1. Overview of interface testing

2. Interface automation testing process.

 

Overview of interface testing

  • Interface, also called API (Application Programming Interface, Application Programming Interface), is used for interaction and data transmission between systems or code modules and modules.

The interface between the internal modules of the code is called the program interface. The interaction between the system and the system through the transmission of network data is called the protocol interface

  • Interface testing, that is, testing the stability and correctness of interaction between interfaces and data transmission. Generally refers to the protocol interface.

Why do (automated) interface testing?

1. Due to the increasing complexity of various systems, the cost of traditional testing methods has increased and the testing efficiency has dropped significantly. Compared with UI testing, interface testing is more stable, and it is relatively easy to achieve automated continuous integration, which can reduce the time for manual regression testing cost and shorten the test cycle.

2. Interface testing can be involved in project development earlier. Generally, as long as the interface is defined, you can write code. The functional test must wait until the system provides a measurable interface before proceeding.

3. Compared with UI testing (some testing environments are very troublesome), interface testing can cover the underlying code logic more simply and comprehensively, thus discovering some hidden bugs.

4. From the perspective of security, the front-end and back-end frameworks of most systems are now separated. Only relying on the front-end to restrict can no longer meet the security requirements of the system, and the back-end needs to be controlled synchronously, so the test also needs to be verified at the interface level.

5. More and more teams are beginning to accept the highly collaborative and integrated thinking of R&D, testing, operation and maintenance and delivery advocated by DevOps, which puts forward higher requirements for testing efficiency.

Interface Test Principle

mock client

The process of sending a request to the server, the server processes it after receiving it, and returns a response to the client, and the client receives the response.

Test Range

  • Business functions (including whether normal and abnormal scenarios are realized)
  • Business rules (whether the coverage is comprehensive)
  • Parameter verification (whether the boundaries and business rules meet the requirements)
  • Abnormal scenarios (repeated submission, concurrent submission, transaction interruption, multi-machine environment, large data volume test)
  • Performance testing (response time, throughput, concurrency, resource requirements)
  • Security testing ( permission verification
  • , SQL injection, etc.)

Interface automated testing process

1. Familiar with the business and needs, assess the feasibility and test scope

Not all businesses are suitable for automation, and feasibility, cost-effectiveness, sustainability, etc. need to be assessed. For example, for a project, only version 1.0 will be done, and it will be over when it is finished. What automation is there?

2. Determine the plan.

Specific business analysis, and the team to complete the most suitable tool selection.

Commonly used schemes are:

① Ready-made open source tools: postman/jmeter, etc.

② Some third-party platforms (charged)

③Our company develops an automated testing platform (few, and the quality of the platform is difficult to control)

④ Code editing automation framework, pytest, etc.

3. Design and build an automated test execution framework.

What is a framework? It is a complete set of environment for interface test scripts to run, including scripting language, tools, test cases, execution strategies, test reports, log collection, data analysis, report visualization, etc.

4. Execute the test

Execute test cases through the framework we designed, and we need to continue to pay attention to the points that the entire framework can optimize during the process. The main process is: send request - get result - parse result

5. Output test report

The test report is also output through the test framework, and the report should pay attention to the clear results and clear structure

6. Continuous integration

For interface testing, continuous integration is the key to automation. After the initial implementation of interface automation testing, it is necessary to continuously strengthen the degree of automation.

① In terms of process: In the process, continuously strengthen the coverage of interface exception scenarios, and gradually extend to system testing and smoke testing, and finally achieve full process automation

②Result display: richer result display, data statistics, quality analysis, etc.

③Problem location: reduce the difficulty of developing and locating problems by means of error messages, logs, screenshots, etc.

④Result verification: Continuously improve the automatic verification ability of results, such as database information verification.

⑤ Expansion: Expand in the direction of performance testing/security testing, etc., and monitor whether the interface performance indicators are normal through automated means.

Environmental preparation

Before starting the system learning, some environment needs to be prepared.

  • python environment
  • Install pytest, requests library
  • Learn about a packet capture tool, such as fiddler, charles
  • postman/jmeter installation

Ok, the next article will start to write specific interface testing related content.


 END meager strength

Finally, I would like to thank everyone who has read my article carefully. Looking at 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 [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey, and I hope it can help you too!

加入我的软件测试交流群:110685036免费获取~(同行大佬一起学术交流,每晚都有大佬直播分享技术知识点)

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

method of obtaining:

Guess you like

Origin blog.csdn.net/jiangjunsss/article/details/130704555