Interface testing method, device, system, cluster and program product
By using large models to generate DSL corpus in the cloud platform and automatically configure interface parameters, the problems of low test case reuse and low development efficiency in existing interface testing methods are solved, and efficient interface testing is achieved.
Patent Information
- Application Number
- CN202411982777.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-28
- Publication Date
- 2025-05-30
AI Technical Summary
In the existing interface testing methods, the reuse rate of test cases is low, and the development process requires a lot of manual configuration, resulting in low interface testing efficiency.
By deploying large models in the cloud platform, domain-specific language (DSL) corpus is generated based on the description information of different types of application interfaces, and test cases are generated based on the DSL corpus. This method does not require manual code writing, and can automatically configure interface parameters, improve the development efficiency of test cases and realize the reuse of test cases.
It reduces the time-consuming development of test cases, improves the testing efficiency of application interfaces, and realizes the reuse of test cases, further improving the efficiency of interface testing.
Smart Images

Figure CN120066951A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular, to an interface testing method, apparatus, system, cluster, and program product. Background Art
[0002] Application programming interface (API) testing is a type of testing for testing the interfaces between system components, mainly used to detect the interaction points between external systems and systems, as well as between internal subsystems. The focus of application interface testing is to check the data exchange, transfer, and control management processes, as well as the mutual logical dependencies between systems, etc.
[0003] Due to the differences in interface parameters such as request methods, request addresses, and response methods for application interfaces in different business scenarios or different systems. Therefore, in the interface testing scenario, different application interfaces need to use different test cases for application interface testing, resulting in a low reuse rate of test cases. Moreover, the development process of test cases requires a large amount of manual configuration by testers, and the development time is long, resulting in low efficiency of interface testing. Summary of the Invention
[0004] This application provides an interface testing method, apparatus, system, cluster, and program product to achieve the reuse of test cases and improve the testing efficiency of interfaces.
[0005] In a first aspect, this application provides an interface testing method applied to a cloud platform where a large model is deployed. The large model is used to generate different domain-specific language (DSL) corpora based on the description information of different types of application interfaces, and generate different test cases based on different DSL corpora. After the cloud platform obtains the description information of the first type of application interface, the cloud platform calls the large model to generate candidate test cases that match the description information, and tests the first type of application interface according to the candidate test cases.
[0006] Based on the first aspect, the process of the cloud platform using the large model to generate candidate test cases does not require manual coding, but instead, test cases are generated by a machine, which can reduce the development time of test cases. Moreover, the generated candidate test cases include the interface information and interface parameters of the first type of application interface. In this way, the large model realizes the configuration of interface parameters, eliminating the need for manual configuration of interface parameters, which can greatly shorten the development duration of test cases and improve the testing efficiency of application interfaces. In addition, the different types of application interfaces provided by the cloud platform include the first type of application interface, so that the reuse of application interfaces and test cases can be achieved, further improving the testing efficiency of application interfaces.
[0007] In an alternative implementation, it is specifically implemented as follows: The cloud platform further includes: a knowledge base. The knowledge base includes multiple interface information corpora and interface parameter corpora associated with each interface information corpus in the multiple interface information corpora.
[0008] During the process of the cloud platform calling the large model deployed in the cloud platform to generate candidate test cases matching the description information, the cloud platform queries the knowledge base based on the description information by calling the large model to obtain the first DSL corpus matching the description information, and then calls the large model based on the first DSL corpus to generate candidate test cases matching the description information.
[0009] Optionally, the first DSL corpus includes: a first candidate interface parameter corpus matching the description information and a first candidate interface information corpus matching the description information.
[0010] In this way, the DSL corpus can be quickly obtained by querying the knowledge base. The efficiency of the cloud platform in generating the DSL corpus is improved, and thus the time taken for the cloud platform to generate candidate test cases is shortened. Consequently, the interface test efficiency is enhanced.
[0011] In an alternative implementation, the specific implementation of calling the large model based on the first DSL corpus to generate candidate test cases matching the description information is as follows: The cloud platform calls the large model to reason about the description information to obtain a second DSL corpus. The cloud platform uses the first DSL corpus and the second DSL corpus as the input to the large model to generate candidate test cases matching the description information.
[0012] Optionally, the second DSL corpus includes: a second candidate interface parameter corpus matching the description information and a second candidate interface information corpus matching the description information.
[0013] Based on this alternative implementation, the cloud platform utilizes the query result and reasoning result of the large model to obtain the DSL corpus corresponding to the description information. In this way, by enhancing the reliability of the DSL corpus corresponding to the description information, the reliability of the finally generated candidate test cases is ensured.
[0014] In an alternative implementation, a large model deployed in the cloud platform is called to generate candidate test cases that match the description information. The specific implementation is as follows: The cloud platform calls the large model to generate DSL corpus that matches the description information. Based on the DSL corpus, the large model is called for inference to obtain candidate interface keywords. The cloud platform provides a first interface to the client; the first interface includes the candidate interface keywords. In response to a first operation of the client based on the first interface, the cloud platform calls the large model for inference based on the candidate interface keywords and the DSL corpus to obtain candidate interface parameters. The cloud platform provides a second interface to the client, and the second interface includes the candidate interface keywords and the candidate interface parameters. In response to a second operation of the client based on the second interface, the cloud platform generates candidate test cases based on the candidate interface keywords and the candidate interface parameters.
[0015] Optionally, the candidate interface keywords are used to indicate one or more of the following: the request address, request identifier, and request method of the interface unit in the candidate test case.
[0016] Optionally, the DSL corpus includes: the first DSL corpus. Or the DSL corpus includes the second DSL corpus. Or the DSL corpus includes the first DSL corpus and the second DSL corpus. Or the DSL corpus is obtained based on the first DSL corpus and the second DSL corpus.
[0017] Among them, the first DSL corpus is queried by the large model based on the description information, and the second DSL corpus is inferred by the large model based on the description information.
[0018] Based on this alternative implementation, the cloud platform sequentially provides the candidate interface keywords and candidate interface parameters to the user in a segmented inference manner to generate candidate test cases. Moreover, after the user adopts the candidate interface keywords, the candidate interface parameters are obtained by inferring with the large model. In this way, the reliability of the candidate interface keywords and candidate interface parameters can be improved. Furthermore, the reliability of the candidate test cases can be improved.
[0019] In an alternative implementation, the specific implementation of the cloud platform calling the large model for inference based on the DSL corpus to obtain candidate interface keywords is as follows: The cloud platform calls the large model for inference based on the DSL corpus to obtain initial interface keywords. The cloud platform matches the initial interface keywords with application interfaces of different types. In the case where there is a first application interface among the application interfaces of different types, the interface information of the first application interface is fitted with the initial interface keywords to obtain candidate interface keywords.
[0020] Among them, the first application interface includes: among the application interfaces of different types, the application interface whose interface information precisely matches the initial interface keywords.
[0021] Alternatively, the first application interface includes: among different types of application interfaces, the application interfaces whose interface information is vaguely matched with the initial interface keyword.
[0022] Based on this optional implementation, the cloud platform uses a multi-level matching mechanism to obtain the real interface information that matches the output of the large model. And based on the real interface information and the output of the large model for fitting, improve the reliability of the final candidate interface keyword, and then improve the adoption rate of the candidate interface keyword.
[0023] In an optional implementation, the specific implementation is: when the first application interface does not exist among different types of application interfaces, the cloud platform calls the large model to obtain an expression data serialization (yaml ain’t markup language, YAML) document. The cloud platform generates a second type of application interface that matches the initial interface keyword based on the YAML document, and fits the interface information of the second type of application interface with the initial interface keyword to obtain the candidate interface keyword.
[0024] Among them, the YAML document is used to indicate: the request path, request method, request parameters, and response body of the interface.
[0025] Based on this optional implementation, when the first application interface does not exist among different types of application interfaces, the cloud platform calls the large model to generate a YAML document, and uses the YAML document to generate a second type of application interface that matches the initial interface keyword. In this way, the real interface information that matches the output of the large model can be obtained. And based on the real interface information and the output of the large model for fitting, improve the reliability of the final candidate interface keyword, and then improve the adoption rate of the candidate interface keyword.
[0026] In an optional implementation, the specific implementation is that for any third type of application interface among different types of application interfaces, the cloud platform calls the large model to obtain the characteristics of the third type of application interface. The cloud platform converts the characteristics of the third type of application interface into the initial DSL corpus. When the initial DSL corpus meets the first requirement, the initial DSL corpus is split into the first interface information corpus and the first interface parameter corpus, and the first interface information corpus and the first interface parameter corpus are written into the knowledge base.
[0027] Among them, the characteristics include one or more of the following: the interface name, interface request method, protocol, request body, checkpoint, and response extraction of the third type of application interface.
[0028] The first requirement includes one or more of the interface name, interface request method, protocol, request body, checkpoint, and response extraction of the third type of application interface.
[0029] Based on this optional implementation, the cloud platform evaluates the initial DSL corpus obtained through large model inference to ensure the reliability of the finally generated DSL corpus, and further ensure the reliability and accuracy of the finally generated candidate test cases. Moreover, the cloud platform splits the DSL corpus to reduce the data volume of a single corpus, thereby reducing the number of words (Tokens) and the Token length. This can shorten the large model inference duration and improve the inference accuracy.
[0030] In an optional implementation, the specific implementation is as follows: When the initial DSL corpus does not meet the first requirement, the cloud platform calls the large model to correct the initial DSL corpus to obtain the corrected DSL corpus. When the corrected DSL corpus meets the first requirement, the cloud platform splits the corrected DSL corpus into a second interface information corpus and a second interface parameter corpus, and writes the second interface information corpus and the second interface parameter corpus into the knowledge base.
[0031] Based on this optional implementation, when the initial DSL corpus does not meet the first requirement, the cloud platform corrects the initial DSL corpus to ensure the reliability of the finally generated DSL corpus, and further ensure the reliability and accuracy of the finally generated candidate test cases.
[0032] In an optional implementation, the specific implementation is as follows: Different types of application interfaces are generated by the cloud platform based on different interface expression structure data uploaded by the client. Among them, the interface expression structure data is used to indicate one or more of the following: the request path, request method, request parameters, and response body of the application interface.
[0033] Based on this optional implementation, the cloud platform generates interfaces by importing interface expression structure data to provide users with multiple different types of interfaces, enabling users to select corresponding application interfaces from multiple different types of interfaces for interface testing, thereby enabling the reuse of application interfaces. This can further shorten the development duration of test cases and improve the test efficiency of application interfaces.
[0034] In an optional implementation, the specific implementation of the cloud platform testing the first type of application interface according to the candidate test cases is as follows: The cloud platform provides a third interface to the client; the third interface includes the description information of the first type of application interface and the candidate test cases. The cloud platform performs interface testing based on the candidate test cases in response to a third operation of the client based on the third interface.
[0035] In this way, the cloud platform can improve the interactivity with users and ensure the reliability of candidate test cases at the same time.
[0036] In a second aspect, the present application provides an interface testing device, which includes a communication module, a storage module, and a processing module.
[0037] Among them, the storage module is used to store executable computer programs and data during the interface test of the interface testing device, such as different types of application interfaces, DSL corpora of different application interfaces, etc.
[0038] The communication module is used to obtain the description information of the first type of application interface.
[0039] The processing module is used to execute the executable computer program, call the large model to generate candidate test cases that match the description information, and test the first type of application interface according to the candidate test cases.
[0040] Optionally, the large model is used to generate different DSL corpora according to the description information of different types of application interfaces, and generate different test cases based on different DSL corpora.
[0041] The different types of application interfaces include the first type of application interface; the candidate test cases include the first type of application interface, the interface information of the first type of application interface, and the interface parameters.
[0042] In an alternative implementation, specifically: the storage module also stores a knowledge base, which includes multiple interface information corpora and interface parameter corpora associated with each interface information corpus in the multiple interface information corpora.
[0043] The processor is specifically used to call the large model to query the knowledge base based on the description information, obtain the first DSL corpus that matches the description information, and call the large model based on the first DSL corpus to generate candidate test cases that match the description information.
[0044] Optionally, the first DSL corpus includes: the first candidate interface parameter corpus that matches the description information, and the first candidate interface information corpus that matches the description information.
[0045] In an alternative implementation, the processor is specifically used to: call the large model to reason about the description information to obtain the second DSL corpus. And use the first DSL corpus and the second DSL corpus as the input of the large model to generate candidate test cases that match the description information.
[0046] Optionally, the second DSL corpus includes: the second candidate interface parameter corpus that matches the description information, and the second candidate interface information corpus that matches the description information.
[0047] In an alternative implementation, the processor is specifically configured to: call a large model to generate a DSL corpus that matches the description information. Based on the DSL corpus, call the large model for inference to obtain candidate interface keywords. Provide a first interface to the client; the first interface includes the candidate interface keywords. The processor is configured to, in response to a first operation of the client based on the first interface, call the large model for inference based on the candidate interface keywords and the DSL corpus to obtain candidate interface parameters. And is configured to provide a second interface to the client, where the second interface includes the candidate interface keywords and the candidate interface parameters. The processor is further configured to, in response to a second operation of the client based on the second interface, generate candidate test cases based on the candidate interface keywords and the candidate interface parameters.
[0048] Optionally, the candidate interface keywords are used to indicate one or more of the following: the request address, request identifier, and request method of the interface unit in the candidate test case.
[0049] Optionally, the DSL corpus includes: a first DSL corpus. Or the DSL corpus includes a second DSL corpus. Or the DSL corpus includes the first DSL corpus and the second DSL corpus. Or the DSL corpus is obtained based on the first DSL corpus and the second DSL corpus.
[0050] Among them, the first DSL corpus is retrieved by the large model based on the description information, and the second DSL corpus is obtained by the large model's inference based on the description information.
[0051] In an alternative implementation, the processor is specifically configured to: call the large model for inference based on the DSL corpus to obtain initial interface keywords. And match the initial interface keywords with application interfaces of different types. In the case where there is a first application interface among the application interfaces of different types, the processor is further configured to fit the interface information of the first application interface with the initial interface keywords to obtain candidate interface keywords.
[0052] Among them, the first application interface includes: an application interface in which the interface information in the application interfaces of different types precisely matches the initial interface keywords. Or, the first application interface includes: an application interface in which the interface information in the application interfaces of different types vaguely matches the initial interface keywords.
[0053] In an alternative implementation, the processor is further configured to: in the case where there is no first application interface among the application interfaces of different types, call the large model based on the initial interface keywords to obtain an expression data serialization YAML document. And generate a second type of application interface that matches the initial interface keywords based on the YAML document, and fit the interface information of the second type of application interface with the initial interface keywords to obtain candidate interface keywords.
[0054] Among them, the YAML document is used to indicate: the request path, request method, request parameters, and response body of the interface.
[0055] In an alternative implementation, the processor is further configured to: for any third type of application interface among different types of application interfaces, call a large model to obtain the characteristics of the third type of application interface. And convert the characteristics of the third type of application interface into an initial DSL corpus. When the initial DSL corpus meets the first requirement, split the initial DSL corpus into a first interface information corpus and a first interface parameter corpus, and write the first interface information corpus and the first interface parameter corpus into the knowledge base.
[0056] Among them, the characteristics include one or more of the following: the interface name of the third type of application interface, the interface request method, the protocol, the request body, the checkpoint, and the response extraction.
[0057] The first requirement includes one or more of the following: the interface name of the third type of application interface, the interface request method, the protocol, the request body, the checkpoint, and the response extraction.
[0058] In an alternative implementation, the processor is further configured to: when the initial DSL corpus does not meet the first requirement, call a large model to correct the initial DSL corpus to obtain a corrected DSL corpus. And when the corrected DSL corpus meets the first requirement, split the corrected DSL corpus into a second interface information corpus and a second interface parameter corpus, and write the second interface information corpus and the second interface parameter corpus into the knowledge base.
[0059] In an alternative implementation, the specific implementation is: the application interfaces of the same type are generated by the cloud platform based on different interface expression structure data uploaded by the client. Among them, the interface expression structure data is used to indicate one or more of the following: the request path, request method, request parameters, and response body of the application interface.
[0060] In an alternative implementation, the processor is specifically configured to: provide a third interface to the client; the third interface includes: the description information of the first type of application interface and candidate test cases. And in response to a third operation of the client based on the third interface, perform an interface test based on the candidate test cases.
[0061] In a third aspect, the present application provides a test system, which includes a client and the interface test device provided by the second aspect or any alternative implementation in the second aspect.
[0062] Among them, the client is used to provide the description information of the first type of application interface to the interface test device.
[0063] An interface testing device is used to perform tests on the first type of application interfaces based on the description information and execute the method in the first aspect or any optional implementation manner in the first aspect.
[0064] In a fourth aspect, the present application provides a computing device cluster, including at least one computing device, and each computing device includes a processor and a memory; the processor of at least one computing device is configured to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method in the first aspect or any optional implementation manner in the first aspect.
[0065] In a fifth aspect, the present application provides a computer program product, which, when the instructions are run by a computing device cluster, causes the computing device cluster to execute the method in the first aspect or any optional implementation manner in the first aspect.
[0066] In a sixth aspect, the present application provides a computer-readable storage medium, including computer program instructions. When the computer program instructions are executed by a server, the server executes the instructions in the computing program stored in the computer-readable storage medium to execute the method in the first aspect or any optional implementation manner in the first aspect.
[0067] Regarding the technical effects brought by any optional implementation manner in the second aspect to the sixth aspect, reference may be made to the technical effects brought by the first aspect or any optional implementation manner in the first aspect. Details are not described herein again. Based on the implementation manners provided in the above aspects, the present application can be further combined to provide more implementation manners. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is a schematic diagram of the time consumption of the interface testing process provided by the present application;
[0069] Figure 2 It is a schematic diagram of the structure of the interface testing system provided by the present application;
[0070] Figure 3 It is a schematic diagram of the structure of the interface testing device provided by the present application Figure 1 ;
[0071] Figure 4 It is a schematic diagram of the system architecture provided by the present application;
[0072] Figure 5 It is a schematic diagram of the flow of the interface testing method provided by the present application Figure 1 ;
[0073] Figure 6 It is a schematic diagram of the display of different types of interfaces provided by the present application;
[0074] Figure 7Schematic diagram for modifying interface parameters provided by this application;
[0075] Figure 8 Flow schematic of the interface testing method provided by this application Figure 2 ;
[0076] Figure 9 Interface schematic of the interface testing process provided by this application Figure 1 ;
[0077] Figure 10 Flow schematic of generating DSL corpus provided by this application Figure 1 ;
[0078] Figure 11 Flow schematic of generating DSL corpus provided by this application Figure 2 ;
[0079] Figure 12 Schematic diagram of the process for generating candidate test cases provided by this application;
[0080] Figure 13 Schematic diagram of the process for obtaining candidate interface keywords provided by this application;
[0081] Figure 14 Interface schematic of the interface testing process provided by this application Figure 2 ;
[0082] Figure 15 Structural schematic of the interface testing device provided by this application Figure 2 ;
[0083] Figure 16 Structural schematic diagram of the computing device provided by this application;
[0084] Figure 17 Structural schematic diagram of the computing device cluster provided by this application;
[0085] Figure 18 Schematic diagram of the network connection between computing devices in the computing device cluster provided by this application. Detailed implementation manners
[0086] Since application interfaces in different business scenarios or different systems have different interface parameters, such as different request methods, request addresses, or response manners. Therefore, during the interface testing process, different test cases are written for different application interfaces, and the reuse rate of test cases is low. Moreover, during the process of writing test cases, such as Figure 1As shown, the time spent by testers in selecting interfaces and configuring interface parameters accounts for nearly 60% of the total duration of interface testing. When testers manually select interfaces and configure interface parameters, it results in a long development time for test cases, thus leading to low efficiency of interface testing.
[0087] Based on this, to achieve the reuse of test cases and improve the efficiency of interface testing, this application provides an interface testing method for testing interfaces in a cloud platform. During the interface testing process, compared with the solution of writing test cases using code, the process of the cloud platform generating candidate test cases using a large model does not require manual code writing. Instead, test cases are generated by a machine, which can reduce the development time of test cases. Moreover, the generated candidate test cases include the interface information and interface parameters of the first type of application interface. In this way, the large model realizes the configuration of interface parameters without manual configuration of interface parameters, which can greatly shorten the development duration of test cases and improve the testing efficiency of application interfaces. In addition, different types of application interfaces include this first type of application interface, so that the reuse of application interfaces and test cases can be realized, further improving the testing efficiency of application interfaces.
[0088] Specifically, a large model is deployed in the cloud platform. This large model is used to generate different DSL corpora according to the description information of different types of application interfaces, and generate different test cases based on different DSL corpora. After the cloud platform obtains the description information of the first type of application interface, the cloud platform calls the large model to generate candidate test cases that match the description information, and tests the first type of application interface according to the candidate test cases.
[0089] The interface testing method provided by this application can not only be used to generate interface test cases and implement interface testing, but also be used in other product testing scenarios to generate test cases. Among them, other product testing scenarios can include but are not limited to scenarios such as system testing, software testing, pipeline testing, and communication testing.
[0090] The terms used in the implementation part of this application are only used to explain the specific embodiments of this application, rather than aiming to limit this application. First, some concepts that this application may involve will be briefly introduced below.
[0091] Cloud computing environment: An entity that provides cloud services to users using basic resources in the cloud computing mode. The cloud environment includes a cloud data center and a cloud service platform.
[0092] Among them, the cloud data center includes a large number of basic resources (including computing clusters, storage resources, and network resources) owned by cloud service providers. In this article, the cloud data center can also be referred to as a cloud management platform, a cloud computing platform, etc.
[0093] Host: Refers to the physical server deployed in the cloud management platform. The physical resources of the host include physical central processing unit (CPU) and memory devices. Virtualization software runs on each host, which virtualizes some physical resources into virtual resources for instances to use. For example, the virtualization software virtualizes the CPU into virtual CPU (vCPU). There are also resources such as memory channels, cache channels, caches, network input output (IO) bandwidth, and storage IO bandwidth on the host for the instances running on the host to share.
[0094] Instance: A computing node running on a host. Common instances include virtual machines (VM) or containers. Each instance occupies some or all of the virtual resources of the host. Usually, the instances deployed on the computing nodes can be used for data transmission, data calculation, etc.
[0095] Large language model (LLM): A deep learning model trained using a large amount of text data, which can generate natural language text or understand the meaning of language text. The large language model can handle various natural language tasks, such as text classification, question answering, dialogue, etc., and it also has the potential in handling complex tasks such as code generation and vulnerability detection. In this article, the large language model can also be called the large model. In one example, the LLM can be trained from a generative deep neural network model based on the transformer structure. For example, the GT4 model, chatgpt4, etc.
[0096] Test case: A document used to verify the software function. In the embodiments of this application, the test case is used to verify the function of the application interface.
[0097] Taking the test case for verifying the function of the application interface as an example, the test case includes: information of the interface to be tested, parameters of the interface, operation steps, expected results, etc.
[0098] Among them, the information of the interface (which can also be called interface information, interface basic information, or interface keyword (Actionword, AW)): Used to describe the interface, which may include but is not limited to: the service name where the interface is located, the name of the interface, identification, request address (URL) address, etc.
[0099] Parameters of the interface (which can also be called interface parameters or interface parameter information): It includes but is not limited to: request body, request type, checkpoint, response extraction, etc.
[0100] Among them, the request types include but are not limited to submission (POST) requests, retrieval (GET) requests, update (PUT) requests, or deletion (DELETE) requests, etc.
[0101] Checkpoints are used to detect whether the actual response of the interface meets the expected structure. In some ways, checkpoints can include but are not limited to: the response status code, response time, response headers, response body, etc. of the interface. In addition, in some other embodiments, checkpoints can also include the data structure of the response body, etc.
[0102] Response extraction is used to indicate the information extracted from the interface response. In some ways, response extraction can include but are not limited to: dynamic data in the response body, paging information, authentication tokens, connection relationships, error codes, etc.
[0103] The expected result is used to provide the benchmark response status code and benchmark response body of the interface.
[0104] Operation steps: used to indicate the test steps in the interface test process. For example, the operation steps include: 1) Package the request according to the request body and send the request to the specified request address. 2) Record the actual response status code, response headers, and response body of the interface according to the interface parameters. 3) Compare the actual response status code, response headers, and response body with the expected result to obtain the test result of the interface.
[0105] The technical solution provided by this application will be introduced below in conjunction with the accompanying drawings.
[0106] See Figure 2 , Figure 2 which is a schematic structural diagram of an interface test system provided by this application. The shown interface test system includes a client 20, a cloud service platform 30, and a cloud platform 10. This interface test system can be used for application interface test tasks or other test tasks. In some optional ways, the interface test system can also be called a test system, a software test system, or other names, and the embodiments of this application do not limit this.
[0107] In a first alternative implementation, the client 20 may be a computer running an application program. The computer running the application program may be a physical machine or a virtual machine. For example, if the computer running the application program is a physical computing device, the physical computing device may be a host or a terminal. Among them, the terminal may also be referred to as a terminal device, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, a desktop PC, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in unmanned driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, and so on. The embodiments of the present application do not limit the specific technologies and specific device forms adopted by the client 20.
[0108] In a second alternative implementation, the client 20 may be an application program, such as a cloud computer application program. Or the client 20 may be a web client. The client 20 runs on a terminal device. Among them, the terminal device includes but is not limited to a mobile phone terminal, a tablet computer, a personal computer, or a laptop computer, etc.
[0109] The above two implementation manners are only different implementation manners of the client 20. In actual applications, the client 20 may also have other implementation manners. For example, the client 20 may be a software module running on any one or more hosts in the computing cluster 110. The present application does not limit this.
[0110] In an alternative implementation, an interface test device 120, a large model, and a knowledge base 130 are deployed in the cloud platform 10.
[0111] In some embodiments, the interface test device 120 may be independently deployed in an instance of the cloud platform 10.
[0112] In addition, in some embodiments, the interface test device 120 may also be distributedly deployed in multiple instances of the cloud platform 10.
[0113] Similarly, the large model can also be deployed independently in an instance of the cloud platform 10 or distributedly in multiple instances of the cloud platform 10.
[0114] As Figure 2 shown, the interface testing device 120 is abstracted by the cloud service provider into an interface testing service on the cloud service platform 30 and provided to users. After the user purchases the interface testing service on the cloud service platform 30 through the client 20, the cloud environment uses the interface testing device 120 deployed on the cloud platform 10 to provide the interface testing service to the user. When using the interface testing service, the user can determine the interface to be tested (or the description information of the interface) and upload data to the cloud environment through the application program interface (API) or graphical user interface (GUI) in the client 20. The interface testing device 120 in the cloud environment receives the interface information (or the description information of the interface) of the user, and invokes the large model to perform interface recommendation or interface testing. The interface testing device 120 returns data such as test cases or status information during the interface testing process, or the results of the interface testing to the user through the API or GUI. Among them, the test case includes the parameters of the interface.
[0115] In addition, in some other embodiments, the function of the interface testing device 120 can be completed by the cloud platform 10 or other components of the cloud platform 10, and the present application does not limit its implementation manner.
[0116] The following Figure 2 gives an exemplary description of the modules included in the interface testing device 120.
[0117] As Figure 2 shown, the interface testing device 120 includes an API sharing management component 122, an inference component 126, a use case generation component 123, an automated execution component 124, a corpus generation component 125, and an interface orchestration component 121.
[0118] Among them, the functions implemented by the API sharing management component 122, the inference component 126, the use case generation component 123, the automated execution component 124, the corpus generation component 125, and the interface orchestration component 121 can be completed by the cloud platform 10 or other components of the cloud platform 10, and the present application does not limit its implementation manner.
[0119] The following gives an exemplary description of the connection relationship between the API sharing management component 122, the inference component 126, the use case generation component 123, the automated execution component 124, the corpus generation component 125, and the interface orchestration component 121, and the functions implemented by each module.
[0120] AsFigure 2 As shown, the interface orchestration component 121 is connected to the API sharing management component 122. The API sharing management component 122 is respectively connected to the interface orchestration component 121, the corpus generation component 125, and the test case generation component 123. The test case generation component 123 is respectively connected to the API sharing management component 122, the inference component 126, and the automated execution component 124.
[0121] Among them, the interface orchestration component 121 is used to provide an interface selection function, so that the user can select the interfaces to be tested from multiple interfaces provided by the cloud platform 10 through the client 20.
[0122] The API sharing management component 122 is used to manage multiple interfaces provided by the cloud platform 10 and provide multiple available interfaces to the interface orchestration component 121, the corpus generation component 125, and the test case generation component 123. For example, the API sharing management component 122 receives the interface files uploaded by the user and compiles the interface files to generate corresponding interfaces. Or, the API sharing management component 122 deletes the multiple interfaces provided by the management cloud platform 10 in response to the deletion operation sent by the user through the client 20. Or the API sharing management component 122 collaborates with the interface orchestration component 121 to provide the user with multiple interfaces in the cloud platform 10.
[0123] The test case generation component 123 is used to collaborate with the inference component 126 to generate test cases for the interfaces. For example, the test case generation component 123 collaborates with the inference component 126 to generate test cases for any one of the multiple interfaces. Another example is that the user uploads the description information of the interface to the cloud platform 10 through the client 20, and the test case generation component 123 collaborates with the inference component 126 to generate test cases corresponding to the description information of the interface, etc.
[0124] The inference component 126 is used to call the large model for inference to obtain the inference result, so that the test case generation component 123 can generate test cases for the interfaces according to the inference result.
[0125] The automated execution component 124 is used to execute interface tests, obtain test results, and provide the test results to the client 20. For example, the automated execution component 124 calls the automated factory to perform interface tests on the test cases generated by the test case generation component 123.
[0126] Among them, the automated factory is used to provide automated testing tools to implement interface tests. The automated factory can be deployed in the cloud platform 10 or in other cloud platforms, and the automated execution component 124 calls the automated factory by calling an interface.
[0127] The corpus generation component 125 is used to call a large model to convert different interfaces into corpus, and import the corpus of different interfaces into the knowledge base 130, so that the large model can perform reasoning based on the corpus of different interfaces in the knowledge base 130. Alternatively, the corpus generation component 125 can also be used to convert the description information of the interface into corpus, so that the large model can perform reasoning based on the corpus of the description information.
[0128] Among them, the knowledge base 130 is used to provide interface information corpus and interface parameter corpus of different interfaces.
[0129] In an alternative approach, the knowledge base 130 can be deployed in the cloud platform 10. For example, the knowledge base 130 is deployed in an instance of the cloud platform 10. Or the knowledge base 130 is distributedly deployed in multiple instances of the cloud platform 10.
[0130] Alternatively, in another alternative approach, the knowledge base 130 can also be located in other platforms. The cloud platform 10 provides an access interface to the knowledge base 130, and the corpus generation component 125 accesses the knowledge base 130 through the access interface and imports the corpus into the knowledge base 130.
[0131] In some embodiments, the knowledge base 130 may include an interface information knowledge base and an interface parameter knowledge base. The interface information knowledge base and the interface parameter knowledge base can be located in the same instance, or the interface information knowledge base and the interface parameter knowledge base can also be located in different instances respectively.
[0132] Among them, the interface information knowledge base is used to provide interface information corpus of different interfaces. The interface parameter knowledge base is used to provide interface parameter corpus.
[0133] Among them, the interface information corpus is a corpus for describing the information of the interface. In some alternative ways, the interface information corpus can also be called AW corpus.
[0134] The interface parameter corpus is a corpus for describing the parameters of the interface.
[0135] The corpus can be data that can be recognized by the large model. In some alternative ways, the corpus can also be called DSL corpus.
[0136] Based on Figure 2The provided interface testing device 120 does not require manual coding during the interface testing process for the process of the interface testing device 120 calling the large model to generate test cases. Instead, test cases are generated by the machine, which can reduce the development time of test cases. And through the API sharing management component 122, multiple interfaces are managed to achieve interface reuse. In addition, during the test case generation process, the interface testing device 120 uses the large model to implement interface parameter configuration without manual configuration of interface parameters, which can greatly shorten the development duration of test cases and improve the testing efficiency of application interfaces.
[0137] The above Figure 2 The provided interface testing device 120 shown above is only for illustrative purposes and should not be construed as a limitation on the interface testing device 120. In some other embodiments, the interface testing device 120 may also have other grouping methods, such as Figure 3 shown, the interface testing device 120 may further include a DSL conversion module 31, a corpus inspection module 32, a corpus storage module 33, an inference module 34, a retrieval module 35, a post-processing module 36, and a feedback module 37.
[0138] Among them, the functions implemented by the DSL conversion module 31, the corpus inspection module 32, the corpus storage module 33, the inference module 34, the retrieval module 35, the post-processing module 36, and the feedback module 37 can be completed by the cloud platform 10 or other components of the cloud platform 10, and the present application does not limit their implementation methods.
[0139] The functions implemented by the DSL conversion module 31, the corpus inspection module 32, the corpus storage module 33, the inference module 34, the retrieval module 35, the post-processing module 36, and the feedback module 37 are exemplarily described below.
[0140] The DSL conversion module 31 is used to call the large model to implement the mutual conversion between AW and AW corpus, and the mutual conversion between the parameters of the interface and the parameter corpus of the interface.
[0141] The corpus inspection module 32 is used to inspect the corpus generated by the large model. For example, the corpus inspection module 32 executes the following Figure 10 provided embodiments.
[0142] The corpus storage module 33 is used to import the corpus generated by the large model into the knowledge base 130.
[0143] The inference module 34 is used to call the large model to generate test cases that match the description information of the interface based on the description information of the interface uploaded by the client 20.
[0144] The retrieval module 35 is used to call a large model to provide the Retrieval-Augmented Generation (RAG) function, and retrieve the corpus that meets the description information of the interface from the knowledge base 130, so that the post-processing module 36 can return test cases to the client 20 based on the retrieved corpus.
[0145] The post-processing module 36 is used to cooperate with the inference module 34 and the retrieval module 35 to return test cases to the client 20. For example, the post-processing module 36 cooperates with the inference module 34 and the retrieval module 35 to execute the following Figure 11 provided embodiments.
[0146] The feedback module 37 is used to adjust the knowledge base 130 according to the user's adoption result of the test cases.
[0147] Based on Figure 3 the provided interface testing device 120, during the interface testing process of the interface testing device 120, the process of the interface testing device 120 calling the large model to generate test cases does not require manual coding, but test cases are generated by the machine, which can reduce the development time of test cases. In addition, during the test case generation process, the interface testing device 120 uses the large model to implement interface parameter configuration, and does not require manual configuration of interface parameters, which can greatly shorten the development duration of test cases and improve the testing efficiency of application interfaces.
[0148] The above Figure 3 is only an exemplary drawing and should not be construed as a limitation on the interface testing device 120. In other embodiments, the interface testing device 120 may also have other structures, which are not limited in this application embodiment.
[0149] The above Figures 2 to 3 In, the interface testing device 120 calls the large model to implement the generation of test cases, that is, the interface testing method provided by this application involves AI-related operations. The following combines Figure 4 to introduce the system architecture provided by this application embodiment in detail.
[0150] Figure 4 is the schematic diagram of the system architecture provided by this application embodiment. As Figure 4 shown, the system architecture 500 includes an execution device 510, a training device 520, a database 530, a client device 540, a data storage system 550, and a data acquisition device 560.
[0151] Among them, the execution device 510 includes a computing module 511, an I / O interface 512, a preprocessing module 513, and a preprocessing module 514.
[0152] Among them, the computing module 511 may include an AI model.
[0153] The data acquisition device 560 is used to acquire training samples. Among them, the training samples can be data such as test cases, description information of interfaces, information corpora of interfaces, parameter corpora of interfaces, etc. After acquiring the training samples, the data acquisition device 560 stores the acquired training samples in the database 530.
[0154] The training device 520 can train a model for generating test cases (such as the large model in the embodiments of the present application) based on the training samples maintained in the database 530 to obtain the large model.
[0155] It should be noted that in actual applications, the training samples maintained in the database 530 do not necessarily all come from the acquisition of the data acquisition device 560, and it is also possible to receive them from other devices. For example, the training samples maintained in the database 530 can also be uploaded by the customer device 540. Additionally, it should be noted that the training device 520 does not necessarily completely train the large model based on the training samples maintained in the database 530, and it is also possible to obtain training samples from the cloud or other devices for model training. The above description should not be regarded as a limitation to the embodiments of the present application.
[0156] The large model obtained according to the training device 520 can be applied to different systems or devices, such as applied to Figure 4 the execution device 510 shown in the figure. The execution device 510 can be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an augmented reality (AR) / virtual reality (VR) device, a vehicle-mounted terminal, etc., or it can also be a server, etc.
[0157] Specifically, the training device 520 can transfer the trained large model to the execution device 510.
[0158] In Figure 4 the execution device 510 is configured with an input / output (I / O) interface 512 for data interaction with external devices. The user can input the description information of the interface or other data to the I / O interface 512 through the customer device 540.
[0159] The preprocessing modules 513 and 514 are used to perform preprocessing according to the description information of the interface received by the I / O interface 512. It should be understood that there may be no preprocessing modules 513 and 514 or only one preprocessing module. When the preprocessing modules 513 and 514 do not exist, the computing module 511 can directly process the description information of the interface.
[0160] When the execution device 510 preprocesses the description information of the interface, or when the computing module 511 of the execution device 510 performs relevant processes such as computing, the execution device 510 can call the data, code, etc. in the data storage system 550 for corresponding processing, and can also store the data, instructions, etc. obtained from the corresponding processing into the data storage system 550.
[0161] Finally, the I / O interface 512 provides the processing result (such as the candidate test cases obtained based on the method provided in the embodiments of the present application, or the test result of the interface) to the client device 540, and thus to the user.
[0162] In Figure 4 In the system structure shown, the user can manually give the description information of the interface, and the "manually giving the description information of the interface" can be operated through the interface provided by the I / O interface 512. In another case, the client device 540 can automatically send the description information of the interface to the I / O interface 512. If the client device 540 is required to automatically send the description information of the interface and user authorization is required, the user can set the corresponding permissions in the client device 540. The user can view the results output by the execution device 510 in the client device 540, and the specific presentation form can be specific ways such as display, sound, action, etc. The client device 540 can also be used as a data collection end to collect the description information of the interface input to the I / O interface 512 and the output result of the output I / O interface 512 shown in the figure as new sample data, and store it in the database 530. Of course, it can also be collected without passing through the client device 540, but the I / O interface 512 directly uses the description information of the interface input to the I / O interface 512 and the output result of the output I / O interface 512 shown in the figure as new sample data and stores it in the database 530. Figure 4 The description information of the interface input to the I / O interface 512 and the output result of the output I / O interface 512 shown in the figure are stored in the database 530 as new sample data.
[0163] It should be noted that Figure 4 is only a schematic diagram of a system architecture provided by the embodiments of the present application, Figure 4 The positional relationship between the devices, components, modules, etc. shown does not constitute any limitation. For example, in Figure 4 In, the data storage system 550 is an external memory relative to the execution device 510. In other cases, the data storage system 550 can also be placed in the execution device 510. It should be understood that the above execution device 510 can be deployed in the client device 540.
[0164] From the perspective of model inference:
[0165] In the embodiments of the present application, the computing module 511 of the above execution device 510 can obtain the code stored in the data storage system 550 for model inference.
[0166] In the embodiments of the present application, the computing module 511 of the execution device 510 may include a hardware circuit (such as an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, etc.), or a combination of these hardware circuits. For example, the training device 520 may be a hardware system with the function of executing instructions, such as a CPU, a DSP, etc., or a hardware system without the function of executing instructions, such as an ASIC, an FPGA, etc., or a combination of the above hardware systems without the function of executing instructions and hardware systems with the function of executing instructions.
[0167] Specifically, the computing module 511 of the execution device 510 may be a hardware system with the function of executing instructions. The connection relationship prediction method provided in the embodiments of the present application may be software code stored in a memory. The computing module 511 of the execution device 510 may obtain the software code from the memory and execute the obtained software code to perform model inference.
[0168] It should be understood that the computing module 511 of the execution device 510 may be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps of model inference may also be implemented by the hardware system without the function of executing instructions in the computing module 511 of the execution device 510, which is not limited here.
[0169] From the perspective of model training:
[0170] In the embodiments of the present application, the above training device 520 may obtain the code stored in a memory ( Figure 4 not shown in the figure, which may be integrated with the training device 520 or deployed separately from the training device 520) to implement the steps related to interface testing in the embodiments of the present application.
[0171] In the embodiments of the present application, the training device 520 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors, or microcontrollers, etc.), or a combination of these hardware circuits. For example, the training device 520 may be a hardware system with the function of executing instructions, such as a CPU, a DSP, etc., or a hardware system without the function of executing instructions, such as an ASIC, an FPGA, etc., or a combination of the above-mentioned hardware systems without the function of executing instructions and hardware systems with the function of executing instructions.
[0172] It should be understood that the training device 520 may be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the neutralization interface test provided in the embodiments of the present application may also be implemented by the hardware system without the function of executing instructions in the training device 520, which is not limited here.
[0173] In the embodiments of the present application, the large model can be applied to the interface test scenario to perform interface recommendation tasks and test case generation tasks, and can also be applied to the product test scenario to perform test script generation tasks and software test tasks. Or it can also be applied to the product development scenario to perform code generation tasks, etc.
[0174] Combined with the above Figures 2 to 4 , the following will exemplarily illustrate the implementation manner of the interface test method provided by the present application in combination with Figures 5 to 14 .
[0175] In an alternative implementation manner, the cloud platform 10 provides users with multiple different types of interfaces, so that users can select corresponding application interfaces from multiple different types of interfaces for interface testing, thereby enabling the reuse of application interfaces and shortening the development duration of test cases, thus improving the test efficiency of application interfaces.
[0176] In an alternative embodiment, the different types of interfaces provided by the cloud platform 10 may be generated based on the interface expression structure data uploaded by the user.
[0177] In some examples, the interface expression structure data is used to provide one or more types of data in the request body, request path, request method, request parameters, and response body of the interface. In some implementation manners, the interface expression structure data can be carried by a YAML document. Among them, the request parameters are used to indicate the data carried by the request when the interface is called, so that the response end of the request can perform corresponding operations based on the data carried by the request. The embodiments of the present application do not limit the specific content of the request parameters. For example, the request parameters may include, but are not limited to: path parameters, request body parameters, header parameters, and form parameters.
[0178] After the cloud platform 10 receives the interface expression structure data, it generates an interface corresponding to the interface expression structure data by parsing the interface expression structure data. Exemplarily, taking the YAML document carrying the interface expression structure data as an example, the interface generation process is described exemplarily.
[0179] As Figure 5 shown, Figure 5 is a schematic flow chart of the interface testing method provided by the present application Figure 1 , and the shown interface testing method includes steps S510 to S550.
[0180] S510, the cloud platform 10 receives a YAML document.
[0181] In an alternative implementation manner, the YAML document can be uploaded by the user through the client 20.
[0182] For example, the cloud platform 10 provides an interface addition interface to the client 20, and the user uploads the YAML document by clicking a control in the interface addition interface.
[0183] Again, for example, the cloud platform 10 provides a document import interface to the client 20, and the client 20 uploads the YAML document to the cloud platform 10 by calling the document import interface.
[0184] Among them, the YAML document can be stored in the local memory of the device where the client 20 is located, and the client 20 uploads the YAML document by means of file upload.
[0185] Alternatively, the YAML document can also be stored in an external device (such as another cloud platform, code library, or other server), and the client 20 provides the access address of the YAML document to the cloud platform 10. The cloud platform 10 obtains the YAML document based on the access address.
[0186] In addition, in an alternative implementation manner, the YAML document can also be automatically generated by the cloud platform 10. For example, the cloud platform 10 automatically generates a YAML document with reference to the embodiments provided below Figure 13 provided.
[0187] The above two implementation manners are only different implementation manners for the cloud platform 10 to obtain the YAML document. In some other embodiments, there may be other implementation manners for the cloud platform 10 to obtain the YAML document, and the embodiments of the present application do not limit this.
[0188] S520, the cloud platform 10 parses the YAML document to form an interface.
[0189] In an alternative implementation manner, the cloud platform 10 parses the YAML document to obtain one or more of the request path, request method, request parameters, and response body of the interface carried by the YAML document. The cloud platform 10 forms an interface based on one or more of the request path, request method, request parameters, and response body of the interface.
[0190] For example, the cloud platform 10 pre-creates an initial interface, and the cloud platform 10 modifies the initial interface according to one or more of the request body, request path, request method, request parameters, and response body of the interface to form an interface.
[0191] For another example, the cloud platform 10 creates an interface according to one or more of the request body, request path, request method, request parameters, and response body of the interface.
[0192] In an alternative implementation manner, an interface library is stored in the cloud platform 10, and various different types of interfaces are stored in the interface library. Among them, the various different types of interfaces include interfaces generated based on the YAML document uploaded by the user, or interfaces formed by the YAML document generated by the cloud platform 10. After S520, the cloud platform 10 stores the formed interface in the interface library and updates the interface library.
[0193] In an alternative implementation manner, to facilitate the cloud platform 10 to recommend interface parameters to the client 20 subsequently, for any interface in the interface library, the cloud platform 10 can call a large model to convert the interface information and interface parameters of the interface into DSL corpus and write the DSL corpus into the knowledge base 130. In this way, by increasing the richness of the corpus in the knowledge base 130, the reliability of the output result of the large model can be improved.
[0194] Among them, any interface in the interface library can also be referred to as a third type of application interface, an interface to be converted, or other names, and the present application does not limit this.
[0195] Exemplarily, for any third type of application interface in the interface library of the cloud platform 10, the cloud platform 10 calls a large model to obtain the characteristics of the third type of interface, and calls the large model to convert the characteristics of the third type of application interface to obtain the DSL corpus of the third type of application interface. The cloud platform 10 writes the DSL corpus of the third type of application interface into the knowledge base 130.
[0196] Among them, the features of the third type of interface may include, but are not limited to: the interface name, interface request method, protocol, request body, checkpoint, and response extraction of the third type of application interface. Among them, the protocol is used to indicate the standard followed when the third type of application interface communicates, and the specific type of the protocol is not limited in the embodiments of the present application. For example, the protocol can be any one of the following: Hypertext Transfer (http / https) protocol, Representational State Transfer (REST) protocol, Message Queuing Telemetry Transport (MQTT) protocol, or WebSocket protocol.
[0197] In some alternative ways, the cloud platform 10 may refer to S821A below Figure 10 to obtain the features of the third type of interface and obtain the DSL corpus of the third type of application interface.
[0198] In addition, in some alternative ways, to ensure the accuracy of the DSL corpus in the knowledge base 130, the cloud platform 10 may also refer to S821A to S823A below Figure 10 to evaluate the initial DSL corpus of the third type of application interface output by the large model, and then obtain the DSL corpus of the third type of application interface.
[0199] In addition, in some alternative ways, the cloud platform 10 may also refer to S824 below to split the DSL corpus of the third type of application interface to obtain the first interface information corpus and the first interface parameter corpus. The cloud platform 10 writes the first interface information corpus and the first interface parameter corpus into the knowledge base 130. For example, the cloud platform 10 writes the first interface information corpus into the interface information knowledge base and writes the first interface parameter corpus into the interface parameter knowledge base.
[0200] S530, the cloud platform 10 provides the client 20 with multiple different types of interfaces.
[0201] In an alternative implementation manner, the cloud platform 10 may provide all the interfaces in the interface library to the client 20. For example, the cloud platform 10 provides an interface, and on this interface, there are multiple different types of interfaces in the interface library.
[0202] In some alternative embodiments, to facilitate the user to select the corresponding interface, the cloud platform 10 classifies the multiple different types of interfaces based on the service to which each interface belongs among the multiple different types of interfaces, and displays multiple services and one or more interfaces included in each service in the interface. As shown in Figure 6 Figure (a) below, the interface displays a menu area, a search area, and a content area.
[0203] Among them, the menu area displays the application service where the interface is located, such as Figure 6 as shown in Figure (a) of Figure 6 In the (a) figure of
[0204] The search area is used to provide an interface search function. For example, a search function by interface name (or service name), and for another example, a search function by interface function. As Figure 6 shown in Figure (a) of
[0205] The content area is used to display different types of interfaces. In some ways, different types of interfaces can be allocated and displayed according to the service name they belong to, such as Figure 6 shown in Figure (a) of
[0206] When the user clicks on the service directory, the cloud platform 10 provides fields for various different services in the interface. As Figure 6 shown in Figure (b) of Figure 6 In the content area shown in Figure (b) of Figure 6 AC attribute core service, XXX1 service, XXX2 service, and XXX3 service are displayed. When the user clicks on the field of any service, the identifier of one or more interfaces included in that service is displayed in the content area. As
[0207] shown in Figure (c) of
[0208] Among them, the user's needs can refer to interface requirement information, and this interface requirement information can include, but is not limited to: interface type, service name to which the interface belongs, functions implemented by the interface, etc.
[0209] In an alternative implementation, the cloud platform 10 can call the large model and refer to the following Figures 8 to 14In the provided embodiments, one or more interfaces that meet the user's requirements are selected from the interface library. This application will not be described in detail herein.
[0210] The embodiments of this application do not limit the execution order of S510 and S530.
[0211] In the first alternative implementation, before the cloud platform 10 provides multiple different types of interfaces, the cloud platform 10 forms interfaces by parsing the received YAML document based on the received YAML document. That is, S510 to S530 are executed in the order of S510 → S520 → S530.
[0212] For example, before the cloud platform 10 provides multiple different types of interfaces, the client 20 uploads a YAML document to the cloud platform 10.
[0213] For another example, before providing multiple different types of interfaces, the cloud platform 10 generates a YAML document.
[0214] In the second alternative implementation, after the cloud platform 10 provides multiple different types of interfaces, the cloud platform 10 obtains the YAML document and forms interfaces by parsing the YAML document. That is, S510 to S530 are executed in the order of S530 → S510 → S520.
[0215] For example, as Figure 6 shown in Figure (a) below, the cloud platform 10 provides multiple different types of interfaces through an interface, and an "Add" control is provided in the interface. The user uploads a YAML document to the cloud platform 10 by clicking the "Add" control.
[0216] For another example, after the cloud platform 10 provides multiple different types of interfaces to the client 20, the user chooses not to adopt the interfaces provided by the cloud platform 10. Based on the user's input operation, the cloud platform 10 regenerates a YAML document based on the user's requirements.
[0217] The above two alternative implementation manners are only different execution orders between S510 and S530. In other embodiments, the cloud platform 10 may also execute S510 to S530 in other orders, and the embodiments of this application do not limit this.
[0218] S540, the cloud platform 10, in response to the selection operation of the client 20, selects a first type of application interface from multiple different types of interfaces and obtains candidate test cases corresponding to the first type of application interface.
[0219] Among them, the first type of application interface may be an interface that needs to be tested for the interface.
[0220] The candidate test cases are used to generate test scripts for testing the first type of application interfaces, and include the interface information and interface parameters of the first type of application interfaces.
[0221] In an alternative implementation, the cloud platform 10 also stores the test cases corresponding to each of multiple different types of interfaces. After the user selects an interface, the cloud platform 10 uses the test case corresponding to the interface selected by the user as the candidate test case.
[0222] As described above Figure 6 As shown in figure (c) above, the cloud platform 10 provides multiple different types of interfaces in the interface. The user makes a selection operation based on the interface input. As Figure 6 shown in figure (d) therein, the user selects the XX1 interface. In response to the input selection operation, the cloud platform 10 uses the selected XX1 interface as the first type of application interface, and uses the test case corresponding to the XX1 interface as the candidate test case corresponding to the first type of application interface.
[0223] In another alternative implementation, the candidate test cases can be generated by the cloud platform 10 based on the interface parameters input by the user.
[0224] Exemplarily, after the user selects an interface, the cloud platform 10 provides a parameter input interface. The cloud platform 10 obtains the interface parameters input by the user based on the parameter input interface, and modifies the test case corresponding to the interface selected by the user according to the input interface parameters to obtain the candidate test cases.
[0225] Taking the user's selection of the XX1 interface in figure (c) above as an example, as Figure 6 shown in figure (c) therein, the cloud platform 10 provides an interface information interface as shown in figure (a) therein. The interface name XX1, interface type POST, initial interface parameters: checkpoint X1, response extraction Y1, and "parameter modification" control of the XX1 interface are displayed in the interface information interface. Figure 7 When the user clicks the "parameter modification" control, the cloud platform 10 provides a parameter input interface as shown in figure (b) therein. An interface keyword area and a parameter area are displayed in the parameter input interface. The interface information of interface XX1 is displayed in the interface keyword area. As Figure 7 shown in figure (b) therein, the following is displayed in the interface keyword area: request address: XXY / RRT, unique identifier: XX1Y; operation identifier: CCCX. The "request", "checkpoint", and "response extraction" fields of interface XXX, as well as the parameter names and corresponding values included in "request", "checkpoint", and "response extraction" respectively, are displayed in the parameter area. As
[0226] When the user clicks the "parameter modification" control, the cloud platform 10 provides a parameter input interface as shown in figure (b) therein. Figure 7 An interface keyword area and a parameter area are displayed in the parameter input interface. The interface information of interface XX1 is displayed in the interface keyword area. As Figure 7 shown in figure (b) therein, the following is displayed in the interface keyword area: request address: XXY / RRT, unique identifier: XX1Y; operation identifier: CCCX. The parameter area displays the "request", "checkpoint", and "response extraction" fields of interface XXX, as well as the parameter names and corresponding values included in "request", "checkpoint", and "response extraction" respectively. As Figure 7As shown in Figure (b), the parameters included in "Request" are displayed in the parameter area: Parameter 1: FFF, Parameter 2: FFFF, Parameter 3: YYY.
[0227] The user clicks on the parameter input box in the parameter area to input a modification operation. The cloud platform 10 responds to the modification operation and provides a parameter input interface as shown in Figure (c). Figure 7 Compared with the parameter input interface shown in Figure (b), in Figure (c), Parameter 1 in the parameter input interface is modified from FFF to YY. The user clicks on the "Confirm" control in the parameter input interface, and the cloud platform 10 modifies the test cases corresponding to the interface selected by the user based on the interface parameters displayed in the parameter input interface to obtain candidate test cases. Figure 7 In Figure (b), Figure 7 In Figure (c),
[0228] In addition, in an alternative implementation, the cloud platform 10 can also recommend the interface parameters of the first type of application interface to the client 20. After the user adopts the recommended interface parameters, the cloud platform 10 modifies the test cases corresponding to the interface selected by the user based on the recommended interface parameters to obtain candidate test cases. Specifically, reference can be made to the embodiments provided below. The embodiments of the present application will not be elaborated here. Figure 12 For the embodiments provided below, the embodiments of the present application will not be elaborated here.
[0229] The above three alternative implementation manners are only different implementation manners for the cloud platform 10 to obtain candidate test cases. In other embodiments, the cloud platform 10 can also adopt other implementation manners to obtain candidate test cases, and the present application does not limit this.
[0230] S550. The cloud platform 10 tests the first type of application interface based on the candidate test cases.
[0231] In an alternative implementation, after the cloud platform 10 obtains the candidate test cases, it performs interface testing. For example, the automated execution component 124 in the cloud platform 10 calls the automated factory, and the automated factory is used to execute the candidate test cases to test the first type of application interface, obtaining a test interface. The cloud platform 10 provides the test result to the client 20.
[0232] In addition, in some embodiments, the cloud platform 10 can provide the candidate test cases to the client 20. The user inputs a confirmation operation for interface testing based on the candidate test cases displayed on the client 20. The cloud platform 10 responds to the confirmation operation for interface testing and performs S550. Exemplarily, the cloud platform 10 can refer to the embodiments provided below. Figure 14 For the embodiments provided below, the embodiments of the present application will not be elaborated here.
[0233] Based on Figure 5In the provided embodiments, the cloud platform 10 generates interfaces by importing YAML documents to provide users with multiple different types of interfaces, enabling users to select corresponding application interfaces from multiple different types of interfaces for interface testing, thereby achieving the reuse of application interfaces and shortening the development duration of test cases, thus improving the testing efficiency of application interfaces.
[0234] The above Figures 5 to 7 takes the cloud platform 10 as the execution subject as an example to illustrate the interface testing method provided in this application. In some alternative implementation manners, the interface testing method provided in the embodiments of this application can also be executed by other computing devices. For example, the computing device may include, but is not limited to: servers, virtual servers, cloud services with code testing functions or code development functions, network services, computing nodes, or other electronic devices or clusters that can execute the interface testing method provided in the embodiments of this application.
[0235] In addition, the above Figures 5 to 7 takes the example that a user selects a first type of application interface from multiple interfaces provided by the cloud platform 10 to illustrate the interface testing method provided in this application. In other embodiments, the cloud platform 10 can call a large model to recommend a first type of application interface and candidate test cases for the first type of application interface according to the description information of the interface.
[0236] Next, in combination with Figures 8 to 14 , an exemplary description of the implementation manner in which the cloud platform 10 calls a large model to generate candidate test cases for the first type of application interface will be given.
[0237] Please refer to Figure 8 , Figure 8 which is a flowchart of the interface testing method provided in the embodiments of this application Figure 2 . This interface testing method includes steps S810 to S830.
[0238] S810, the cloud platform 10 obtains the description information of the first type of application interface.
[0239] In an alternative implementation manner, the description information may be uploaded by the user through the client 20.
[0240] Exemplarily, the cloud platform 10 provides an input interface for interface description information to the client 20. The user inputs the description information based on this input interface. The client 20 uploads the description information input by the user to the cloud platform 10.
[0241] As Figure 9 shown, the cloud platform 10 provides an input interface as shown in FIG. (a) in Figure 9 . An input box is displayed in this input interface. The user performs an input operation based on the input interface, and the cloud platform 10 responds to the input operation and provides asFigure 9 The input interface shown in Figure (b) in Figure 9 In Figure (b) in Figure 9 In Figure (b) in
[0242] Among them, the external interface for deleting a single label is used to indicate that the first type of application interface is an interface for deleting a single label.
[0243] In addition, in an alternative implementation, the description information can also be generated by the cloud platform 10 itself.
[0244] Exemplarily, the user selects the first type of application interface from multiple interfaces provided by the cloud platform 10. The cloud platform 10 generates description information based on the interface information and interface parameters of the first type of application interface.
[0245] The above two alternative implementation manners are only different implementation manners for the cloud platform 10 to obtain the description information. In other embodiments, the cloud platform 10 can also adopt other implementation manners to obtain the description information, which is not limited in the embodiments of the present application.
[0246] S820. The cloud platform 10 calls the large model to generate candidate test cases that match the description information.
[0247] In an alternative implementation, the cloud platform 10 can call the large model, use the description information as the input of the large model, and obtain the DSL corpus corresponding to the description information. The cloud platform 10 calls the large model to convert the DSL corpus to generate candidate test cases.
[0248] In an alternative embodiment, the cloud platform 10 can refer to the following Figures 10 to 11 provided embodiments to generate the DSL corpus corresponding to the description information. The embodiments of the present application will not be described in detail here.
[0249] In an alternative embodiment, the DSL corpus includes a candidate keyword corpus and a candidate interface parameter corpus. The cloud platform 10 calls the large model to convert the candidate keyword corpus into candidate keywords and convert the candidate interface parameter corpus into candidate interface parameters. The cloud platform 10 generates candidate test cases that match the description information based on the candidate keywords and candidate interface parameters.
[0250] For example, the cloud platform 10 can modify the test cases in the interface library that match the first type of application interface based on the candidate keywords and candidate interface parameters to obtain candidate test cases. For another example, the cloud platform 10 can call a large model, use the candidate keywords and candidate interface parameters as the input of the large model, and use the large model for content generation to obtain candidate test cases that match the description information.
[0251] In addition, in an alternative embodiment, after generating the candidate keywords and candidate interface parameters, the cloud platform 10 provides the candidate keywords and candidate interface parameters to the client 20. When the cloud platform 10 receives the user's adoption operation, the cloud platform 10 generates candidate test cases that match the description information based on the candidate keywords and candidate interface parameters. When the cloud platform 10 receives the user's modification operation, the cloud platform 10 generates candidate test cases in response to the modification operation.
[0252] Hereinafter, two examples are provided to illustrate the modification operation.
[0253] In the first alternative example, the modification operation may refer to modifying the candidate keywords or candidate interface parameters.
[0254] For example, the user modifies the candidate keywords or candidate interface parameters provided by the cloud platform 10. The cloud platform 10 generates candidate test cases based on the modified candidate keywords or modified candidate interface parameters. For another example, the modification operation instructs the cloud platform 10 to regenerate the candidate keywords and candidate interface parameters. In response to the modification operation, the cloud platform 10 executes S820 to generate new candidate keywords and new candidate interface parameters.
[0255] In the second alternative example, the modification operation may also refer to modifying the requirement information.
[0256] For example, the user modifies the requirement information. The cloud platform 10 executes the above S820 based on the modified requirement information to regenerate new candidate keywords and new candidate interface parameters.
[0257] The above two alternative examples are only alternative ways with different modification operations. In other embodiments, the modification operation may have other forms, which are not limited in the embodiments of the present application.
[0258] Among them, the modification operation is used to instruct the cloud platform 10 to adjust the candidate keywords and candidate interface parameters.
[0259] For example, the cloud platform 10 adjusts the requirement message based on the modification operation to form new requirement information. The cloud platform 10 calls a large model, uses the new requirement information as the input of the large model, and obtains new candidate keywords and new candidate interface parameters.
[0260] Exemplarily, such asFigure 9 As shown in Figure (c) in [reference], the cloud platform 10 provides an inference result interface, in which description information is displayed: the external interface deletes a single label, the interface name XX1 of the first type of application interface, the candidate keywords and candidate interface parameters of the first type of application interface, as well as an "Adopt" control and a "Modify" control. The user clicks the "Adopt" control to input an adoption operation. The user clicks the "Modify" control to input a modification operation.
[0261] In some optional examples, when the user clicks the "Modify" control, the cloud platform 10 provides a modification interface, in which requirement interface information, the candidate keywords and candidate interface parameters of the first type of application interface are displayed. The user can modify the requirement interface information, the candidate keywords and candidate interface parameters of the first type of application interface.
[0262] In other examples, when the user clicks the "Modify" control, the cloud platform 10 responds to the modification operation, executes S820 to generate new candidate keywords and new candidate interface parameters, and provides a new inference result interface. And in the new inference result interface, the requirement interface information is displayed: the external interface deletes a single label, the name XX2 of the first type of application interface, the new candidate keywords and new candidate interface parameters of the first type of application interface.
[0263] In addition, in an optional implementation manner, after the cloud platform 10 obtains the DSL corpus, the cloud platform 10 can generate candidate keywords and candidate interface parameters in sequence according to the distributed inference method, and generate candidate test cases that match the description information based on the candidate keywords and candidate interface parameters. Regarding the implementation manner of the distributed inference, reference can be made to the Figures 12 to 14 embodiments provided below, and the embodiments of the present application will not be described in detail herein.
[0264] S830, the cloud platform 10 tests the first type of application interface according to the candidate test cases.
[0265] In an optional implementation manner, after the cloud platform 10 generates the candidate test cases, the cloud platform 10 provides a Figure 9 result interface as shown in Figure (d) in [reference]. In this result interface, description information is displayed: the external interface deletes a single label, the interface name XX1 of the first type of application interface, and a "Test" control. The user clicks the "Test" control to input a confirmation operation for interface testing. The cloud platform 10 responds to the confirmation operation of interface testing and tests the first type of application interface according to the candidate test cases.
[0266] Based on Figure 8In the provided embodiment, during the interface testing process of the cloud platform 10, the process of using the large model to generate candidate test cases does not require manual coding. Instead, the test cases are generated by the machine, which can reduce the development time of the test cases. Moreover, the generated candidate test cases include the interface information and interface parameters of the first type of application interface. Thus, the large model is used to implement the interface parameter configuration, eliminating the need for manual interface parameter configuration, which can greatly shorten the development time of the test cases and improve the test efficiency of the application interface. In addition, the first type of application interface is included in different types of application interfaces provided by the cloud platform 10, enabling the reuse of application interfaces and test cases, and further improving the test efficiency of the application interface.
[0267] In an alternative implementation, the cloud platform 10 invokes the large model, uses the description information as the input of the large model, and obtains the DSL corpus corresponding to the description information. The cloud platform 10 invokes the large model to convert the DSL corpus and generate candidate test cases.
[0268] Regarding the implementation of the cloud platform 10 obtaining the DSL corpus, the following will be combined with Figures 10 to 11 for exemplary illustration.
[0269] In an alternative implementation, there are multiple ways for the cloud platform 10 to invoke the large model to generate the DSL corpus corresponding to the description information. For example:
[0270] In the first implementation, the cloud platform 10 invokes the large model for inference to generate a second DSL corpus that matches the description information.
[0271] In the second implementation, the platform 10 invokes the large model to query the knowledge base 130 and obtains the first DSL corpus that matches the description information from the knowledge base 130.
[0272] In the third implementation, the cloud platform 10 invokes the large model for inference to obtain an inference result. The cloud platform 10 invokes the large model for querying to obtain a query result. The cloud platform 10 obtains the DSL corpus based on the inference result and the query result. Among them, the inference result includes the second DSL corpus. The query result includes the first DSL corpus.
[0273] The above three implementation methods are only different implementation methods for the cloud platform 10 to generate the DSL corpus. In some other embodiments, the cloud platform 10 can also adopt other implementation methods to generate the DSL corpus, and the embodiments of the present application do not limit this.
[0274] Regarding the above first implementation method, the following will be combined with Figure 10 to exemplarily illustrate the implementation method of the cloud platform 10 invoking the large model to generate the DSL corpus through inference.
[0275] As Figure 10 shown,Figure 10 Flow diagram for generating DSL corpus provided by this application Figure 1 . The method for generating the DSL corpus shown includes:
[0276] S821A, the cloud platform 10 invokes a large model to convert the description information into a second initial DSL corpus.
[0277] In an alternative implementation, the above-mentioned corpus generation component 125 invokes a large model to convert the description information into a second initial DSL corpus. Alternatively, the above-mentioned DSL conversion module 31 invokes a large model to convert the description information into a second initial DSL corpus.
[0278] The following is an exemplary description of the implementation of the cloud platform 10 for converting description information to generate a DSL corpus.
[0279] In an alternative implementation, the cloud platform 10 can invoke a large model, use the description information as the input of the large model, and determine the DSL corpus output by the large model as the second initial DSL corpus.
[0280] In addition, in an alternative implementation, the cloud platform 10 invokes a large model to identify the description information and extract data features from the description information. The cloud platform 10 invokes a large model to convert the data features into a corpus to obtain a second initial corpus.
[0281] Among them, the data features may include but are not limited to API names, API request methods, protocols, request bodies, checkpoints, or response extraction, etc.
[0282] The above two alternative implementation manners are only different implementation manners for the cloud platform 10 to generate a DSL corpus. In other embodiments, the cloud platform 10 may adopt other implementation manners to generate a DSL corpus. For example, the cloud platform 10 converts the description information into a JSON description language, uses the JSON description language as the input of the large model, and uses the large model to perform feature extraction and feature conversion on the JSON description language to obtain the second initial DSL corpus output by the large model. Another example is that the cloud platform 10 forms prompt information based on the description information, and the cloud platform 10 uses the prompt information as the input of the large model to obtain the output second initial DSL corpus. The embodiments of this application do not limit this.
[0283] Among them, the prompt information is used to guide the large model to generate the second initial DSL corpus. In the embodiments of the present application, the prompt information may include background input and task instructions. Among them, the background input is used to provide the requirement information of the first type of application interface (for example, the function implemented by the interface, the interface type, or the protocol of the interface, etc.), and the task instruction is used to indicate the operation that the large model needs to perform. For example, taking the description information as "delete a single label for the external interface" as an example, the background input in the prompt information is "1. Requirement 1 [external interface]; 2. Requirement 2 [delete a single label];", and the task instruction is "generate DSL corpus according to the above requirements".
[0284] S822A, the cloud platform 10 evaluates the second initial DSL corpus. When the second initial DSL corpus meets the first requirement, the cloud platform 10 determines the second initial DSL corpus as the second DSL corpus.
[0285] In an alternative implementation, the cloud platform 10 may evaluate the second initial DSL corpus based on the description information to determine whether the generated second initial DSL corpus includes all the requirements of the description information. The corresponding first requirement may indicate the requirements indicated by the description information. For example, taking the requirements indicated by the requirement information including Requirement 1 [external interface] and Requirement 2 [delete a single label] as an example, the first requirement includes the external interface and deleting a single label.
[0286] For example, the cloud platform 10 may call the large model, use the description information and the second initial DSL corpus as the input of the large model, and use the large model to determine whether the generated second initial DSL corpus includes all the requirements of the description information. When the output result of the large model indicates that the second initial DSL corpus includes all the requirements of the description information, the cloud platform 10 determines that the second initial DSL corpus meets the first requirement. When the output result of the large model indicates that the second initial DSL corpus does not include all the requirements of the description information, the cloud platform 10 determines that the second initial DSL corpus does not meet the first requirement.
[0287] For another example, the cloud platform 10 may call the large model to extract the actual requirements of the second initial DSL corpus. Compare the actual requirements with the requirements indicated by the description information. If the actual requirements are consistent with the requirements indicated by the description information, the cloud platform 10 determines that the second initial DSL corpus meets the first requirement. If the actual requirements are inconsistent with the requirements indicated by the description information, the cloud platform 10 determines that the second initial DSL corpus does not meet the first requirement.
[0288] In addition, in an alternative implementation, the cloud platform 10 may evaluate the second initial DSL corpus based on all the data characteristics of the requirement information. Correspondingly, the first requirement may indicate the data characteristics of the description information. For example, the first requirement includes one or more of the API name, API request method, protocol, request body, checkpoint, or response extraction.
[0289] For example, the cloud platform 10 determines whether the second initial DSL corpus contains all the data characteristics of the requirement information. If the second initial DSL corpus contains all the data characteristics of the requirement information, the cloud platform 10 determines that the second initial DSL corpus meets the first requirement. If the second initial DSL corpus does not contain all the data characteristics of the requirement information, the cloud platform 10 determines that the second initial DSL corpus does not meet the first requirement.
[0290] The above two alternative implementations are only different implementation manners for the cloud platform 10 to evaluate the second initial DSL corpus. In some other embodiments, the cloud platform 10 may also adopt other implementation manners to evaluate the second initial DSL corpus. For example, the cloud platform 10 may evaluate the second initial DSL corpus based on the business scenario. Correspondingly, the first requirement may include the input and output matching of the interface. This application embodiment will not elaborate on this.
[0291] S823A, when the second initial DSL corpus does not meet the first requirement, the cloud platform 10 corrects the second initial DSL corpus to obtain the second DSL corpus.
[0292] In an alternative implementation, the cloud platform 10 correcting the second initial DSL corpus may be the cloud platform 10 modifying the second initial DSL corpus.
[0293] In the first alternative example, the first requirement indicates the requirement indicated by the description information. When the second initial DSL corpus does not meet the first requirement, the cloud platform 10 modifies the second initial DSL corpus according to the first requirement in the description information that is not included in the second initial DSL corpus to obtain the second DSL corpus. For example, the cloud platform 10 calls the large model, uses the second initial DSL corpus and the requirements in the description information that are not included in the second initial DSL corpus as the input of the large model, and uses the large model to modify the second initial DSL corpus to obtain the second DSL corpus.
[0294] In a second alternative example, the first requirement indicates the data characteristics of the description information. In the case where the second initial DSL corpus does not meet the first requirement, the cloud platform 10 modifies the second initial DSL corpus according to the first data characteristics of the requirement information not included in the second initial DSL corpus to obtain the second DSL corpus. For example, the cloud platform 10 invokes a large model, takes the second initial DSL corpus and the first data characteristics as the input of the large model, and uses the large model to modify the second initial DSL corpus to obtain the second DSL corpus.
[0295] The above two alternative examples illustrate the implementation manner of the cloud platform 10 to correct the second initial DSL corpus by taking the cloud platform 10 modifying the second initial DSL corpus as an example. In some other embodiments, the cloud platform 10 can also correct the second initial DSL corpus by regenerating the DSL corpus.
[0296] Exemplarily, the cloud platform 10 can execute the above S821A again to regenerate a new second initial DSL corpus. In the case where the new second initial DSL corpus meets the first requirement, the cloud platform 10 takes the new second initial DSL corpus as the second DSL corpus. In the case where the new second initial DSL corpus does not meet the first requirement, the cloud platform 10 executes S821A again until the latest generated second initial DSL corpus meets the first requirement, and determines the second initial DSL corpus that meets the first requirement as the second DSL corpus.
[0297] Based on Figure 10 the provided embodiments, during the process of the cloud platform 10 obtaining the second DSL corpus through reasoning, the cloud platform 10 evaluates the second initial DSL corpus obtained by reasoning based on the large model to ensure the reliability of the finally generated second DSL corpus, and further ensure the reliability and accuracy of the finally generated candidate test cases.
[0298] The above Figure 10 illustrates the implementation manner of the cloud platform 10 to generate the DSL corpus by taking the cloud platform 10 obtaining the DSL corpus through reasoning based on the large model as an example. Additionally, in some embodiments, the cloud platform 10 can also obtain the DSL corpus by querying the knowledge base 130.
[0299] Hereinafter, an exemplary description of the implementation manner of the cloud platform 10 to obtain the DSL corpus by querying the knowledge base 130 is given.
[0300] In an alternative implementation, the cloud platform 10 queries the knowledge base 130 according to the requirement information, and obtains the first candidate interface parameter corpus that matches the requirement information and the first candidate interface information corpus that matches the description information from the knowledge base 130. The cloud platform 10 uses the first candidate interface parameter corpus and the first candidate interface information corpus as the first DSL corpus. In this way, the DSL corpus can be quickly obtained by querying the knowledge base 130, improving the efficiency of the cloud platform 10 in generating the DSL corpus, and further shortening the time for the cloud platform 10 to generate candidate test cases. Therefore, the interface test efficiency is improved.
[0301] For example, the cloud platform 10 calls a large model, uses the requirement information as the input of the large model, and uses the large model to query the knowledge base 130 to obtain the first candidate interface parameter corpus and the first candidate interface information corpus.
[0302] For another example, the cloud platform 10 refers to the above S821A to obtain the data characteristics of the requirement information. Taking the data characteristics as the input of the large model, the cloud platform 10 uses the large model to query the knowledge base 130 to obtain the first candidate interface parameter corpus and the first candidate interface information corpus.
[0303] In addition, in some embodiments, to improve the adoption rate of candidate test cases by users, the cloud platform 10 can also generate a DSL corpus based on the inference result of the large model and the query result of the large model.
[0304] Next, Figure 11 an exemplary description will be given of the implementation manner in which the cloud platform 10 generates a DSL corpus based on the inference result and the query result.
[0305] As Figure 11 shown, Figure 11 the flowchart of generating a DSL corpus provided by this application is Figure 2 . The method for generating a DSL corpus shown includes:
[0306] S821B. The cloud platform 10 calls a large model to infer the description information and obtains a second DSL corpus.
[0307] In an alternative implementation, the cloud platform 10 can refer to the Figure 10 embodiments provided above for inference to obtain a second DSL corpus.
[0308] S822B. The cloud platform 10 calls a large model to query the knowledge base 130 and obtains a first DSL corpus that matches the description information.
[0309] The embodiments of this application do not limit the execution order of the above S821B and S822B.
[0310] In the first alternative example, the cloud platform 10 may execute S821B and S822B in the order of S821B→S822B.
[0311] In the second alternative example, the cloud platform 10 may also execute S821B and S822B in the order of S822B→S821B.
[0312] In the third alternative example, the cloud platform 10 may also execute S821B and S822B concurrently. After the cloud platform 10 obtains the first DSL corpus and the second DSL corpus, the cloud platform 10 executes the following S823B.
[0313] S823B, the cloud platform 10 obtains the DSL corpus corresponding to the description information based on the first DSL corpus and the second DSL corpus.
[0314] In the first alternative implementation, the cloud platform 10 may splice the first DSL corpus and the second DSL corpus as the DSL corpus corresponding to the description information.
[0315] For example, the cloud platform 10 splices the first DSL corpus and the second DSL corpus in a head-to-tail splicing manner to obtain the spliced DSL corpus, and the cloud platform 10 uses the spliced DSL corpus as the DSL corpus corresponding to the description information.
[0316] In the second alternative implementation, the cloud platform 10 may remove duplicates from the first DSL corpus and the second DSL corpus, and use the deduplicated DSL corpus as the DSL corpus corresponding to the description information.
[0317] In the third alternative implementation, the cloud platform 10 may compare the first DSL corpus and the second DSL corpus. When the first DSL corpus and the second DSL corpus are the same, the cloud platform 10 uses the first DSL corpus or the second DSL corpus as the DSL corpus corresponding to the description information. When the first DSL corpus and the second DSL corpus are different, the cloud platform 10 corrects the second DSL corpus based on the first DSL corpus to obtain the DSL corpus corresponding to the description information. Or the cloud platform 10 corrects the first DSL corpus based on the second DSL corpus to obtain the DSL corpus corresponding to the description information. So that the DSL corpus corresponding to the description information can contain the content in both the first DSL corpus and the second DSL corpus.
[0318] The above three alternative implementations are only different alternative ways for the cloud platform 10 to execute S823B. In some other embodiments, S823B may have other alternative ways, which are not limited in the embodiments of the present application.
[0319] Based on Figure 11In the provided embodiments, the cloud platform 10 utilizes the query results and inference results of the large model to obtain the DSL corpus corresponding to the description information. In this way, by enhancing the reliability of the DSL corpus corresponding to the description information, the reliability of the finally generated candidate test cases is ensured.
[0320] In an alternative implementation, to enhance the reliability of the candidate test cases and increase the adoption rate of the candidate test cases by users, after obtaining the DSL corpus corresponding to the description information, the cloud platform 10 sequentially provides the candidate interface keywords and candidate interface parameters to the user in a segmented inference manner, thereby generating candidate test cases.
[0321] The following combines Figure 12 to exemplarily illustrate the implementation manner of the segmented inference of the cloud platform 10.
[0322] As Figure 12 shown, Figure 12 is a schematic flowchart of generating candidate test cases provided by this application. The method for generating candidate test cases shown includes steps S824 to S828.
[0323] S824, the cloud platform 10 calls the large model, uses the DSL corpus as the input of the large model, and obtains candidate interface keywords.
[0324] In an alternative implementation, the DSL corpus may refer to the above-mentioned first DSL corpus. Or the DSL corpus may also refer to the above-mentioned second DSL corpus. Or, the DSL corpus may also be the DSL corpus obtained by the cloud platform 10 referring to the Figure 11 embodiments provided. The specific form of the DSL corpus in the embodiments of this application is not limited.
[0325] In an alternative implementation, the cloud platform 10 may utilize the large model to convert the DSL corpus to obtain the candidate interface keywords output by the large model.
[0326] In an alternative embodiment, since the amount of data in the DSL corpus is large, the number of Tokens in the inference process of the large model is large, so the large model needs to spend a lot of time for inference, resulting in a long generation time for candidate test cases. And the large amount of data in the DSL corpus will make the Token length long. When the large model is inferring, restricted by the length threshold of the Token, the large model cannot use the complete Token for inference, resulting in errors in the final inference result. Based on this, after generating the DSL corpus, the cloud platform 10 splits the DSL corpus to obtain the first corpus and the second corpus. In this way, the cloud platform 10 uses the splitting of the DSL corpus to reduce the amount of data in a single corpus, thereby reducing the number of Tokens and the Token length. Thus, the inference duration of the large model can be shortened and the inference accuracy can be improved.
[0327] Among them, the first corpus is used to provide the basic information of the interface, such as the request method of the interface, the request address, the interface name, the interface identifier, etc. In some optional ways, the basic information of the interface can also be called interface information, and the first corpus can also be called interface information corpus, candidate interface information corpus or other names, which are not limited in the embodiments of the present application.
[0328] The second corpus is used to provide the parameter information of the interface, such as the request body, the protocol of the interface, the checkpoint, the response extraction, etc. In some optional ways, the parameter information of the interface can also be called interface parameters, and the second corpus can also be called interface parameter corpus, candidate interface parameter corpus or other names, which are not limited in the embodiments of the present application.
[0329] In an optional example, the cloud platform 10 can use both the first corpus and the second corpus as the input of the large model. Or, since the interface keyword is related to the basic information of the interface, the cloud platform 10 can also use the first corpus in the DSL corpus as the input of the large model.
[0330] In an optional example, the cloud platform 10 can split the DSL corpus based on the fields in the DSL corpus. For example, the content containing the "info" field is used as the first corpus. The content containing the "param" field is used as the second corpus.
[0331] In addition, in an optional example, when the DSL corpus is obtained by querying the knowledge base 130, the cloud platform 10 can use the first candidate interface parameter corpus as the second corpus and the first candidate interface information corpus as the first corpus.
[0332] The above mainly describes the form of the DSL corpus input to the large model. Next, an exemplary description will be given of the implementation manner in which the cloud platform 10 invokes the large model to generate candidate interface keywords.
[0333] In an optional implementation manner, the cloud platform 10 can use the output of the large model as the candidate interface keyword.
[0334] In addition, in an optional implementation manner, to improve the adoption rate of the candidate interface keywords, the cloud platform 10 can match the output of the large model based on the DSL corpus with all the interfaces in the above interface library, obtain the interface information in the interface library that matches the output of the large model, and fit the interface information with the output of the large model to obtain the candidate interface keywords. In this way, by fitting the output of the large model with the real interfaces in the interface library, the reliability of the candidate interface keywords is improved, and thus the adoption rate of the candidate interface keywords is improved.
[0335] As Figure 13 shown, Figure 13A schematic flowchart of the process for obtaining candidate interface keywords provided by this application. The method for obtaining candidate interface keywords shown includes: S8241 to S8245.
[0336] S8241, the cloud platform 10 invokes a large model for inference based on the DSL corpus to obtain initial interface keywords.
[0337] In an alternative implementation, the cloud platform 10 invokes the large model to use the first corpus in the DSL corpus as the input of the large model to obtain initial interface keywords. Or the cloud platform 10 invokes the large model to use the first corpus and the second corpus in the DSL corpus as the input of the large model to obtain initial interface keywords.
[0338] S8242, the cloud platform 10 matches the initial interface keywords with different types of application interfaces. When there is a first application interface among different types of application interfaces, the cloud platform 10 fits the interface information of the first application interface with the initial interface keywords to obtain candidate interface keywords.
[0339] In the first alternative implementation, the cloud platform 10 uses the initial interface keywords as query information and obtains the first application interface by means of exact matching. Correspondingly, the first application interface is the application interface in the different types of application interfaces provided by the interface library whose interface information exactly matches the initial interface keywords.
[0340] Among them, exact matching can be that the initial interface keywords are the same as the interface information. For example, taking the initial interface keywords as the request address XXX / XXYI, the request method as http PSOT, the request name as deleteontage, and the request body as JSON, the application interface in the interface information of multiple different types of application interfaces with the request address XXX / XXYI, the request method httpPSOT, the request name deleteontage, and the request body JSON is used as the first application interface.
[0341] In the second alternative implementation, the cloud platform 10 can also obtain the first application interface by means of fuzzy matching. Correspondingly, the first application interface is the application interface in the different types of application interfaces provided by the interface library whose interface information is fuzzily matched with the initial interface keywords.
[0342] Among them, fuzzy matching can be that the similarity between the initial interface keywords and the interface information is greater than the similarity threshold.
[0343] Exemplarily, the cloud platform 10 can obtain the similarity by calculating the distance between the initial interface keywords and the interface information. Or, the cloud platform 10 can also calculate the phonetic similarity or semantic similarity between the initial interface keywords and the interface information to obtain the similarity.
[0344] The embodiments of the present application do not limit the specific value of the similarity threshold, and the value of the similarity threshold can be set based on the specific application scenario.
[0345] In the third optional implementation manner, the cloud platform 10 can also obtain the first application interface by using a hybrid matching method.
[0346] Among them, the hybrid matching includes one or more of exact matching and fuzzy matching.
[0347] For example, the cloud platform 10 can query the interface library by using the exact matching method. When there is an application interface that exactly matches the initial interface keyword, the application interface that exactly matches the initial interface keyword is used as the first application interface, and the matching is stopped. When there is no application interface that exactly matches the initial interface keyword, the cloud platform 10 uses the fuzzy matching method to query the interface library. When there is an application interface that fuzzily matches the initial interface keyword, the application interface that fuzzily matches the initial interface keyword is used as the first application interface. If there is no application interface that fuzzily matches the initial interface keyword, the cloud platform 10 can refer to S8243 to S8245 below to obtain candidate interface keywords.
[0348] The above three optional implementation manners are only different matching methods for the cloud platform 10 to obtain the first application interface. In other embodiments, the cloud platform 10 can also use other matching methods to obtain the first application interface, and the embodiments of the present application do not limit this.
[0349] Next, an exemplary description will be given of the implementation manner in which the cloud platform 10 fits the interface information of the first application interface with the initial interface keyword.
[0350] In the first optional implementation manner, the cloud platform 10 can refer to the interface information of the first application interface and adjust the format of the initial interface keyword to obtain candidate interface keywords.
[0351] In the second optional implementation manner, the cloud platform 10 can also refer to the interface information of the first application interface and perform data cleaning on the initial interface keyword to obtain candidate interface keywords. Among them, data cleaning includes data denoising or missing value supplementation.
[0352] In the third optional implementation manner, the cloud platform 10 can also modify the interface information of the first application interface according to the initial interface keyword, and use the modified interface information of the first application interface as candidate interface keywords.
[0353] In the fourth optional implementation manner, the cloud platform 10 can also use the interface information of the first application interface as candidate interface keywords.
[0354] The above four alternative implementation manners are only the implementation manners in which the interface information of the first application interface fitted by the cloud platform 10 is different from the initial interface keyword. In some other embodiments, the cloud platform 10 may also adopt other implementation manners to fit the interface information of the first application interface and the initial interface keyword. The embodiments of the present application do not limit this.
[0355] S8243. When the first application interface does not exist in different types of application interfaces, the cloud platform 10 calls the large model to obtain a YAML document.
[0356] In an alternative implementation manner, "the first application interface does not exist in different types of application interfaces" may mean that there is no application interface that precisely matches the initial interface keyword in different types of application interfaces, or there is no application interface that fuzzily matches the initial interface keyword in different types of application interfaces, or there is no application interface that precisely matches and does not fuzzily match the initial interface keyword in different types of application interfaces.
[0357] Among them, the YAML document is used to indicate: the request path, request method, request parameters, and response body of the interface.
[0358] In an alternative implementation manner, the cloud platform 10 may call the large model, use the DSL corpus as the input of the large model, and utilize the large model to simulate and generate a YAML document. For example, the cloud platform 10 uses the DSL corpus as the background input, generates a prompt message, inputs the prompt message into the large model, and obtains the YAML document output by the large model.
[0359] Among them, the prompt message includes: background input: DSL corpus; task instruction: analyze and sort out according to the DSL corpus, and simulate and generate a YAML document.
[0360] In addition, in an alternative implementation manner, the cloud platform 10 may call the large model, use the initial interface keyword as the input of the large model, and utilize the large model to simulate and generate a YAML document.
[0361] The above two alternative implementation manners are only the implementation manners in which the cloud platform 10 generates different YAML documents. In some other embodiments, the cloud platform 10 may also adopt other implementation manners to simulate and generate a YAML document. The embodiments of the present application do not limit this.
[0362] S8244. The cloud platform 10 generates a second type of application interface based on the YAML document.
[0363] Among them, the second type of application interface matches the initial interface keyword.
[0364] In an alternative implementation, the cloud platform 10 may generate a second type of application interface with reference to the above S520. Details are not described herein in the embodiments of the present application.
[0365] S8245. The cloud platform 10 fits the interface information of the second type of application interface with the initial interface keyword to obtain a candidate interface keyword.
[0366] In an alternative implementation, the cloud platform 10 may fit the interface information of the second type of application interface with the initial interface keyword with reference to the above S8242. Details are not described herein in the embodiments of the present application.
[0367] Based on Figure 13 the provided embodiments, the cloud platform 10 uses a multi-level matching mechanism to obtain the real interface information that matches the output of the large model. And based on the fitting of the real interface information and the output of the large model, the reliability of the final candidate interface keyword is improved, thereby enhancing the adoption rate of the candidate interface keyword.
[0368] S825. The cloud platform 10 provides the candidate interface keyword to the client 20.
[0369] In an alternative implementation, the cloud platform 10 may provide the candidate interface keyword to the client 20 in the form of an interface. As Figure 14 shown, the cloud platform 10 provides a first interface as shown in FIG. (a) in Figure 14 . The first interface displays the candidate interface keyword: interface name XX1, request address XXY / RRT, unique identifier XXIY, operation identifier CCCX, and "Modify" control, "Adopt" control.
[0370] S826. In response to the first adoption operation, the cloud platform 10 calls the large model and uses the candidate interface keyword and the DSL corpus as the input of the large model to obtain candidate interface parameters.
[0371] In an alternative implementation, the first adoption operation is used to indicate that the user adopts the candidate interface keyword. In some alternative ways, the first adoption operation may also be referred to as the first operation, confirmation operation, or other names. The embodiments of the present application do not limit this.
[0372] Among them, the first adoption operation may be a contact operation, such as touch operations like tapping, long-pressing, swiping, double-tapping, or clicking on a control in the interface. Or, the first adoption operation may also be a non-contact operation, such as gesture input, physical button, voice input, etc. Or, the first adoption operation may also be a typing operation, such as typing operation through a mouse or typing operation through a keyboard.
[0373] With the above Figure 14Taking Figure (a) in the figure as an example, the user can click the "Adopt" control to enter the first adoption operation.
[0374] In an optional implementation, the cloud platform 10 calls the big model, takes the candidate interface keywords and DSL corpus as inputs of the big model, uses the big model to perform interface parameter reasoning, and takes the output results of the big model as candidate interface parameters.
[0375] In addition, in an optional implementation, the cloud platform 10 may also refer to the above Figure 13 The provided embodiment obtains candidate interface parameters.
[0376] In one example, the cloud platform 10 calls the big model, takes the candidate interface keywords and DSL corpus as the input of the big model, uses the big model to perform interface parameter reasoning, and obtains the initial interface parameters output by the big model. The cloud platform 10 fits the interface parameters of the first application interface in the interface library with the initial interface parameters to obtain the candidate interface parameters.
[0377] In another example, after obtaining the initial interface parameters output by the large model, the cloud platform 10 queries the interface library for an interface that matches the initial interface parameters. The cloud platform 10 fits the interface parameters of the interface with the initial interface parameters to obtain candidate interface parameters.
[0378] S827, the cloud platform 10 provides candidate interface parameters to the client 20.
[0379] In an optional implementation, the cloud platform 10 may provide the candidate interface parameters to the client 20 by means of an interface.
[0380] As mentioned above Figure 14 As shown in Figure (a), after the user clicks the "Adopt" control to enter the first adoption operation, the cloud platform 10 responds to the first adoption operation and provides Figure 14 The second interface shown in Figure (b) of FIG. The second interface includes candidate interface keywords: interface name XX1, request address XXY / RRT, unique identifier XXIY, operation identifier CCCX, candidate interface parameters: parameter 1: FFF, parameter 2: FFFF, parameter 3: YYY, "Modify" control, and "Adopt" control.
[0381] S828, the cloud platform 10 generates a candidate test case based on the candidate interface keywords and the candidate interface parameters in response to the second adoption operation.
[0382] In an optional implementation, the cloud platform 10 may refer to the above S540 to generate candidate test cases.
[0383] For example, the cloud platform 10 fills the candidate interface keywords and candidate interface parameters into the test cases of the first application interface to generate candidate test cases.
[0384] For another example, the cloud platform 10 can also obtain a test case template, and the cloud platform 10 fills the candidate interface keywords and candidate interface parameters into the trial case template to generate candidate test cases.
[0385] In some alternative ways, the second adoption operation can also be referred to as the second operation, confirmation operation, parameter confirmation operation, or other names, etc., and the embodiments of the present application do not limit this.
[0386] Similar to the above first adoption operation, the second adoption operation can also be a contact operation, non-contact operation, or typing operation.
[0387] As Figure 14 shown in figure (b) of Figure 14 , the user clicks the "Adopt" control in the second interface to input the second adoption operation. The cloud platform 10 responds to the second adoption operation and provides a third interface as shown in figure (c) of
[0388] . The third interface includes the interface name XX1 of the first type of application interface, candidate test cases, the "Details" control of the candidate test cases, as well as the "Test" control and the "Cancel" control. The user can click the "Details" control to view the specific content of the candidate test cases. The user can click the "Test" control to input the third operation. The cloud platform 10 responds to the third operation and tests the first type of application interface based on the candidate test cases.
[0389] Among them, the third operation can also be referred to as the confirmation operation of interface testing, test confirmation operation, or other names.
[0389] Based on Figure 12 the embodiments provided, the cloud platform 10 sequentially provides the candidate interface keywords and candidate interface parameters to the user in a segmented reasoning manner to generate candidate test cases. Moreover, after the user adopts the candidate interface keywords, the candidate interface parameters are obtained by reasoning with the large model. In this way, the reliability of the candidate interface keywords and candidate interface parameters can be improved. Furthermore, the reliability of the candidate test cases can be improved.
[0390] In an alternative implementation manner, when the first application interface does not exist in the interface library, after the cloud platform 10 generates the second type of application interface, the cloud platform 10 can add the second type of application interface to the interface library and add the DSL corpus generated by the large model to the knowledge base 130. Thereby improving the interface types and the number of interfaces in the interface library.
[0391] In addition, in some embodiments, after the cloud platform 10 provides candidate test cases to the client 20, the user may not adopt the candidate test cases, and the cloud platform 10 regenerates candidate test cases.
[0392] For example, a "Modify" control may also be displayed in the third interface described above. When the user clicks the "Modify" control to input a non-adoption operation, the cloud platform 10 performs the non-adoption operation and re-executes the above S810 to S820 to generate new candidate test cases.
[0393] To implement the functions of the above embodiments, the cloud platform 10 includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and method steps of each example described in the embodiments disclosed in the present application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application scenarios and design constraints of the technical solution.
[0394] The above Figures 2 to 14 has described in detail the interface testing system, method, and device provided by the present application. In other embodiments, the present application further provides an interface testing device 15, and the interface testing device 15 may have a structure different from that of the interface testing device 120 shown in the above Figure 2 or Figure 3 .
[0395] For example, as Figure 15 shown, the interface testing device 15 includes a storage module 153, a processing module 152, and a communication module 151.
[0396] Among them, the storage module 153 is used to store executable computer programs and data during the interface testing of the interface testing device, such as different types of application interfaces, DSL corpora of different application interfaces, etc.
[0397] The communication module 151 is used to obtain the description information of the first type of application interface.
[0398] The processing module 152 is used to execute the executable computer program, call the large model to generate candidate test cases matching the description information, and test the first type of application interface according to the candidate test cases.
[0399] Optionally, the large model is used to generate different DSL corpora according to the description information of different types of application interfaces, and generate different test cases based on different DSL corpora; the different types of application interfaces include the first type of application interface; the candidate test cases include the first type of application interface, the interface information of the first type of application interface, and interface parameters.
[0400] Among them, the communication module 151, the processing module 152, and the storage module 153 can be implemented by software or by hardware. Exemplarily, next, taking the processing module 152 as an example, the implementation manner of the processing module 152 will be introduced. Similarly, the communication module 151 and the storage module 153 can refer to the implementation manner of the processing module 152.
[0401] As an example of a software functional unit, the processing module 152 can include code running on a computing instance. Among them, the computing instance can include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above computing instance can be one or more. For example, the processing module 152 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the code can be distributed in the same region, or can be distributed in different regions. Further, the multiple hosts / virtual machines / containers for running the code can be distributed in the same availability zone (AZ), or can be distributed in different AZs. Each AZ includes one data center or multiple geographically proximate data centers. Among them, generally one region can include multiple AZs.
[0402] Similarly, the multiple hosts / virtual machines / containers for running the code can be distributed in the same virtual private cloud (VPC), or can be distributed in multiple VPCs. Among them, generally one VPC is set within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is realized through the communication gateway.
[0403] As an example of a hardware functional unit, the processing module 152 can include at least one computing device, such as a server, etc. Or, the processing module 152 can also be a device implemented by an application-specific integrated circuit (ASIC), or a programmable logic device (PLD). Among them, the above PLD can be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0404] The multiple computing devices included in the processing module 152 can be distributed in the same region or in different regions. The multiple computing devices included in the communication module 151 can be distributed in the same availability zone (AZ) or in different AZs. Similarly, the multiple computing devices included in the processing module 152 can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, the multiple computing devices can be any combination of computing devices such as servers, application-specific integrated circuits (ASICs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), and generic array logic (GALs).
[0405] It should be noted that in other embodiments, the processing module 152 can be used to execute any step in the interface test method. The communication module 151 can be used to execute any step in the interface test method. The storage module 153 can be used to execute any step in the interface test method. The communication module 151, the processing module 152, and the storage module 153 can be used to execute any step in the interface test method. The steps to be implemented by the communication module 151, the processing module 152, and the storage module 153 can be specified as needed. The entire function of the interface test apparatus 15 is realized by implementing different steps in the interface test method through the communication module 151, the processing module 152, and the storage module 153 respectively.
[0406] The embodiment of the present application further provides a computing device for executing the above interface test method.
[0407] In one example, the computing device may include the Figure 15 interface test apparatus 15 as shown. The interface test apparatus 15 includes a communication module 151, a processing module 152, and a storage module 153.
[0408] In another example, as Figure 16 shown, the computing device 16 includes a bus 162, a processor 164, a memory 166, and a communication interface 168. The processor 164, the memory 166, and the communication interface 168 communicate with each other through the bus 162. The computing device 16 can be a server or a terminal device. It should be understood that the present application does not limit the number of the processor 164 and the memory 166 in the computing device 16.
[0409] The bus 162 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 16The bus 162 may include a path for transmitting information between various components of the computing device 16 (eg, the memory 166, the processor 164, and the communication interface 168).
[0410] The processor 164 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0411] In the present application, the processor 164 may execute the above Figure 8 The provided interface testing method includes, for example, obtaining description information of the first type of application interface, calling the large model to generate candidate test cases matching the description information, and testing the first type of application interface according to the candidate test cases.
[0412] The memory 166 may include a volatile memory, such as a random access memory (RAM). The processor 164 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0413] The memory 166 stores executable program codes, and the processor 164 executes the executable program codes to respectively implement the functions of the aforementioned communication module 151, processing module 152 and storage module 153, thereby implementing the interface testing method. That is, the memory 166 stores instructions for executing the interface testing method.
[0414] The communication interface 168 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 16 and other devices or a communication network.
[0415] The interface testing method disclosed in the above method embodiment may be applied to the processor 164, or implemented by the processor 164. The processor 164 may be an integrated circuit chip having a signal processor capability.
[0416] In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 164 or the instructions in the form of software. The above-mentioned processor 164 can be a general-purpose processor, including a CPU, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete electron tubes or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 166, and the processor 164 reads the information in the memory 166 and combines its hardware to complete the steps of the above method.
[0417] In a possible implementation manner, the processor 164 can also be used to execute the interface test method. For the specific implementation, reference can be made to the embodiments provided in the above interface test method, and the embodiments of the present application will not be elaborated herein.
[0418] In the embodiments of the present application, the chip system can be composed of chips or can also include chips and other discrete devices.
[0419] The embodiments of the present application also provide a computing device cluster 17 for executing the above interface test method.
[0420] In one example, the computing device cluster 17 can include, as Figure 15 shown, the interface test device 15. The interface test device 15 includes a communication module 151, a processing module 152 and a storage module 153.
[0421] In another example, as Figure 17 shown, the computing device cluster 17 includes at least one computing device 16 as Figure 16 shown. The computing device 16 includes: a bus 162, a processor 164, a memory 166 and a communication interface 168. The processor 164, the memory 166 and the communication interface 168 communicate with each other through the bus 162. The computing device 16 can be a server or a terminal device.
[0422] In a possible implementation manner, one or more computing devices in the computing device cluster 17 can be connected through a network. Among them, the network can be a wide area network or a local area network, etc. Figure 18A possible implementation is shown. As Figure 18 shown, the computing device 16A and the computing device 16B are connected via a network. Specifically, they are connected to the network through the communication interfaces in each computing device. In this type of possible implementation, the memory 166 in the computing device 16A stores instructions for performing the functions of the communication module 151. At the same time, the memory 166 in the computing device 16B stores instructions for performing the functions of the processing module 152 and the storage module 153.
[0423] Figure 18 Regarding the connection method between the computing device clusters shown, considering the interface testing method provided in this application, during the interface testing process, large model calls and candidate test case generation are involved, and a large amount of data needs to be processed. Therefore, it is considered that the functions implemented by the processing module 152 and the storage module 153 are executed by the computing device 16B, and the functions implemented by the communication module 151 are executed by the computing device 16A.
[0424] It should be understood that Figure 18 the functions of the computing device 16A shown in
[0425] can also be completed by multiple computing devices 16. Similarly, the functions of the computing device 16B can also be completed by multiple computing devices 16.
[0426] For example, when the computer program product runs on at least one computing device, it causes at least one computing device to execute Figure 8 the interface testing method shown.
[0427] The embodiments of the present application also provide a computer-readable storage medium. All or part of the processes in the above method embodiments can be completed by a computer program instructing relevant hardware. This program can be stored in the above computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be the terminal in any of the foregoing embodiments, such as an internal storage unit including a data transmission end and / or a data reception end, such as the hard disk or memory of the terminal. The above computer-readable storage medium can also be an external storage device of the above terminal, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the above terminal. Further, the above computer-readable storage medium can also include both the internal storage unit and the external storage device of the above terminal. The above computer-readable storage medium is used to store the above computer program and other programs and data required by the above terminal. The above computer-readable storage medium can also be used to temporarily store the data that has been output or will be output.
[0428] It should be noted that the terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0429] It should be understood that in the present application, "at least one (item)" means one or more, "a plurality" means two or more, "at least two (items)" means two or three or more, and "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (item) of the following" or its similar expression means any combination of these items, including any combination of single item (s) or plural item (s). For example, at least one (item) of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0430] It should be understood that in the embodiments of the present application, "B corresponding to A" means that B is associated with A. For example, B can be determined according to A. It should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information. In addition, the "connection" that appears in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not make any limitations on this.
[0431] In the embodiments of the present application, unless otherwise specified, the "transmission" (transmit / transmission) refers to two-way transmission, including the actions of sending and / or receiving. Specifically, the "transmission" in the embodiments of the present application includes the sending of data, the receiving of data, or the sending and receiving of data. Or rather, the data transmission here includes uplink and / or downlink data transmission. The data can include channels and / or signals. The uplink data transmission is the uplink channel and / or uplink signal transmission, and the downlink data transmission is the downlink channel and / or downlink signal transmission.
[0432] The above are only the specific implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An interface testing method, characterized in that: The method is applied to a cloud platform, and the method comprises: Get the description information of the first type of application interface; Calling the large model deployed in the cloud platform to generate candidate test cases matching the description information; The large model is used to generate different domain-specific language DSL corpora according to description information of different types of application interfaces, and to generate different test cases based on the different DSL corpora; the different types of application interfaces include the first type of application interfaces; the candidate test cases include the first type of application interfaces, interface information and interface parameters of the first type of application interfaces; The first type of application interface is tested according to the candidate test case.
2. The method according to claim 1, characterized in that The cloud platform further includes: a knowledge base, the knowledge base including a plurality of interface information corpora, and an interface parameter corpus associated with each of the plurality of interface information corpora; the calling of the large model deployed in the cloud platform to generate candidate test cases matching the description information includes: Based on the description information, the large model is called to query the knowledge base to obtain a first DSL corpus matching the description information; the first DSL corpus includes: a first candidate interface parameter corpus matching the description information, and a first candidate interface information corpus matching the description information; The large model is called based on the first DSL corpus to generate candidate test cases matching the description information.
3. The method according to claim 2, characterized in that The calling the large model based on the first DSL corpus to generate candidate test cases matching the description information includes: Calling the large model to infer the description information to obtain a second DSL corpus; the second DSL corpus includes: a second candidate interface parameter corpus matching the description information, and a second candidate interface information corpus matching the description information; The first DSL corpus and the second DSL corpus are used as inputs of the large model to generate candidate test cases matching the description information.
4. The method according to any one of claims 1 to 3, characterized in that The calling of the large model deployed in the cloud platform to generate candidate test cases matching the description information includes: The large model is called to generate a DSL corpus matching the description information; the DSL corpus includes: a first DSL corpus or a second DSL corpus; the first DSL corpus is obtained by the large model based on the description information query, and the second DSL corpus is obtained by the large model inference based on the description information; Based on the DSL corpus, the large model is called to perform reasoning to obtain candidate interface keywords; the candidate interface keywords are used to indicate one or more of the following: a request address, a request identifier, and a request method of an interface unit in the candidate test case; Providing a first interface to the client; the first interface includes the candidate interface keyword; In response to a first operation of the client based on the first interface, the large model is called to perform reasoning based on the candidate interface keywords and the DSL corpus to obtain candidate interface parameters; Providing a second interface to the client, wherein the second interface includes the candidate interface keyword and the candidate interface parameter; In response to a second operation of the client based on the second interface, the candidate test case is generated based on the candidate interface keyword and the candidate interface parameter.
5. The method according to claim 4, characterized in that The step of calling the large model to perform reasoning based on the DSL corpus to obtain candidate interface keywords includes: Based on the DSL corpus, the large model is called to perform reasoning to obtain initial interface keywords; Based on the matching of the initial interface keyword with the different types of application interfaces, when there is a first application interface among the different types of application interfaces, the interface information of the first application interface is fitted with the initial interface keyword to obtain the candidate interface keyword; the first application interface includes: an application interface whose interface information among the different types of application interfaces is precisely matched with the initial interface keyword, or an application interface whose interface information among the different types of application interfaces is fuzzy matched with the initial interface keyword.
6. The method according to claim 5, characterized in that After matching the different types of application interfaces based on the initial interface keyword, the method further includes: In the case that the first application interface does not exist in the different types of application interfaces, the large model is called based on the initial interface keyword to obtain a YAML document expressing data serialization; the YAML document is used to indicate: the request path, request method, request parameters, and response body of the interface; Generate a second type of application interface based on the YAML document; the second type of application interface matches the initial interface keyword; The interface information of the second type of application interface is fitted with the initial interface keyword to obtain the candidate interface keyword.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: For a third type of application interface among the different types of application interfaces, the large model is called to obtain features of the third type of application interface, the features including one or more of the following: an interface name, an interface request method, a protocol, a request group, a checkpoint, and a response extraction of the third type of application interface; the third type of application interface is any one of the different types of application interfaces; Converting the features of the third type of application interface into initial DSL corpus; In the case where the initial DSL corpus meets the first requirement, splitting the initial DSL corpus into a first interface information corpus and a first interface parameter corpus, and writing the first interface information corpus and the first interface parameter corpus into a knowledge base; The first requirement includes: one or more of the interface name, interface request method, protocol, request all, checkpoint and response extraction of the third type application interface.
8. The method according to claim 7, characterized in that After converting the features of the third type of application interface into initial corpus, the method further includes: In the case that the initial DSL corpus does not meet the first requirement, calling the large model to correct the initial DSL corpus to obtain a corrected DSL corpus; In the case that the modified DSL corpus meets the first requirement, the modified DSL corpus is split into a second interface information corpus and a second interface parameter corpus, and the second interface information corpus and the second interface parameter corpus are written into the knowledge base.
9. The method according to claim 7 or 8, characterized in that: The different types of application interfaces are generated based on different interface expression structure data uploaded by the client; the interface expression structure data is used to indicate one or more of the following: the request path, request method, request parameters, and response body of the application interface.
10. The method according to any one of claims 1 to 9, characterized in that The testing of the first type of application interface according to the candidate test case includes: Providing a third interface to the client; the third interface includes: description information of the first type of application interface and the candidate test case; In response to a fourth operation of the client based on the third interface, an interface test is performed based on the candidate test case.
11. An interface testing device, characterized in that: The device is arranged on a cloud platform, and comprises: A communication module, used to obtain description information of the first type of application interface; A processing module, configured to call the large model deployed in the cloud platform, generate candidate test cases matching the description information, and test the first type of application interface according to the candidate test cases; The large model is used to generate different domain-specific language DSL corpora according to description information of different types of application interfaces, and to generate different test cases based on the different DSL corpora; the different types of application interfaces include the first type of application interfaces; the candidate test cases include the first type of application interfaces, interface information and interface parameters of the first type of application interfaces.
12. A testing system, characterized in that: The test system comprises: The client is used to provide the interface testing device with description information of the first type of application interface; The interface testing device is used to call the large model deployed in the cloud platform based on the description information, generate candidate test cases matching the description information, and test the first type of application interface according to the candidate test cases; The large model is used to generate different domain-specific language DSL corpora according to description information of different types of application interfaces, and to generate different test cases based on the different DSL corpora; the different types of application interfaces include the first type of application interfaces; the candidate test cases include the first type of application interfaces, interface information and interface parameters of the first type of application interfaces.
13. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 10.
14. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 10.
Citation Information
Cited By
Tool generation method and device, computer equipment and storage medium
CN121478667A
Tool generation method and apparatus, computer device, and storage medium
CN121478667B