Interface automated testing from entry-level to advanced practice!

Interface testing background and necessity

Interface testing is a test that tests the interface (API) between system components. It is mainly used to detect the quality of interaction between internal and external systems and internal subsystems. Its testing focus is to check the accuracy of data exchange and transmission, control and interaction Management process, as well as the mutual logical dependencies between systems, etc.

Today's Internet applications (Apps) are generally built based on the idea of ​​front-end and back-end separation architecture, that is, the back-end provides a data interface, and the front-end calls the interface to return JSon data and renders it to the UI. With the popularity of microservices, there are more and more back-end service modules, and the technical team urgently needs a more efficient and stable method to obtain system quality information for defect detection and quality supervision.

Real enterprise back-end services and key quality assurance tools for layered automation

The previous ideas and methods based on UI automated testing technology can no longer meet actual needs due to their inefficiency, complexity, and error-proneness. However, the service-oriented interface automated testing system has emerged as the times require and has become the most mainstream quality management method in the industry. Especially for high-complexity Internet enterprise platforms, the more complex and large the system, the more obvious the effect of interface test automation and continuous integration will be. The industry already has mature low-cost, high-efficiency solutions, open source tools and case experience. At present, familiarity with and mastery of interface automation testing technology has become a basic requirement for first-line Internet companies for intermediate and senior test development engineers.

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:310357728【暗号:csdn999】

Quality goals for interface testing

The construction of a complete interface automated testing system is mainly considered from the following perspectives:

quality dimension

  • Functional: Maintain compatibility between old and new versions
  • Normal performance: the response time of a single request is related to the overall qps
  • Change detection: missing fields, changed field types
  • Exceptions and robustness testing

Quality system

  • Build a fast and stable quality assurance system for the interface layer
  • Build an interface monitoring system

Interface testing process

The actual process of implementing interface testing within the enterprise is as follows:

  1. Scope of interfaces: how many services and interfaces need to be covered
  2. Interface analysis: interface protocol, upstream and downstream dependencies
  3. Interface test case design: how to simulate and cover business use cases
  4. Interface testing framework selection: choose the appropriate framework
  5. Test case writing and maintenance: test case writing and maintenance updates
  6. Continuous integration: continuous integration testing

Interface range to be tested

Common interface ranges to be tested are as follows:

  1. Business needs research: Businesses with common problems in R&D and product feedback
  2. Interface documentation: manual documentation, documentation automatically generated by Swagger
  3. Code analysis: analyze the code of frameworks such as Spring
  4. Online Log and Data: Online Production Monitoring and Interface Log
  5. Client packet capture: Interface behavior analysis based on user perspective

Common packet capture analysis

  1. Monitoring analysis: TCPDUMP + WireShark + HAR extraction tool
  2. Agency Analysis: Charles + BurpSuite
  3. Forwarding analysis: modify Host domain name + reverse proxy forwarding

Test case design

  1. Process analysis of interface calling
  • Agent capture packet
  • Online Log Extraction
  • Artificial Use Case Supplement: Business Modeling with Flowcharts and Mind Maps
  • Normal scenario use case Right Path
  • Abnormal scenario use cases
  • Security and stability use cases

Interface testing framework selection

Regarding how to choose an interface testing framework, here are a few common framework features for reference:

  1. Early stage: HTTPClient encapsulation based on various languages
  2. JMeter: performance testing tool, does not have a complete interface testing framework function
  3. RobotFramework: Powerful ATDD tool, but too restrictive
  4. RestAssured + Swagger
  5. SoapUI [Commercialization]

The open source Rest-Assured is recommended here, it has the following advantages:

  • Simple interface test DSL
  • Support structured parsing of XML JSon
  • Supports multiple parsing methods such as XPath JSonPath GPath
  • Comprehensive support for Spring

What are the technical challenges of a landing interface automated testing system?

To truly implement the interface automated testing system, test development engineers must choose an appropriate framework based on the actual business situation of the company, and be proficient in the use of interface testing tools and platforms, design universal, easy-to-verify, robust and easy-to-use interface test cases, and also You need to master the data-driven mechanism and be able to use assertions to improve interface test cases.

Secondly, you also need to understand the interface testing architecture and common back-end publishing mechanisms, be able to test microservice frameworks such as Dubbo based on the RPC protocol, be familiar with test cases and suite management mechanisms, and master the method of executing use cases in Jenkins, so that interface testing can be truly realized. of automation.

In addition, the interface test plan must be continuously optimized. Interface test cases can be automatically generated through packet capture, Hook and other methods, and interface-based fast regression testing methods can be mastered to improve efficiency.

Proficient in the skills behind the interface automated testing system and the ideas for handling problems, and achieving a balance between time, manpower, and income is definitely a difficult challenge for a junior or intermediate test developer with little experience.

Finally, I would like to thank everyone who read my article carefully. Looking at the increase in fans and attention, there is always some courtesy. Although it is not a very valuable thing, if you can use it, you can take it directly!

Software Testing Interview Document

We must study to find a high-paying job. The following interview questions are from the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and some Byte bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.
 

Insert image description here

Guess you like

Origin blog.csdn.net/IT_LanTian/article/details/134865580