Application programming interface automated testing method, apparatus, device, and medium

By generating standardized test case sets through dynamic interface synchronization technology and parameterizing them, combined with a test execution engine and visual reports, the inefficiency and accuracy problems of traditional manual testing are solved, and efficient automated testing of application programming interfaces is achieved.

CN122285495APending Publication Date: 2026-06-26DONGFENG MOTOR GRP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DONGFENG MOTOR GRP
Filing Date
2026-03-16
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Traditional manual testing methods are time-consuming and labor-intensive in application programming interface testing, prone to human error and misjudgment, and difficult to guarantee test accuracy and consistency, thus failing to meet the needs of rapid software development and iteration.

Method used

By parsing interface association information through dynamic interface synchronization technology, basic test case templates are generated and processed to form a standardized test case set. Based on the standardized test case set, test data is adapted and parameterized. Automated testing is performed using the test execution engine, and test data is collected to generate a visual test report.

Benefits of technology

It has achieved full automation of the interface testing process, greatly improving testing efficiency, enhancing the standardization and accuracy of testing, and enabling efficient analysis and transmission of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122285495A_ABST
    Figure CN122285495A_ABST
Patent Text Reader

Abstract

This invention discloses an automated testing method, apparatus, device, and medium for application programming interfaces (APIs), relating to the field of software testing technology. The method includes: connecting to an API documentation platform, parsing API association information, and generating basic test case templates; processing the basic test case templates to form a standardized test case set, and generating a parameterized test dataset matching the standardized test case set; loading the parameterized test dataset and the standardized test case set using a test execution engine, executing automated API testing, and collecting various test data generated during the testing process; analyzing and processing the various test data to obtain test analysis results, and generating a visual test report based on the test analysis results and pushing it to a preset channel. This technical solution can automate API testing and improve testing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software testing technology, and in particular to automated testing methods, apparatus, equipment and media for application programming interfaces. Background Technology

[0002] As software systems become increasingly complex and large-scale, application programming interfaces (APIs) have become the core carriers of interaction between software modules and systems, with their number and functional complexity continuously increasing. Traditional manual testing methods require manual parameter input and result verification, which not only consumes significant manpower and time but is also prone to human error and misjudgment, making it difficult to guarantee the accuracy and consistency of testing. This fails to meet the efficient and accurate testing requirements of APIs in rapid software development and iteration.

[0003] Therefore, there is an urgent need for an automated testing method to solve the above problems. Summary of the Invention

[0004] This invention provides an automated testing method, apparatus, device, and medium for application programming interfaces (APIs) to improve the testing efficiency and quality of APIs.

[0005] According to one aspect of the present invention, an automated testing method for application programming interfaces is provided, comprising:

[0006] By using dynamic interface synchronization technology to connect to the interface documentation platform, the interface association information is parsed and basic test case templates are generated.

[0007] The basic test case template is processed to form a standardized test case set, and test data is adapted and parameterized based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set.

[0008] The test execution engine loads the parameterized test dataset and the standardized test case set, executes automated testing of the application programming interface, and collects various test data generated during the testing process.

[0009] The various types of test data are analyzed and processed to obtain test analysis results, and a visual test report is generated based on the test analysis results and pushed to preset channels.

[0010] According to another aspect of the present invention, an automated testing apparatus for application programming interfaces is provided, comprising:

[0011] The test case template generation module is used to connect to the interface documentation platform through dynamic interface synchronization technology, parse the interface association information, and generate basic test case templates.

[0012] The test case data processing module is used to process the basic test case template to form a standardized test case set, and to perform test data adaptation and parameterization processing based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set.

[0013] The test execution and data collection module is used to load the parameterized test dataset and the standardized test case set based on the test execution engine, execute automated testing of the application programming interface, and collect various test data generated during the testing process.

[0014] The analysis report push module is used to analyze and process various types of test data, obtain test analysis results, and generate a visual test report based on the test analysis results to push to preset channels.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] At least one processor;

[0017] and memory that is communicatively connected to at least one processor;

[0018] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor to enable at least one processor to execute the application programming interface automated testing method of any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute an automated testing method for an application programming interface according to any embodiment of the present invention.

[0020] The technical solution of this invention connects to an interface documentation platform using dynamic interface synchronization technology, parses interface association information, and generates basic test case templates. These templates are then processed to form standardized test case sets. Based on these standardized test case sets, test data is adapted and parameterized to generate a parameterized test dataset that matches the standardized test case sets. A test execution engine loads the parameterized test dataset and the standardized test case sets to perform automated testing of the application programming interface (API), collecting various test data generated during the testing process. The test data is analyzed to obtain test analysis results, and a visual test report is generated and pushed to preset channels based on these results. This solution solves the problems of traditional manual testing of APIs being time-consuming, prone to human error and misjudgment, and lacking in accuracy and consistency. It achieves the beneficial effects of automating the entire API testing process, significantly improving testing efficiency, enhancing standardization and accuracy, and enabling efficient analysis and transmission of test results.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating an automated testing method for application programming interfaces (APIs) provided in an embodiment of the present invention;

[0024] Figure 2 A flowchart of another automated testing method for application programming interfaces provided in an embodiment of the present invention;

[0025] Figure 3 A flowchart for analyzing and processing various types of test data provided in this embodiment of the invention;

[0026] Figure 4 A schematic diagram of the structure of an automated testing device for application programming interfaces provided in an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of the structure of an electronic device for implementing an automated testing method for application programming interfaces according to an embodiment of the present invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Figure 1 This is a flowchart illustrating an automated testing method for application programming interfaces (APIs) according to an embodiment of the present invention. This embodiment is applicable to efficient testing of APIs. The method can be executed by an automated API testing device, which can be implemented in hardware and / or software and can be configured in a computer device. Figure 1 As shown, the method specifically includes the following steps:

[0031] S110. Connect to the interface documentation platform through dynamic interface synchronization technology, parse the interface association information, and generate basic test case templates.

[0032] Among them, the application programming interface (API) can be the programming interface through which the software system provides services to the outside world; dynamic interface synchronization technology can realize real-time data interaction with the interface documentation platform and complete the automatic synchronization of interface information; the interface documentation platform is used to store and display relevant documents of the application programming interface; interface association information is various types of information related to the implementation of the application programming interface functions; the basic test case template can have a basic test case framework, but can be further processed and improved on this basis.

[0033] Specifically, by using dynamic interface synchronization technology to establish a connection with the interface documentation platform, the interface association information within the platform is parsed, and basic test case templates are generated based on the parsed information.

[0034] In some possible implementations, the step of connecting to the interface documentation platform through dynamic interface synchronization technology, parsing interface association information, and generating basic test case templates includes: establishing an automatic synchronization connection between the test framework and the interface documentation platform, and obtaining interface documentation information from the interface documentation platform in real time;

[0035] Parse the interface endpoints, parameter constraints, and response model class interface association information from the interface documentation information; automatically generate an editable basic test case template based on the parsed interface association information.

[0036] The testing framework can be the basic technical framework for automated testing of application programming interfaces (APIs); the API documentation information is all the documentation data related to APIs stored in the API documentation platform.

[0037] Interface endpoints can be the access addresses of application programming interfaces (APIs); parameter constraints can be the rules and restrictions imposed by the API on the input parameters; response models can be the structure and data model of the results returned by the API after receiving a request; editable means that the basic test case templates can be modified and improved according to actual testing needs.

[0038] Specifically, an automatic synchronization connection can be established between the testing framework and the API documentation platform. This connection allows for real-time acquisition of API documentation information from the platform, ensuring the timeliness of the information and reducing the workload of manual synchronization. Furthermore, from the real-time acquired API documentation information, the interface endpoints, parameter constraints, and response model class association information can be parsed. Based on this parsed information, editable basic test case templates can be automatically generated, reducing the basic workload of manually writing test cases and improving test case generation efficiency.

[0039] S120. The basic test case template is processed to form a standardized test case set, and the test data is adapted and parameterized based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set.

[0040] In this context, a standardized test case set can be understood as a set of test cases that conform to test execution specifications and can be directly used for automated test execution.

[0041] Test data adaptation and parameterization can refer to filtering or adjusting test data according to the execution requirements of test cases, and implementing parameterized settings. A parameterized test dataset is a set of test data that has been adapted and parameterized to meet the execution requirements of a standardized test case set and can be directly loaded and run.

[0042] Specifically, the basic test case template is standardized and processed to form a set of standardized test cases that can be executed directly. Then, based on this set of standardized test cases, the test data is adapted and parameterized. The test data is configured according to the test case execution requirements, and finally, a parameterized test dataset that matches the set of standardized test cases is generated.

[0043] In some possible implementations, the processing of the basic test case template to form a standardized test case set includes: version management of the basic test case template, implementing branch merging and conflict detection of the basic test case template; semantic analysis of the basic test case template using natural language processing technology, adding preset type tags to the basic test case template based on the analysis results; and filtering and integrating the basic test case templates with added tags to form a standardized test case set.

[0044] Version management can be used to record and control the process of modifying and updating basic test case templates; branch merging refers to merging and unifying the basic test case templates of different development collaboration branches; conflict detection can identify and prompt information contradictions that occur between different branch templates during the merging process.

[0045] Semantic analysis can be understood as parsing the semantics of the text content of basic test case templates to determine their test attributes and scenarios; preset type tags are set in advance according to test requirements and can be used to classify and identify test cases; filtering and integration can be the selection and fusion of basic test case templates with added tags according to actual test scenarios and requirements.

[0046] Specifically, version control can be implemented on basic test case templates, including branch merging and conflict detection to ensure consistency of test cases when multiple teams collaborate. Furthermore, natural language processing (NLP) technology is used to perform semantic analysis on the basic test case templates, adding preset type tags based on the analysis results to achieve intelligent classification of test cases. The tagged templates are then filtered and integrated according to testing requirements to form a standardized test case set, improving the standardization and applicability of test cases.

[0047] In some possible implementations, the process of adapting and parameterizing test data based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set includes: generating multiple types of test data through a dynamic data factory to cover different test scenarios; using an external data source adapter to pull test data from multiple heterogeneous data sources to adapt to the testing requirements of the streaming interface; integrating the generated test data with the pulled test data, configuring it according to the parameter requirements of the standardized test case set, and generating a parameterized test dataset that matches the standardized test case set.

[0048] Among them, the dynamic data factory can be a program module that can automatically generate various types of test data according to test requirements; the multi-type test data can be test data applicable to different test scenarios such as regular testing, boundary testing, and exception testing; the external data source adapter is a program module that can realize data interaction and retrieval between the test framework and various external data sources; the streaming interface can be an application programming interface that uses streaming data as the main form of interaction; and the configuration can be the operation of adjusting, setting, and parameterizing the integrated test data according to the parameter requirements of the standardized test case set.

[0049] Specifically, a dynamic data factory generates multiple types of test data based on testing requirements, covering different testing scenarios and ensuring comprehensive testing. External data source adapters can be used to pull test data from diverse and heterogeneous data sources, adapting to the testing requirements of streaming interfaces and improving the compatibility of testing methods. Then, the generated test data is integrated with the pulled test data, configured according to the parameter requirements of standardized test case sets, and a parameterized test dataset matching the standardized test case sets is generated. This achieves precise adaptation between test data and test cases, ensuring the effectiveness of test execution.

[0050] S130. Load the parameterized test dataset and the standardized test case set based on the test execution engine, execute automated testing of the application programming interface, and collect various test data generated during the testing process.

[0051] The test execution engine is used to load test cases and test data, and drive the automated execution of application programming interfaces (APIs). Various types of test data include all relevant data generated throughout the test execution process, such as test execution results, runtime logs, and performance metrics.

[0052] Specifically, the test execution engine can load the matched parameterized test dataset and standardized test case set, drive the execution of automated test of the application programming interface according to the preset test rules, and collect various test data generated during the test process.

[0053] S140. Analyze and process the various types of test data to obtain test analysis results, and generate a visual test report based on the test analysis results and push it to a preset channel.

[0054] The test analysis results are the results obtained after analyzing, processing, and verifying various types of test data, such as test pass rate, anomalies, and performance indicators. Preset channels can be pre-defined information delivery channels used to push test reports.

[0055] Specifically, the collected test data can be analyzed and processed. Test analysis results can be obtained through data comparison, indicator verification and other operations. Based on the test analysis results, an intuitive and visual test report can be generated and pushed to a pre-set channel so that relevant personnel can keep abreast of the test situation.

[0056] The technical solution of this invention connects to an interface documentation platform using dynamic interface synchronization technology, parses interface association information, and generates basic test case templates. These templates are then processed to form standardized test case sets. Based on these standardized test case sets, test data is adapted and parameterized to generate a parameterized test dataset that matches the standardized test case sets. A test execution engine loads the parameterized test dataset and the standardized test case sets to perform automated testing of the application programming interface (API), collecting various test data generated during the testing process. The test data is analyzed to obtain test analysis results, and a visual test report is generated and pushed to preset channels based on these results. This solution solves the problems of traditional manual testing of APIs being time-consuming, prone to human error and misjudgment, and lacking in accuracy and consistency. It achieves the beneficial effects of automating the entire API testing process, significantly improving testing efficiency, enhancing standardization and accuracy, and enabling efficient analysis and transmission of test results.

[0057] Figure 2 This is a flowchart illustrating another automated testing method for application programming interfaces (APIs) provided by an embodiment of the present invention. Based on the above embodiments, this embodiment further optimizes the process of performing automated testing of APIs and collecting various test data. Specific implementation details can be found in the technical solution of this embodiment. Technical terms that are the same as or corresponding to those in the above embodiments will not be repeated here. Figure 2 As shown, the method specifically includes the following steps:

[0058] S210. Connect to the interface documentation platform through dynamic interface synchronization technology, parse the interface association information, and generate basic test case templates.

[0059] S220. The basic test case template is processed to form a standardized test case set, and the test data is adapted and parameterized based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set.

[0060] S230. Load the parameterized test dataset and the standardized test case set based on the test execution engine, and use distributed thread pool technology to achieve concurrent execution of the standardized test case set.

[0061] Distributed thread pool technology utilizes a distributed architecture to build thread pools, enabling multiple test cases to run simultaneously; concurrent execution allows multiple test cases to run synchronously within the same time period.

[0062] Specifically, the test execution engine can load matching parameterized test datasets and standardized test case sets, call distributed thread pool technology to allocate thread resources, and achieve concurrent execution of test cases, which greatly improves the efficiency of automated test execution.

[0063] S240. In the event of network fluctuations or temporary service unavailability, adjust the request retry strategy through an adaptive retry mechanism and continue to execute application programming interface automated tests.

[0064] Among these, network fluctuations can be abnormal changes in network transmission; temporary service unavailability can be a state where the service corresponding to the application programming interface cannot be provided normally for a short period of time; adaptive retry mechanism can be a mechanism that automatically adjusts the request retry rules according to the actual state of the network and service; and request retry strategy is the rule for re-initiating a request after the application programming interface request fails.

[0065] Specifically, during the execution of automated tests, the network and service status can be monitored in real time. When network fluctuations or temporary service unavailability occur, an adaptive retry mechanism can be triggered. The request retry strategy can be adjusted according to the abnormal situation, the test request can be re-initiated and the test can continue to be executed, thus avoiding test interruption and improving test robustness.

[0066] S250, based on multi-protocol support capabilities, adapts to heterogeneous interface systems, conducts interface testing in at least two dimensions, collects test execution results, link logs, performance index data and fault test data, and forms various types of test data.

[0067] Among them, multi-protocol support capability refers to the test execution engine's ability to adapt to multiple network communication protocols; heterogeneous interface system is an application programming interface system that adopts different technical architectures and communication protocols; link log is log information that records the entire process of test requests from initiation to response; fault test data is test-related data generated when the application programming interface malfunctions.

[0068] Specifically, based on the test execution engine's multi-protocol support capabilities, it completes the adaptation and connection with heterogeneous interface systems, conducts interface testing on application programming interfaces in at least two dimensions, and collects test execution results, link logs, performance index data, and fault test data in real time, integrating them to form various types of test data.

[0069] In some possible implementations, the interface testing is conducted in at least two dimensions, including:

[0070] When conducting functional testing, penetration testing tools are integrated to perform security testing on the application programming interface (API) and verify its input filtering and authentication mechanisms. Chaos engineering technologies are integrated to simulate various fault scenarios and perform disaster recovery testing on the API, verifying its circuit breaker, degradation, and fault tolerance capabilities.

[0071] Among them, penetration testing tools can be tools that simulate network attacks and detect security vulnerabilities in application programming interfaces (APIs); input filtering can be a mechanism for identifying APIs and blocking illegal and abnormal input parameters; and authentication mechanisms are mechanisms for verifying the access permissions of APIs.

[0072] Chaos engineering-related technologies can be techniques for testing a system's fault tolerance and disaster recovery capabilities by simulating fault scenarios; circuit breaking and degradation can be a mechanism by which an application programming interface (API) reduces non-core functional services to ensure core functions during a fault; fault tolerance is the ability of an API to self-recover and operate normally under fault conditions.

[0073] Specifically, when conducting functional testing, penetration testing tools can be integrated to perform security testing, verify the effectiveness of input filtering and authentication mechanisms, and achieve dual testing of functionality and security; chaos engineering-related technologies can be integrated to simulate various fault scenarios to conduct disaster recovery testing, verify circuit breaker degradation and fault tolerance capabilities, and ensure the stability of application programming interfaces in actual use.

[0074] S260. Analyze and process the various types of test data to obtain test analysis results, and generate a visual test report based on the test analysis results and push it to a preset channel.

[0075] In some possible implementations, such as Figure 3 The diagram shown is a flowchart for analyzing and processing various types of test data according to an embodiment of the present invention. This process may include the following steps:

[0076] S261. The intelligent assertion engine performs structured data comparison and non-functional indicator verification on various types of test data to identify and mark abnormal test data.

[0077] S262. Combining log tracing information and exception stack information, perform root cause analysis on the abnormal test data to correlate test failures with code changes or exceptions in dependent services.

[0078] S263. Based on the data comparison results, indicator verification results, and root cause analysis results, compile and form the test analysis results.

[0079] Among them, the intelligent assertion engine is a program module that automatically performs structured comparison, indicator verification, and anomaly identification on test data; structured data comparison is an operation that compares and verifies test data with a fixed structure one by one;

[0080] Non-functional indicator verification can be an operation to verify and judge non-functional attribute indicators that reflect the performance and stability of the application programming interface; log link tracing information is log information that can trace the entire process of test request execution; exception stack information is the stack information of the program call process when an exception occurs in the application programming interface; root cause analysis is an operation to analyze and locate the root cause of test failure and data anomaly.

[0081] Specifically, the intelligent assertion engine performs structured data comparison and non-functional indicator verification on various test data, identifies and marks abnormal test data, and improves data analysis efficiency. Combining log link tracing and exception stack information, the system performs root cause analysis on abnormal test data, correlates test failures with code changes and dependent service exceptions, and accurately locates the cause of failure. Based on the data comparison, indicator verification and root cause analysis results, the system compiles test analysis results to provide accurate basis for problem rectification and test optimization.

[0082] In some embodiments, generating a visual test report based on the test analysis results and pushing it to a preset channel includes: generating a visual test report containing a multi-dimensional data dashboard based on the test analysis results, wherein the multi-dimensional data dashboard can drill down to the execution details of a single test case; performing format adaptation processing on the visual test report; and pushing the adapted visual test report to a preset information channel based on preset push rules.

[0083] Among them, the multidimensional data dashboard is a visual panel that displays test information from multiple dimensions such as test progress, pass rate, and defect distribution; drill-down is the operation of viewing the execution details of a single test case from the overall test summary information; format adaptation processing is the operation of adjusting and optimizing the format of the visual test report according to the display requirements of preset channels; preset push rules are the relevant rules for the time, content, and frequency of test report pushes.

[0084] Specifically, based on the test analysis results, a visual test report containing multi-dimensional data dashboards is generated. The dashboards support drill-down to the execution details of individual test cases, making it easy for relevant personnel to fully understand the test situation. The report is formatted according to the display requirements of preset channels, and then the adapted report is pushed to preset information channels according to preset push rules, improving the efficiency of report delivery and display effect, and accelerating the problem closure speed.

[0085] The technical solution of this invention connects to an interface documentation platform using dynamic interface synchronization technology, parses interface association information, and generates basic test case templates. These templates are then processed to form standardized test case sets. Based on these standardized test case sets, test data is adapted and parameterized to generate a parameterized test dataset that matches the standardized test case sets. A test execution engine loads the parameterized test dataset and the standardized test case sets to perform automated testing of the application programming interface (API), collecting various test data generated during the testing process. The test data is analyzed to obtain test analysis results, and a visual test report is generated and pushed to preset channels based on these results. This solution solves the problems of traditional manual testing of APIs being time-consuming, prone to human error and misjudgment, and lacking in accuracy and consistency. It achieves the beneficial effects of automating the entire API testing process, significantly improving testing efficiency, enhancing standardization and accuracy, and enabling efficient analysis and transmission of test results.

[0086] In one alternative implementation, the automated testing method for application programming interfaces can be implemented using the following technical solutions:

[0087] I. Design of Intelligent and Automated Testing Framework

[0088] 1. Use Case Management Module

[0089] (1) Dynamic interface synchronization technology: Automatically synchronizes with interface documents such as Swagger / OpenAPI (Open Application Programming Interface), and parses API (Application Programming Interface) endpoints, parameter constraints and response models in real time to generate basic test case templates, reducing the cost of manual writing.

[0090] (2) Test case version control: Git-based test case version management, supporting branch merging and conflict detection, ensuring test case consistency when multiple teams collaborate.

[0091] (3) Intelligent classification and tagging: The test cases are semantically analyzed by natural language processing (NLP) and automatically tagged (such as functional domain, priority) to support quick filtering of test cases by scenario.

[0092] 2. Test execution engine

[0093] (1) Multi-protocol support: In addition to RESTful API (Representational State Transfer Application Programming Interface), it extends support to protocols such as GraphQL (Graphical Query Language), gRPC (High-Performance Remote Procedure Call Framework), and WebSocket (Long Connection Network Communication Protocol) to adapt to heterogeneous systems.

[0094] (2) Adaptive retry mechanism: In response to network jitter or temporary service unavailability, the request retry strategy (such as exponential backoff algorithm) is dynamically adjusted to improve test robustness.

[0095] (3) Concurrent execution optimization: Based on distributed thread pool technology, high-concurrency testing (such as thousands of requests per second) is achieved, and resource isolation is used to prevent interference between tests.

[0096] 3. Results Analysis Module

[0097] (1) Intelligent assertion engine:

[0098] ① Structured data comparison: Supports JSON Schema (data format validation rules) verification, XML (Extensible Markup Language) node deep matching, and uses difference algorithms (such as Myers Diff) to locate inconsistent fields.

[0099] ② Non-functional indicator verification: Integrated performance monitoring (response time ≤ 200ms), throughput (TPS, Transactions Per Second) ≥ 1000 and other threshold verification, automatically marking performance bottlenecks.

[0100] (2) Root Cause Analysis (RCA): Combines log chain tracing (such as OpenTelemetry, an observability framework) with exception stacks to automatically associate failed test cases with code changes or dependent service exceptions.

[0101] 4. Visual Reporting System

[0102] (1) Multidimensional data dashboard: Provides real-time test progress, pass rate, defect distribution heat map and other visual charts, and supports drill-down to single test case details.

[0103] (2) Automated report push: Push test summaries via email, Slack (enterprise instant messaging tool) or DingTalk robot, along with root cause analysis suggestions to accelerate problem closure.

[0104] II. In-depth Implementation of Data-Driven Testing

[0105] 1. Dynamic Data Factory:

[0106] (1) Supports the generation of parameterized test data, such as random data (Faker library, fake data generation library), boundary values ​​(maximum value / null value), abnormal data (illegal characters), etc., covering the entire scenario.

[0107] (2) Integrate database snapshot technology to automatically back up and restore data before and after testing, ensuring test isolation.

[0108] 2. External data source adapter:

[0109] In addition to Excel / CSV (comma-separated value files), it supports real-time retrieval of test data from NoSQL (non-relational database) databases (MongoDB, distributed document database) and message queues (Kafka, distributed stream processing platform), adapting to streaming API (application programming interface) testing requirements.

[0110] III. Deep Integration and Intelligent Scheduling of CI / CD

[0111] 1. Event-driven test triggering

[0112] (1) Listen for code repository events (such as Git Push / Merge Request, code push / merge request) and automatically trigger incremental tests (only run API test cases affected by code changes).

[0113] (2) Integrate with Kubernetes (container orchestration system) to dynamically create test clusters on demand and automatically release resources after use, reducing operation and maintenance costs.

[0114] 2. Quality access control mechanism:

[0115] Define thresholds such as pass rate (≥95%) and performance compliance rate. If the thresholds are not met, the pipeline will be automatically blocked to prevent low-quality code from entering the production environment.

[0116] Continuous Integration / Continuous Delivery (CI / CD)

[0117] IV. Security Testing Enhancement Module

[0118] 1. Automated penetration testing:

[0119] (1) Integrate tools such as OWASP ZAP (Open Web Application Security Project vulnerability scanning tool) to simulate SQL (Structured Query Language) injection and CSRF (Cross-Site Request Forgery) attacks and verify API input filtering and authentication mechanisms.

[0120] (2) Automated verification of the generation, refresh, and revocation process of JWT (JSON Web Token) / OAuth2.0 (Open Authorization 2.0 Protocol) tokens to ensure authentication compliance.

[0121] V. Environmental self-healing and disaster recovery testing

[0122] 1. Chaos Engineering Integration:

[0123] (1) Simulate failures such as service outages and network latency to verify the API's circuit breaker and degradation strategies (such as Hystrix, a fault tolerance management library) and fault tolerance capabilities.

[0124] (2) Automatically generate fault injection reports and assess the system robustness level (such as SLA, Service Level Agreement) ≥99.99%.

[0125] The technical solutions of the embodiments of the present invention include at least the following technical effects:

[0126] Efficiency Improvement: Distributed concurrent testing reduces the execution time of thousands of test cases from hours to minutes, improving resource utilization by 80%.

[0127] Precise identification: The root cause analysis module reduces problem finding time by 70% and mean time to repair (MTTR) by 50%.

[0128] Full lifecycle coverage: Seamlessly embedding testing from development to operation and maintenance phases, reducing defect leakage rate by 90%.

[0129] Cost optimization: Environmental self-healing and dynamic resource scheduling reduce hardware investment by 40% and labor costs by 60%.

[0130] Figure 4 This is a schematic diagram of an automated testing device for application programming interfaces (APIs) provided in an embodiment of the present invention. Figure 4 As shown, the device includes:

[0131] The test case template generation module 410 is used to connect to the interface document platform through dynamic interface synchronization technology, parse the interface association information, and generate basic test case templates.

[0132] The test case data processing module 420 is used to process the basic test case template to form a standardized test case set, and to perform test data adaptation and parameterization processing based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set.

[0133] The test execution acquisition module 430 is used to load the parameterized test dataset and the standardized test case set based on the test execution engine, execute automated testing of the application programming interface, and collect various test data generated during the testing process;

[0134] The analysis report push module 440 is used to analyze and process various types of test data, obtain test analysis results, and generate a visual test report based on the test analysis results and push it to a preset channel.

[0135] The technical solution of this invention connects to an interface documentation platform using dynamic interface synchronization technology, parses interface association information, and generates basic test case templates. These templates are then processed to form standardized test case sets. Based on these standardized test case sets, test data is adapted and parameterized to generate a parameterized test dataset that matches the standardized test case sets. A test execution engine loads the parameterized test dataset and the standardized test case sets to perform automated testing of the application programming interface (API), collecting various test data generated during the testing process. The test data is analyzed to obtain test analysis results, and a visual test report is generated and pushed to preset channels based on these results. This solution solves the problems of traditional manual testing of APIs being time-consuming, prone to human error and misjudgment, and lacking in accuracy and consistency. It achieves the beneficial effects of automating the entire API testing process, significantly improving testing efficiency, enhancing standardization and accuracy, and enabling efficient analysis and transmission of test results.

[0136] In some possible implementations, the use case template generation module 310 includes:

[0137] The synchronous connection submodule is used to establish an automatic synchronous connection between the test framework and the interface documentation platform, and to obtain interface documentation information from the interface documentation platform in real time.

[0138] The information parsing submodule is used to parse the interface endpoints, parameter constraints, and response model class interface association information from the interface document information;

[0139] The template generation submodule is used to automatically generate editable basic test case templates based on the parsed interface association information.

[0140] In some possible implementations, the use case data processing module 320 includes a use case processing submodule, which includes:

[0141] The version management unit is used to manage the version of the basic test case template, and to realize branch merging and conflict detection of the basic test case template;

[0142] The semantic analysis unit is used to perform semantic analysis on the basic test case template using natural language processing technology, and add preset type tags to the basic test case template based on the analysis results.

[0143] The filtering and integration unit is used to filter and integrate the basic test case templates with added tags to form a standardized test case set.

[0144] In some possible implementations, the use case data processing module 320 further includes a data parameterization submodule, which includes:

[0145] The data generation unit is used to generate multiple types of test data through a dynamic data factory, covering different test scenarios.

[0146] The data retrieval unit is used to retrieve test data from multiple heterogeneous data sources using an external data source adapter, adapting to the testing requirements of streaming interfaces.

[0147] The data configuration unit is used to integrate the generated test data with the pulled test data, configure it according to the parameter requirements of the standardized test case set, and generate a parameterized test dataset that matches the standardized test case set.

[0148] In some possible implementations, the test execution acquisition module 330 includes:

[0149] The test case execution submodule is used to load the parameterized test dataset and the standardized test case set based on the test execution engine. It uses distributed thread pool technology to achieve concurrent execution of the standardized test case set. In the event of network fluctuations or temporary service unavailability, it adjusts the request retry strategy through an adaptive retry mechanism to continue executing the application programming interface automated test.

[0150] The multi-dimensional testing submodule is used to adapt to heterogeneous interface systems based on multi-protocol support capabilities and conduct interface testing in at least two dimensions.

[0151] The data acquisition submodule is used to collect test execution results, link logs, performance index data, and fault test data to form various types of test data.

[0152] In some possible implementations, the multi-dimensional testing submodule includes:

[0153] The security testing unit is used to integrate penetration testing tools during functional testing, perform security testing on the application programming interface, and verify the input filtering and authentication mechanisms of the application programming interface.

[0154] The disaster recovery testing unit is used to integrate chaos engineering-related technologies, simulate various fault scenarios to perform disaster recovery tests on the application programming interface, and verify the circuit breaking, degradation and fault tolerance capabilities of the application programming interface.

[0155] In some possible implementations, the analysis report push module 340 includes a result analysis submodule, which includes:

[0156] The data verification unit is used to perform structured data comparison and non-functional indicator verification on various types of test data through an intelligent assertion engine, and to identify and mark abnormal test data.

[0157] The root cause analysis unit is used to combine log tracing information and exception stack information to perform root cause analysis on the abnormal test data and correlate test failures with code changes or dependent service exceptions.

[0158] The results processing unit is used to compile test analysis results based on data comparison results, indicator verification results, and root cause analysis results.

[0159] In some possible implementations, the analysis report push module 340 further includes a report push submodule, which includes:

[0160] The report generation unit is used to generate a visual test report containing a multi-dimensional data dashboard based on the test analysis results. The multi-dimensional data dashboard can be drilled down to the execution details of a single test case.

[0161] The channel push unit is used to perform format adaptation processing on the visualization test report and push the adapted visualization test report to a preset information channel based on preset push rules.

[0162] The application programming interface (API) automated testing device provided in this embodiment of the invention can execute the API automated testing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0163] Figure 5This is a schematic diagram of an electronic device for implementing the automated testing method for application programming interfaces (APIs) according to embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0164] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0165] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0166] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as application programming interface automated testing methods.

[0167] In some embodiments, the application programming interface (API) automated testing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the API automated testing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the API automated testing method by any other suitable means (e.g., by means of firmware).

[0168] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0169] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0170] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0171] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0172] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0173] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0174] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0175] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An automated testing method for application programming interfaces, characterized in that, include: By using dynamic interface synchronization technology to connect to the interface documentation platform, the interface association information is parsed and basic test case templates are generated. The basic test case template is processed to form a standardized test case set, and test data is adapted and parameterized based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set. The test execution engine loads the parameterized test dataset and the standardized test case set, executes automated testing of the application programming interface, and collects various test data generated during the testing process. The various types of test data are analyzed and processed to obtain test analysis results, and a visual test report is generated based on the test analysis results and pushed to preset channels.

2. The method according to claim 1, characterized in that, The process of connecting to the interface documentation platform via dynamic interface synchronization technology, parsing interface association information, and generating basic test case templates includes: Establish an automatic synchronization connection between the testing framework and the interface documentation platform to obtain interface documentation information from the interface documentation platform in real time; Parse the interface endpoints, parameter constraints, and response model class interface association information from the interface documentation information; Based on the parsed interface association information, an editable basic test case template is automatically generated.

3. The method according to claim 1, characterized in that, The process of processing the basic test case template to form a standardized test case set includes: Version management is performed on the basic test case template to achieve branch merging and conflict detection of the basic test case template; The basic test case template is semantically analyzed using natural language processing technology, and preset type tags are added to the basic test case template based on the analysis results. The basic test case templates with added tags are filtered and integrated to form a standardized test case set.

4. The method according to claim 1, characterized in that, The process of adapting and parameterizing test data based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set includes: Multiple types of test data are generated through a dynamic data factory to cover different test scenarios; Use external data source adapters to pull test data from multiple heterogeneous data sources to adapt to the testing requirements of streaming interfaces; The generated test data is integrated with the pulled test data and configured according to the parameter requirements of the standardized test case set to generate a parameterized test dataset that matches the standardized test case set.

5. The method according to claim 1, characterized in that, The test execution engine loads the parameterized test dataset and the standardized test case set, executes automated testing of the application programming interface, and collects various types of test data generated during the testing process, including: The parameterized test dataset and the standardized test case set are loaded based on the test execution engine, and the concurrent execution of the standardized test case set is achieved using distributed thread pool technology. In the event of network fluctuations or temporary service unavailability, the request retry strategy is adjusted through an adaptive retry mechanism to continue executing application programming interface automated tests. Based on the ability to support multiple protocols, adapt to heterogeneous interface systems, conduct interface testing in at least two dimensions, collect test execution results, link logs, performance index data and fault test data, and form various types of test data.

6. The method according to claim 5, characterized in that, The interface testing to be conducted in at least two dimensions includes: When conducting functional testing, penetration testing tools are integrated to perform security testing on the application programming interface (API) and verify the input filtering and authentication mechanisms of the API. By integrating chaos engineering technologies, various fault scenarios are simulated to conduct disaster recovery tests on the application programming interface, verifying the circuit breaking, degradation, and fault tolerance capabilities of the application programming interface.

7. The method according to claim 1, characterized in that, The analysis and processing of the various types of test data to obtain test analysis results includes: The intelligent assertion engine performs structured data comparison and non-functional indicator verification on various types of test data to identify and mark abnormal test data. By combining log tracing information and exception stack information, root cause analysis is performed on the abnormal test data to correlate test failures with code changes or exceptions in dependent services. Based on the data comparison results, indicator verification results, and root cause analysis results, test analysis results are compiled.

8. An automated testing device for application programming interfaces, characterized in that, include: The test case template generation module is used to connect to the interface documentation platform through dynamic interface synchronization technology, parse the interface association information, and generate basic test case templates. The test case data processing module is used to process the basic test case template to form a standardized test case set, and to perform test data adaptation and parameterization processing based on the standardized test case set to generate a parameterized test dataset that matches the standardized test case set. The test execution and data collection module is used to load the parameterized test dataset and the standardized test case set based on the test execution engine, execute automated testing of the application programming interface, and collect various test data generated during the testing process. The analysis report push module is used to analyze and process various types of test data, obtain test analysis results, and generate a visual test report based on the test analysis results to push to preset channels.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the application programming interface automated testing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the application programming interface automated testing method according to any one of claims 1-7.