Interface testing method and device, computer equipment and readable storage medium

By performing structured parsing and automated processing of the code, interface documentation and test cases are generated, solving the problem of time-consuming and labor-intensive traditional interface testing and realizing an efficient and automated interface testing process.

CN121722666APending Publication Date: 2026-03-24KINGDEE CREDIT INFORMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Traditional interface testing relies on manually writing test scripts, which is time-consuming and labor-intensive. When the system version iterates rapidly, test cases need to be updated frequently, increasing manual costs.

Method used

By performing structured parsing of the code, target interface documentation is generated, interface parameter information is parsed, test cases are generated according to preset strategies, tests are executed automatically, and test reports are generated.

Benefits of technology

It has achieved full automation of the interface testing process, reducing labor costs and improving testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121722666A_ABST
    Figure CN121722666A_ABST
Patent Text Reader

Abstract

The invention relates to an interface testing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: performing structured analysis on a code to obtain a code analysis result; generating a target interface document based on the code analysis result and interface specification knowledge; analyzing the target interface document to obtain interface parameter information of an interface in the target interface document; processing the interface parameter information according to a preset strategy condition to obtain a parameter strategy result corresponding to the interface parameter information; generating a target test case according to the interface parameter information and the parameter strategy result; and testing an interface in the target interface document based on the target test case to obtain a target interface test report. By adopting the method, the labor cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated testing technology, and in particular to an interface testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology

[0002] With the widespread adoption of microservice architecture and front-end / back-end separation, Application Programming Interfaces (APIs) have become the core link for interaction between components in modern software systems. The popularity of standardized interface description languages ​​such as Swagger / OpenAPI has significantly improved the standardization of interface documentation. At the same time, automated interface testing, as a crucial step in ensuring software quality, is becoming increasingly important.

[0003] In traditional technologies, most interface testing still relies on manually writing test scripts. Manually writing test cases is time-consuming and labor-intensive. Rapid iteration of system versions is often accompanied by changes in interfaces, requiring testers to frequently update test cases. This process is not only time-consuming but also increases labor costs. Summary of the Invention

[0004] Therefore, it is necessary to provide an interface testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce labor costs in response to the above-mentioned technical problems.

[0005] Firstly, this application provides an interface testing method, including:

[0006] The code is structured and parsed to obtain the code parsing results;

[0007] Based on the code parsing results and interface specification knowledge, generate the target interface documentation;

[0008] The target interface document is parsed to obtain the interface parameter information of the interface in the target interface document;

[0009] The interface parameter information is processed according to preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information;

[0010] Based on the interface parameter information and the parameter strategy results, generate target test cases;

[0011] Based on the target test cases, the interfaces in the target interface document are tested to obtain a target interface test report.

[0012] Secondly, this application also provides an interface testing apparatus, comprising:

[0013] The code parsing module is used to perform structured parsing of code and obtain the code parsing results;

[0014] The document generation module is used to generate target interface documentation based on the code parsing results and interface specification knowledge.

[0015] The document parsing module is used to parse the target interface document to obtain the interface parameter information of the interface in the target interface document;

[0016] The parameter processing module is used to process the interface parameter information according to preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information;

[0017] The test case generation module is used to generate target test cases based on the interface parameter information and the parameter strategy results;

[0018] The interface testing module is used to test the interfaces in the target interface document based on the target test cases and obtain the target interface test report.

[0019] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the interface testing method provided in the first aspect.

[0020] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the interface testing method provided in the first aspect.

[0021] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the interface testing method provided in the first aspect.

[0022] The aforementioned interface testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product perform structured parsing of code to obtain code parsing results. Based on the code parsing results and interface specification knowledge, a target interface document is generated. The target interface document is parsed to obtain the interface parameter information of the interface in the target interface document. The interface parameter information is processed according to preset strategy conditions to obtain the parameter strategy results corresponding to the interface parameter information. Based on the interface parameter information and parameter strategy results, target test cases are generated. The interfaces in the target interface document are tested based on the target test cases to obtain a target interface test report. This enables the automatic generation of interface documents based on code, the generation of test cases based on interface documents, and the automated testing of interfaces based on test cases to generate interface test reports. In other words, it enables the fully automated execution of the entire process from code to interface document to test cases to test execution to test report, improving the automation level of interface testing and thus reducing the manual costs in the interface testing process. Attached Figure Description

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

[0024] Figure 1 This is a diagram illustrating the application environment of an interface testing method in one embodiment.

[0025] Figure 2 This is a flowchart illustrating an interface testing method in one embodiment;

[0026] Figure 3 This is a flowchart illustrating the process of generating abnormal results for interface parameters in one embodiment.

[0027] Figure 4 This is an architecture diagram of an interface testing system that implements the interface testing method in one embodiment.

[0028] Figure 5 This is an architecture diagram of an interface testing system that implements the interface testing method in another embodiment;

[0029] Figure 6 This is a structural block diagram of an interface testing device in one embodiment;

[0030] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0032] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0033] The interface testing method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 can send the generated code to server 104. Server 104 performs structured parsing on the code to obtain the code parsing result. Based on the code parsing result and interface specification knowledge, server 104 generates a target interface document, parses the target interface document to obtain the interface parameter information of the interface in the target interface document, processes the interface parameter information according to preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information, generates target test cases based on the interface parameter information and the parameter strategy result, and tests the interface in the target interface document based on the target test cases to obtain a target interface test report. The server can return the generated target interface test report to terminal 102.

[0034] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. It is readily understood that the interface testing method provided in this application embodiment is not only applicable to the above-mentioned application scenarios involving server-terminal interaction, but also to application scenarios involving single servers, single terminals, server-to-server interaction, or terminal-to-terminal interaction.

[0035] In one exemplary embodiment, such as Figure 2 As shown, an interface testing method is provided, which can be applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 202 to 212. Wherein:

[0036] Step 202: Perform structured parsing on the code to obtain the code parsing results.

[0037] The code can be any project source code written by developers. The code written by developers can be captured in real time, and then structured parsing is performed to obtain the code parsing results. Structured parsing refers to the process of converting an unstructured series of characters into a hierarchical tree structure. For example, code can be structured to obtain the corresponding Abstract Syntax Tree (AST). The AST is an abstract representation of the code's syntactic structure, displaying the program's syntactic structure in a tree structure, with each node representing a structure. In other words, the code parsing result can include the corresponding AST. From the AST, technical structure information of the interface can be parsed and extracted, such as the interface's parameter types, return value formats, and interface paths.

[0038] For example, the code used for structured parsing can be a portion of the code from the software project's development process, or it can be the entire code corresponding to the software project. In other words, there is no limit to the amount of code; it can be selected according to actual needs.

[0039] Step 204: Based on the code parsing results and interface specification knowledge, generate the target interface documentation.

[0040] Interface specification knowledge refers to the general knowledge that interfaces are defined for within their respective industries. Different industries may have different interface specification knowledge. Interface specification knowledge can be obtained through pre-setting or industry knowledge collection. For example, interface specification knowledge may include "mobile phone number parameters are 11 digits," "resident ID card numbers are 15 digits," and "financial interfaces require non-negative amount verification," etc. The code parsing results may include the technical structure information of the interface. Based on the code parsing results and interface specification knowledge, the server can generate the target interface document corresponding to the code.

[0041] For example, an artificial intelligence (AI) model can generate target interface documentation based on code parsing results and interface specification knowledge. For instance, based on the code parsing results and interface specification knowledge, prompts can be generated to instruct the AI ​​model to generate the interface documentation. Inputting these prompts into the AI ​​model will then yield the target interface documentation.

[0042] In one example, the code parsing results can be converted from code form to natural language form, facilitating the AI ​​model's understanding of the semantics of the technical structure information of the interfaces included in the code parsing results. Then, using the natural language form of the code parsing results and the interface specification knowledge, the AI ​​model generates the initial interface documentation.

[0043] In one example, an initial interface document can be generated based on code parsing results and interface specification knowledge. Then, based on the interface parameter characteristics in the initial interface document, parameter constraints can be generated. Finally, the initial interface document can be supplemented according to these constraints to obtain the target interface document. Here, parameter constraints refer to the conditions that impose feature constraints on the interface parameters. For example, when the parameter is "payment," the corresponding parameter constraint would be "must be greater than zero," etc.

[0044] Step 206: Parse the target interface document to obtain the interface parameter information of the interface in the target interface document.

[0045] Interface parameter information may include parameter type information, constraint information, or interface dependency information. Parameter type information may include required / optional parameters, data type, and enumerated values. Constraint information may include logical dependencies between parameters and boundary ranges. Interface dependency refers to the information dependency relationship between different interfaces, such as the output of interface A serving as the input of interface B.

[0046] For example, an artificial intelligence model can be used to parse the target interface document to obtain the interface parameter information of the interface in the target interface document. The artificial intelligence model can be a large artificial intelligence model in traditional technology, or it can be a trained interface document parsing model.

[0047] Step 208: Process the interface parameter information according to the preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information.

[0048] The preset strategy conditions refer to the pre-defined interface parameter information processing strategies. These preset strategy conditions may include at least one of the following: orthogonal testing strategy, boundary derivation strategy, anomaly mode strategy, or other custom strategies. An orthogonal testing strategy reduces the number of parameter combinations through orthogonal experimental design. A boundary derivation strategy automatically derives boundary values ​​based on parameter types. An anomaly mode test generates anomaly scenarios based on preset conditions in the interface parameter information. The parameter strategy result refers to the result of processing the interface parameter information based on the preset strategy conditions.

[0049] For example, if the interface parameter information is processed according to an orthogonal testing strategy, orthogonal test results for the interface parameter information can be obtained; if the interface parameter information is processed according to a boundary derivation strategy, boundary values ​​of the corresponding interface parameter value range can be obtained. It should be noted that the boundary values ​​of the interface parameter value range obtained based on the boundary value derivation strategy are abnormal values. If the interface parameter information is processed according to an abnormal mode strategy, abnormal results for the corresponding interface parameters can be obtained.

[0050] Step 210: Generate target test cases based on interface parameter information and parameter strategy results.

[0051] After obtaining the interface parameter information and parameter policy results, the server can generate target test cases based on these information and results. It's easy to understand that the interface parameter information or parameter policy results may differ for different interfaces in the target interface documentation, and therefore the generated target test cases may also differ. In other words, different interfaces may correspond to different types of target test cases. The types of target test cases can include, for example, normal flow test cases, abnormal flow test cases, or dependency chain test cases. Normal flow test cases refer to test cases implemented according to the standard execution path of the interface. Abnormal flow test cases refer to test cases that return corresponding abnormal values ​​based on abnormal parameters. Dependency chain test cases refer to cascading test cases generated based on interface dependencies.

[0052] For example, assuming the parameter strategy result includes orthogonal test results and boundary values ​​of the range of interface parameter values, then abnormal flow test cases can be generated based on the interface parameter information, orthogonal test results, and boundary values ​​of the range of interface parameter values. Normal flow test cases can also be generated based on the interface parameter information and orthogonal test results. Alternatively, abnormal flow test cases can be generated based on the interface parameter information and boundary values ​​of the range of interface parameter values, etc.

[0053] In one example, an artificial intelligence model can be used to generate target test cases based on interface parameter information and parameter strategy results.

[0054] Step 212: Test the interfaces in the target interface document based on the target test cases to obtain the target interface test report.

[0055] After generating target interface test cases for each interface in the target interface document, the interfaces can be automatically tested in sequence according to the preset interface order based on the corresponding target test cases, and the target interface test reports for each interface in the target interface document can be obtained.

[0056] For example, the interface call information in the production environment can be obtained, the test priority of each interface in the target interface document can be determined based on the interface call information in the production environment, and the interfaces in the target interface document can be tested according to the test priority to obtain the target interface test report.

[0057] For example, the interfaces in the target interface document can be tested sequentially according to the order in which they are called, and a target interface test report can be obtained.

[0058] For example, based on the interface test logs recorded during the interface test, the interface information that was reported during the test can be analyzed, the error mode to which the error interface belongs can be determined, the root cause analysis and optimization suggestions can be made for the error mode, and an interface optimization report can be generated.

[0059] The aforementioned interface testing method performs structured parsing of the code to obtain code parsing results. Based on the code parsing results and interface specification knowledge, it generates target interface documentation. The target interface documentation is then parsed to obtain interface parameter information. This parameter information is processed according to preset strategy conditions to obtain parameter strategy results corresponding to the interface parameter information. Based on the interface parameter information and parameter strategy results, target test cases are generated. These test cases are then used to test the interfaces in the target interface documentation, generating a target interface test report. This method enables automatic generation of interface documentation from code, test cases from interface documentation, and automated testing of interfaces based on test cases to generate interface test reports. In other words, it achieves fully automated execution of the entire process from code to interface documentation to test cases to test execution and test reports, improving the automation level of interface testing and thus reducing manual costs in the interface testing process.

[0060] In some embodiments, step 204, based on code parsing results and interface specification knowledge, generates a target interface document, including:

[0061] The code parsing results are converted from code form to natural language form; based on the code parsing results in natural language form and interface specification knowledge, an initial interface document is generated through an artificial intelligence model; based on the parameter characteristics in the initial interface document, parameter constraints of the initial interface document are generated; based on the parameter constraints and the initial interface document, the target interface document is generated.

[0062] Natural language code parsing results enable humans or AI models to more easily understand the corresponding semantics. Natural Language Processing (NLP) can be applied to these code parsing results to obtain natural language code parsing results. For example, semantic information about parameter names or comments included in the code parsing results can be extracted and converted into corresponding text, such as converting "user_name" into "username". Parameter constraints refer to the conditions that impose feature constraints on interface parameters.

[0063] In one example, the server performs natural language processing on the code parsing results to obtain the code parsing results in natural language form. This natural language code parsing result, along with the interface specification knowledge, is input into an artificial intelligence model to obtain the initial interface document. Based on the parameter characteristics of the initial interface document, parameter constraints are generated. By adding the corresponding interface parameter constraints to the initial interface document, the target interface document is obtained.

[0064] In one example, the server converts the code parsing results from code form to natural language form. Based on the code parsing results in natural language form and the interface specification knowledge, an initial interface document is generated through an artificial intelligence model. According to the parameter features in the initial interface document, the parameter constraints of the initial interface document (equivalent to parameter constraint completion suggestions) can be generated through a Large Language Model (LLM). The initial interface document and the parameter constraints are fused to obtain the target interface document.

[0065] In this embodiment, by converting the code parsing results from code form to natural language form, and based on the natural language code parsing results and interface specification knowledge, an initial interface document is generated through an artificial intelligence model. According to the parameter features in the initial interface document, parameter constraints of the initial interface document are generated. Based on the parameter constraints and the initial interface document, a target interface document is generated. This enables semantic recognition and natural language conversion of the code parsing results, generates an initial interface document by combining interface specification knowledge, and completes and optimizes the initial interface document by generating parameter constraints corresponding to the interface parameters. This achieves the effect of automatically generating high-quality interface documents without human intervention.

[0066] In some embodiments, step 208 involves processing the interface parameter information according to preset policy conditions to obtain a parameter policy result corresponding to the interface parameter information, including:

[0067] If an interface contains a first interface with multiple interface parameters, each of which has multiple possible values, the interface parameter information of the first interface is processed based on an orthogonal testing strategy to obtain the orthogonal test results corresponding to the interface parameter information of the first interface; and / or, if an interface contains a second interface with a specific range of parameter values, the boundary value derivation of the range of interface parameter values ​​of the second interface is performed based on a boundary derivation strategy to obtain the boundary values ​​of the range of interface parameter values ​​of the second interface; and / or, if an interface contains a third interface with parameter constraints, an abnormal result of the interface parameter of the third interface is generated based on an abnormal mode strategy.

[0068] The first interface refers to an interface that includes multiple interface parameters, each with multiple possible values. For example, an interface might include browser type, operating system, and network environment. Browser type values ​​could be Chrome, Firefox, or Edge; operating system values ​​could be Windows or macOS; and network environment values ​​could be high-speed, medium-speed, or slow. The second interface refers to an interface with a specific range of parameter values. For example, an interface with a value range of [0,1], meaning it can only take values ​​within the range [0,1], would be considered a second interface. The third interface refers to an interface that includes parameter constraints. The first, second, and third interfaces may belong to the same interface. In other words, the same interface can be processed using one or more of the following strategies: orthogonal testing, boundary deduction, and anomaly pattern analysis, to obtain the corresponding parameter strategy results.

[0069] In practical applications, as long as the target interface document contains an interface that meets the conditions for executing the preset strategy, the interface parameter information of the corresponding interface can be processed according to the preset strategy conditions to obtain the corresponding parameter strategy result. The parameter strategy result is used to generate test cases. The server can first identify whether there is an interface in the target interface document that meets the conditions for executing the preset strategy. If so, it processes the corresponding interface according to the preset strategy conditions to obtain the corresponding parameter strategy result.

[0070] In one example, the server can sequentially identify whether a first interface, a second interface, and a third interface exist based on the interface parameter information. The server checks if a first interface exists in the target interface document. If a first interface exists, it processes the interface parameter information of the first interface based on an orthogonal testing strategy to obtain the orthogonal test result corresponding to the first interface. The server also checks if a second interface exists. If a second interface exists, it derives boundary values ​​for the range of interface parameter values ​​for the second interface based on a boundary derivation strategy to obtain the boundary values ​​of the range of interface parameter values ​​for the second interface. Finally, the server checks if a third interface exists. If a third interface exists, it generates abnormal interface parameter results for the third interface based on an abnormal mode strategy.

[0071] For example, let's take testing the shopping cart function of an e-commerce platform as an example to illustrate the processing of the orthogonal testing strategy. The interface parameters include browser type, operating system, and network environment. The browser type can be Chrome, Firefox, or Edge; the operating system can be Windows or macOS; and the network environment can be high-speed, medium-speed, or slow. The usual number of combinations is 3*3*2=18, but after combining them using the orthogonal testing strategy, it can be reduced to 6 combinations. The combination results of the orthogonal testing strategy are shown in Table 1 below.

[0072] Table 1

[0073]

[0074] In one example, when the server recognizes that the interface includes a second interface, it can determine the appropriate boundary inference strategy based on the data type of the parameters in the second interface. Parameter data types can include, for example, numeric, date, or string types. Figure 3 As shown, the server can identify the data type of each interface parameter of the second interface. If the data type of the interface parameter is numeric, it obtains the maximum / minimum value of the interface parameter, which is the constraint boundary value of the actual value range (the actual value range does not include the constraint boundary value). The boundary value of the interface parameter's value range is determined based on the minimum and maximum values. For example, the boundary value can be the minimum value, minimum value - 1, maximum value, and maximum value + 1, or it can be the minimum value - 2, maximum value + 2, etc. In other words, the boundary value of the interface parameter's value range does not belong to the standard value range of the corresponding interface parameter. Similarly, if the data type of the interface parameter is date, the boundary value of the interface parameter's value range is determined based on the minimum and maximum dates. For example, the boundary value can be the minimum date - 1 (day), minimum date, maximum date, and maximum date + 1 (day). If the data type of the interface parameter is string, the boundary value of the interface parameter's value range is determined based on the minimum string length and maximum string length. For example, the boundary value can be the minimum string length - 1, minimum string length, maximum string length, and maximum string length + 1, etc.

[0075] For example, if the server recognizes that the interface includes a third interface, and the parameter constraints corresponding to the third interface are, for example, that a required parameter is empty, the parameter type is incorrect, or the dependent interface parameter returns empty, then the interface parameter exception results generated based on the exception mode strategy can correspond to, for example, that the required parameter is not empty, the parameter type is correct, and the dependent parameter returns not empty. In other words, the interface parameter exception results are generated based on the exception mode strategy, resulting in a result that contradicts the parameter constraints.

[0076] In this embodiment, if there is a first interface with multiple interface parameters, each of which has multiple possible values, the interface parameter information of the first interface is processed based on an orthogonal testing strategy to obtain the orthogonal test result corresponding to the interface parameter information of the first interface. And / or if there is a second interface with a specific range of parameter values, the boundary value derivation of the range of interface parameter values ​​of the second interface is performed based on a boundary derivation strategy to obtain the boundary value of the range of interface parameter values ​​of the second interface. And / or if there is a third interface with parameter constraints, the abnormal result of the interface parameter of the third interface is generated based on an abnormal mode strategy. This enables the generation of various types of parameter strategy results based on preset strategy conditions, laying a solid foundation for the subsequent generation of a rich variety of test cases and accurate interface testing.

[0077] In some embodiments, step 210, which generates target test cases based on interface parameter information and parameter strategy results, includes:

[0078] Based on at least one of the following: orthogonal test results, boundary values ​​of the range of interface parameters, or abnormal results of interface parameters, and interface parameter information, generate at least one of the following: normal flow test cases, abnormal flow test cases, or dependency chain test cases.

[0079] In one example, the server can generate abnormal flow test cases based on orthogonal test results, boundary values ​​of the interface parameter range, and interface parameter information. Alternatively, the server can generate normal flow test cases based on orthogonal test results and interface parameter information. Or, the server can generate dependency chain test cases based on abnormal interface parameter results and interface parameter information. Alternatively, the server can generate dependency chain test cases based on orthogonal test results, abnormal interface parameter results, and interface parameter information.

[0080] In one example, if the interface parameters of the same interface include orthogonal test results, boundary values ​​of the interface parameter's value range, and interface exception results, then normal flow test cases, exception flow test cases, and dependency chain test cases for that interface can be generated. Alternatively, if the interface parameters of the same interface include orthogonal test results and boundary values ​​of the interface parameter's value range, then normal flow test cases and exception flow test cases for that interface can be generated. Alternatively, if the interface parameters of the same interface include orthogonal test results and interface exception results, then normal flow test cases and dependency chain test cases for that interface can be generated. Alternatively, if the interface parameters of the same interface include orthogonal test results, boundary values ​​of the interface parameter's value range, or interface exception results, then normal flow test cases, exception flow test cases, or dependency chain test cases for that interface can be generated.

[0081] In this embodiment, by generating at least one of the following based on orthogonal test results, boundary values ​​of the range of interface parameters, or abnormal results of interface parameters, as well as interface parameter information, at least one of normal flow test cases, abnormal flow test cases, or dependency chain test cases can be generated. This can generate test cases corresponding to different interface parameter scenarios, that is, generating corresponding test cases based on the characteristics of interface parameters, which can improve the correlation between test cases and interface parameter information and improve the accuracy of the generated test cases.

[0082] In some embodiments, the interfaces in the target interface document are tested based on the target test cases to obtain a target interface test report, including:

[0083] Based on the API call behavior in the production environment, determine the test priority of the APIs in the target API documentation; according to the test priority, test the APIs in the target API documentation sequentially based on the target test cases, and obtain the target API test report.

[0084] The production environment refers to the environment in which the software provides services to the outside world; it is the software environment that users directly use and access. Interface call activity can be characterized, for example, by the number of interface calls within a preset time period. For instance, the more interface calls within a preset time period, the higher the test priority of that interface. The preset time period can be set according to the actual application scenario, such as one day, five days, ten days, or one month. The target interface test report can include, for example, the test results obtained by testing each interface according to the corresponding target test cases, as well as execution time data. For instance, the test results can include test success and test failure; if the test result is a test failure, the target interface test report can also include the failure details corresponding to the test failure.

[0085] For example, the server can periodically monitor the call activity of each interface in the production environment. Based on the call activity of each interface, it determines the test priority of each interface in the target interface documentation. Then, in descending order of test priority, it sequentially calls the target test cases corresponding to each interface in the target interface documentation to test the respective interfaces, generating a target interface test report. Call activity can be represented by, for example, the number of calls per day, per ten days, or per month. The more calls within the same time period, the higher the call activity, and the higher the test priority. For example, if interface A is called an average of 100,000 times per day and interface B is called an average of 100 times per day, then the test priority of interface A is higher than that of interface B.

[0086] In one example, based on the API call behavior in the production environment, the test priority of the APIs in the target API documentation is determined. APIs with test priorities higher than the preset priority are tested in descending order of test priority. APIs with test priorities no higher than the preset priority are sampled according to the preset sampling rate to obtain sampled APIs. The sampled APIs are then tested in order of test priority to obtain the target API test report.

[0087] In practical application scenarios, target test cases are used to provide the test process and standard results of the corresponding interface. The interface in the target interface document is tested according to the test process in the corresponding target test case to obtain the execution result. Based on the standard result, it is determined whether the execution result is accurate. If the execution result is accurate, a test success result is obtained; if the execution result is inaccurate, a test failure result is obtained.

[0088] In this embodiment, the test priority of the interfaces in the target interface document is determined based on the interface call situation in the production environment. According to the test priority, the interfaces in the target interface document are tested sequentially based on the target test cases to obtain the target interface test report. This can realize the automatic setting of interface test priorities and the testing of interfaces according to the test priorities, thereby improving the utilization of test resources.

[0089] In some embodiments, the above method further includes:

[0090] Obtain the interface test logs recorded during the interface testing process; analyze the interface information corresponding to the error locations in the interface test logs, determine the error mode to which the interface information belongs, and perform root cause analysis on the error mode to obtain the root cause analysis results; determine optimization suggestions based on the root cause analysis results, and generate an interface optimization report based on the root cause analysis results and optimization suggestions.

[0091] During the testing of the interface, interface test logs can be recorded in real time. The interface test logs usually record the location of the test error. By analyzing the interface information corresponding to the error location, the error mode of the interface information can be obtained.

[0092] In one example, an artificial intelligence model can be used to analyze the interface information corresponding to the error location in the interface test log, obtain the error analysis results, match the error analysis results with preset error patterns to determine the error pattern to which the interface information belongs, perform root cause analysis on the error pattern to obtain the root cause analysis results, determine corresponding optimization suggestions based on the root cause analysis results and optimization suggestions, and generate an interface optimization report based on the root cause analysis results and optimization suggestions. The interface optimization report includes the root cause analysis results and the corresponding interface optimization suggestions.

[0093] In one example, the server retrieves interface test logs recorded during the testing process of an interface, performs structured parsing on these logs, and obtains the log parsing results. For example, `[ERROR]Parameter 'id' is missing` is transformed into `{type: 'error', field: 'id', message: 'missing'}`. For example, regular expressions or tools like Logstash can be used to convert unstructured interface test logs into structured log parsing results. Based on the log parsing results, the interface information corresponding to the error location (e.g., code snippets before and after the error location) is extracted, and the system is checked for performance bottlenecks in the code configuration file reading and analysis system, for configuration anomalies causing failures, and for adherence to industry best practices. A test environment snapshot is captured, including information such as environment variables, dependent service status, and database storage data. Based on the interface information corresponding to the error location, the reading and analysis system information, and the test environment snapshot, the error mode to which the interface information belongs is determined. For example, the interface information corresponding to the error location, the reading and analysis system information, and the test environment snapshot are matched with data corresponding to similar historical errors to determine the error mode to which the interface information belongs. Root cause analysis is performed based on error patterns, such as identifying which interface the problem occurred on and which parameters caused it. For example, "Interface B returned a 500 error, and the root cause analysis result is that interface A did not return correct data." Optimization suggestions are then determined based on the root cause analysis results. For example, an optimization suggestion might be "Add a null value check to the get_user method of interface A." Alternatively, if the root cause analysis result is "a system problem caused by configuration," the corresponding optimization suggestions could be "Adjust connection pool parameters to improve concurrency" or "Unify environment configuration to reduce deployment risks." Finally, an interface optimization report is generated based on the root cause analysis results and optimization suggestions.

[0094] In this embodiment, by analyzing the interface information corresponding to the error location in the interface test log, the error mode to which the interface information belongs is determined, and root cause analysis is performed on the error mode to obtain the root cause analysis results. Based on the root cause analysis results, optimization suggestions are determined, and an interface optimization report is generated based on the root cause analysis results and optimization suggestions. This enables intelligent analysis of errors that occur during interface testing, outputs repair and optimization suggestions, and automatically generates an interface optimization report. It realizes a fully intelligent process from interface document generation, interface testing, and interface optimization, further improving the automation level of interface testing.

[0095] In some embodiments, after generating the target interface document based on the code parsing results and interface specification knowledge, the above method further includes:

[0096] Monitor the code repository to obtain newly added code; perform structured parsing on the newly added code to obtain the parsing results; update the corresponding interface parameters in the target interface document based on the parsing results to obtain the updated target interface document;

[0097] The target API document is parsed to obtain the API parameter information, including:

[0098] The updated target interface document is parsed to obtain the interface parameter information of the interface in the updated target interface document.

[0099] In this context, a code repository refers to a repository where code is stored. New code refers to code in the code repository that has undergone changes. The code repository can be monitored in real time. If a code update is detected, the new code is retrieved, and a structured parsing process is performed on it to obtain the corresponding parsing results. Based on these results, the corresponding interface parameters in the target interface document are updated, resulting in the updated target interface document.

[0100] In one example, the server can integrate Git Hooks, webhooks, or code repository APIs (such as GitHub, GitLab, Gitee, etc.) to monitor code repository change events in real time. This triggers an API documentation change process, which involves structurally parsing the newly added code corresponding to the change event to obtain the parsing results. This identifies the changed API parameters (e.g., new parameters, modified parameter types, etc.). Based on these parsing results, the corresponding API parameters in the target API documentation are updated, resulting in an updated target API documentation. Then, based on the updated target API documentation, corresponding target test cases are generated, and API tests are performed, ultimately producing an API test report. In simpler terms, whenever code in the code repository changes, the newly added code can be structurally parsed to obtain parsing results. These results are then used to update the corresponding API parameters in the already generated target API documentation, resulting in an updated target API documentation. Subsequent processing is then performed based on this updated target API documentation.

[0101] In this embodiment, by monitoring the code repository to obtain newly added code, performing structured parsing on the newly added code to obtain the parsing results, updating the corresponding interface parameters in the target interface document based on the parsing results, obtaining the updated target interface document, and then parsing the updated target interface document to generate corresponding test cases, it is possible to achieve real-time monitoring of the code, parse the newly added code obtained from the monitoring, and update the corresponding parameters in the already generated interface document based on the parsing results, thereby achieving timely updates of the interface parameters in the generated interface document.

[0102] In one example, the interface testing method provided in this application embodiment can be achieved through, as follows: Figure 4 The interface testing system shown is implemented as follows. The interface testing system includes model1 – an intelligent interface documentation generation and completion system; model2 – an intelligent interface test case generation and execution system; and model3 – an intelligent automated test report analysis system.

[0103] Model 1 – The Intelligent API Documentation Generation and Completion System analyzes source code and utilizes AST, NLP, and LLM technologies to intelligently generate and complete API documentation. Through code AST parsing and NLP parameter naming analysis, the system integrates historical API libraries and industry standard knowledge (i.e., API specification knowledge), and uses LLM to automatically generate API documentation and complete constraints, outputting real-time updated complete API documentation that ensures strong consistency between the API documentation and the code in the code repository.

[0104] The model2-based intelligent API test case generation and execution system dynamically senses API interface document version changes, utilizes AI capabilities to parse structured documents, and combines test case design strategies and methods with an interface activity awareness module to generate and test interface test cases. Based on structured interface documents, the system generates test cases covering normal flow, abnormal flow, and dependency chains through orthogonal testing, boundary value derivation, and anomaly mode algorithms. It also dynamically optimizes execution strategies based on production environment interface activity, driving automated test execution and outputting interface test reports.

[0105] The model3-Automated Test Report Intelligent Analysis System analyzes and processes the output interface test reports and failed test logs (i.e., error locations) using AI diagnostics. It then outputs intelligent analysis and remediation suggestions for the test reports. The system performs multimodal preprocessing on test failure logs, combining error pattern recognition and root cause analysis to automatically generate accurate remediation suggestion reports, significantly shortening problem diagnosis time.

[0106] In one example, the interface testing method provided in this application embodiment can be achieved through, as follows: Figure 5The interface testing system shown is implemented as follows. The interface testing system includes an intelligent interface documentation generation and completion system, an intelligent interface test case generation and execution system, and an automated test report intelligent analysis system. The intelligent interface documentation generation and completion system comprises a code semantic parsing layer and an AI generation + completion decision layer. The code semantic parsing layer performs AST parsing on the developed code to obtain code parsing results in code form. Then, it uses NLP parameter naming analysis to convert the code parsing results into natural language code parsing results. The AI ​​generation + completion decision layer combines the natural language code parsing results with historical API libraries and industry knowledge specifications to generate initial interface documentation using AI. It then generates constraint completion suggestions (i.e., parameter constraints) for the initial interface documentation based on LLM. Finally, it merges the initial interface documentation and parameter constraints to obtain the target interface documentation (i.e., the generated interface documentation (completed version)). The intelligent interface documentation generation and completion system can also monitor code in the code repository; if new code is added, it updates the generated interface documentation accordingly. By automatically using AST technology to parse the semantic features of the code, extracting the objective entities and syntactic relationships in the code, and combining NLP technology to analyze the semantics of naming and comments, the potential intentions of the developers are inferred. In addition, by combining historical API knowledge bases and financial industry knowledge standards, API interface documentation is generated. Finally, LLM or decision models generate high-confidence completion suggestions, realizing the automatic generation of interface documentation and the ability to perform completion optimization, completely eliminating the need for manual production of API interface documentation.

[0107] The intelligent interface test case generation and execution system comprises a structured document intelligent parsing layer, a test strategy generation layer, an intelligent interface test case generation layer, and a production environment interface activity perception layer. The structured document intelligent parsing layer parses the generated target interface document to obtain the corresponding interface parameter information, including parameter type information (parameter type feature extraction), constraint information (constraint parsing), and interface dependencies (interface dependency parsing). Orthogonal test scenario decomposition: The test strategy generation layer processes the interface parameter information based on orthogonal test strategies to obtain orthogonal test results. Intelligent boundary value derivation: Based on boundary derivation strategies, the system processes the interface parameter information to obtain the boundary values ​​of the interface parameter range. Anomaly pattern generation algorithm: Based on anomaly pattern strategies, the system processes the interface parameter information to obtain abnormal interface parameter results. Based on the processing results from the test strategy generation layer and the structured document intelligent parsing layer, the intelligent interface test case generation layer generates normal flow test cases, abnormal flow test cases, or dependency chain test cases using AI. The production environment interface activity awareness layer periodically monitors the activity of interface calls in the production environment (i.e., interface call status) to determine the test priority of interfaces (i.e., generate automated execution strategies). According to the test priority, interfaces in the target interface documentation are tested sequentially based on target test cases, resulting in target interface test reports (i.e., automated test reports). By detecting interface document version changes in real time, the layer automatically triggers the parsing of structured API interface documents, generating normal, abnormal, and sequential dependency chain interface test cases based on appropriate test strategies. Furthermore, with the assistance of the interface activity awareness module, it can analyze which interfaces have low activity, allowing for a reduction in execution priority or removal from the existing interface test case library, thus improving execution effectiveness. Ultimately, this achieves automatic detection of API interface document version changes, automated generation of interface test cases, execution, and output of automated interface test reports.

[0108] The automated test report intelligent analysis system includes a multimodal log data preprocessing layer and an AI diagnostic engine. The multimodal log data preprocessing layer performs structured parsing of logs recorded during interface testing, extracts the context code corresponding to error locations, obtains code configuration files, captures test environment snapshots, and comprehensively uses the AI ​​diagnostic engine to identify error patterns, obtaining root cause analysis results for each error pattern. Based on the root cause analysis results, optimization suggestions are determined, and a repair suggestion and system optimization suggestion report (i.e., an interface optimization report) is generated.

[0109] Multimodal log parsing technology efficiently processes and comprehensively analyzes various types of log files, while combining this with the specific code context information where the problem occurred to delve into potential root causes. Furthermore, to more comprehensively recreate the problem scenario, data snapshots of the test environment are collected to ensure all relevant factors are included in the analysis. Based on this, an advanced AI diagnostic engine intelligently processes the collected information, ultimately generating a detailed and targeted remediation suggestion report. This report not only helps developers quickly understand the essence of the problem but also provides clear remediation directions, significantly reducing reliance on manual analysis, achieving comprehensive and in-depth problem analysis, and improving overall work efficiency and the accuracy of problem solving.

[0110] In the example above, the entire process of "API interface document generation → interface test case generation and execution → test report analysis and suggestions" is intelligently managed, achieving closed-loop optimization of interface testing and significantly reducing manual costs.

[0111] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0112] Based on the same inventive concept, this application also provides an interface testing apparatus for implementing the interface testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more interface testing apparatus embodiments provided below can be found in the limitations of the interface testing method described above, and will not be repeated here.

[0113] In one exemplary embodiment, such as Figure 6 As shown, an interface testing device 600 is provided, including: a code parsing module 602, a document generation module 604, a document parsing module 606, a parameter processing module 608, a test case generation module 610, and an interface testing module 612, wherein:

[0114] The code parsing module 602 is used to perform structured parsing of the code and obtain the code parsing results;

[0115] Documentation generation module 604 is used to generate target interface documentation based on code parsing results and interface specification knowledge;

[0116] The document parsing module 606 is used to parse the target interface document to obtain the interface parameter information of the interface in the target interface document;

[0117] The parameter processing module 608 is used to process the interface parameter information according to the preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information.

[0118] The test case generation module 610 is used to generate target test cases based on interface parameter information and parameter strategy results;

[0119] The interface testing module 612 is used to test the interfaces in the target interface document based on the target test cases and obtain the target interface test report.

[0120] In some embodiments, the document generation module 604 is further configured to convert the code parsing result from code form to natural language form; generate an initial interface document through an artificial intelligence model based on the code parsing result in natural language form and interface specification knowledge; generate parameter constraints of the initial interface document according to the parameter characteristics in the initial interface document; and generate a target interface document according to the parameter constraints and the initial interface document.

[0121] In some embodiments, the parameter processing module 608 is further configured to: if there is a first interface in the interface that includes multiple interface parameters and each interface parameter includes multiple values, process the interface parameter information of the first interface based on an orthogonal testing strategy to obtain the orthogonal test result corresponding to the interface parameter information of the first interface; and / or, if there is a second interface in the interface that includes a specific range of parameter values, derive the boundary values ​​of the range of interface parameters of the second interface based on a boundary derivation strategy to obtain the boundary values ​​of the range of interface parameters of the second interface; and / or, if there is a third interface in the interface that includes parameter constraints, generate anomaly results for the interface parameters of the third interface based on an anomaly mode strategy.

[0122] In some embodiments, the test case generation module 610 is further configured to generate at least one of normal flow test cases, abnormal flow test cases, or dependency chain test cases based on at least one of the orthogonal test results, the boundary values ​​of the range of interface parameters, or abnormal results of interface parameters, and interface parameter information.

[0123] In some embodiments, the interface testing module 612 is further configured to determine the test priority of the interfaces in the target interface document based on the interface call situation in the production environment; and to test the interfaces in the target interface document sequentially according to the test priority and based on the target test cases to obtain a target interface test report.

[0124] In some embodiments, the above-mentioned apparatus further includes a test report analysis module, used to obtain interface test logs recorded during the testing process of the interface; analyze the interface information corresponding to the error location in the interface test logs, determine the error mode to which the interface information belongs, and perform root cause analysis on the error mode to obtain root cause analysis results; determine optimization suggestions based on the root cause analysis results, and generate an interface optimization report based on the root cause analysis results and optimization suggestions.

[0125] In some embodiments, the above apparatus further includes an interface document update module, which is used to monitor the code repository and obtain newly added code after generating the target interface document based on the code parsing results and interface specification knowledge; perform structured parsing on the newly added code to obtain the parsing results of the newly added code; and update the corresponding interface parameters in the target interface document based on the parsing results of the newly added code to obtain the updated target interface document.

[0126] The document parsing module 606 is also used to parse the updated target interface document to obtain the interface parameter information of the interface in the updated target interface document.

[0127] Each module in the aforementioned interface testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0128] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to the interface testing method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an interface testing method.

[0129] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0130] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0131] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0132] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0136] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An interface testing method, characterized in that, The method includes: The code is structured and parsed to obtain the code parsing results; Based on the code parsing results and interface specification knowledge, generate the target interface documentation; The target interface document is parsed to obtain the interface parameter information of the interface in the target interface document; The interface parameter information is processed according to preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information; Based on the interface parameter information and the parameter strategy results, generate target test cases; Based on the target test cases, the interfaces in the target interface document are tested to obtain a target interface test report.

2. The method according to claim 1, characterized in that, Based on the code parsing results and interface specification knowledge, the target interface document is generated, including: The code parsing results are converted from code form to natural language form; Based on the code parsing results in natural language form and the interface specification knowledge, an initial interface document is generated through an artificial intelligence model. Based on the parameter characteristics in the initial interface document, generate the parameter constraints of the initial interface document; Based on the parameter constraints and the initial interface document, generate the target interface document.

3. The method according to claim 1, characterized in that, The step of processing the interface parameter information according to preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information includes: If the interface includes a first interface with multiple interface parameters, and each interface parameter includes multiple possible values, the interface parameter information of the first interface is processed based on an orthogonal testing strategy to obtain the orthogonal test result corresponding to the interface parameter information of the first interface; and / or, If the interface includes a second interface with a specific range of parameter values, the boundary value derivation strategy is used to derive the boundary values ​​of the interface parameter range of the second interface, thus obtaining the boundary values ​​of the interface parameter range of the second interface; and / or, If there is a third interface that includes parameter constraints in the interface, an abnormal result for the interface parameters of the third interface is generated based on the abnormal mode strategy.

4. The method according to claim 3, characterized in that, The step of generating target test cases based on the interface parameter information and the parameter strategy results includes: Based on at least one of the orthogonal test results, the boundary values ​​of the range of the interface parameters, or the abnormal results of the interface parameters, and the interface parameter information, at least one of the following is generated: normal flow test cases, abnormal flow test cases, or dependency chain test cases.

5. The method according to claim 1, characterized in that, The step of testing the interfaces in the target interface document based on the target test cases to obtain a target interface test report includes: Based on the interface call behavior in the production environment, determine the test priority of the interfaces in the target interface document; According to the test priority, the interfaces in the target interface document are tested sequentially based on the target test cases to obtain the target interface test report.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Obtain the interface test logs recorded during the testing process of the interface; The interface information corresponding to the error location in the interface test log is analyzed to determine the error mode to which the interface information belongs, and the root cause analysis is performed on the error mode to obtain the root cause analysis results. Based on the root cause analysis results, optimization suggestions are determined, and an interface optimization report is generated based on the root cause analysis results and optimization suggestions.

7. The method according to claim 1, characterized in that, After generating the target interface document based on the code parsing results and interface specification knowledge, the method further includes: Monitor the code repository to detect newly added code; The newly added code is subjected to structured parsing to obtain the parsing results. Based on the newly added code parsing results, the corresponding interface parameters in the target interface document are updated to obtain the updated target interface document; The step of parsing the target interface document to obtain the interface parameter information of the interface in the target interface document includes: The updated target interface document is parsed to obtain the interface parameter information of the interface in the updated target interface document.

8. An interface testing device, characterized in that, The device includes: The code parsing module is used to perform structured parsing of code and obtain the code parsing results; The document generation module is used to generate target interface documentation based on the code parsing results and interface specification knowledge. The document parsing module is used to parse the target interface document to obtain the interface parameter information of the interface in the target interface document; The parameter processing module is used to process the interface parameter information according to preset strategy conditions to obtain the parameter strategy result corresponding to the interface parameter information; The test case generation module is used to generate target test cases based on the interface parameter information and the parameter strategy results; The interface testing module is used to test the interfaces in the target interface document based on the target test cases and obtain the target interface test report.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.