Interface automation testing method, device, equipment and medium based on large model

Through the interface automation test method based on large models, interface encapsulation API functions and Chinese keywords are generated, and Robot Framework and the improved SRC algorithm are used for testing, which solves the problem of repetitive tasks consume time and prone to misjudgment in software interface tests, and realizes efficient and accurate interface automation testing.

CN119739632APending Publication Date: 2025-04-01CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411791787.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In software interface testing, testers need to perform a large number of repetitive tasks, which leads to high time consumption and prone to miscalculation.

Method used

The interface automation test method based on large models is adopted, and the interface is encapsulated by generating interface encapsulation API functions, encapsulation of Chinese keywords, and the interface automation test is performed using Robot Framework and the improved SRC algorithm to generate a test report in the target format.

Benefits of technology

It reduces the time consumption of testers, avoids misjudgments that are prone to manual testing, and improves testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739632A_ABST
    Figure CN119739632A_ABST
Patent Text Reader

Abstract

The present application relates to an interface automation testing method, device, equipment and medium based on a large model. The method comprises: generating an interface encapsulation API function according to the interface to be tested; encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords; performing interface automation testing based on the positive scenario use case, abnormal scenario use case and improved SRC algorithm pre-generated in the Robot Framework, and generating a test report in a target format. At least it can reduce the time consumption of testers and avoid the misdetection that is easy to occur in manual interface testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a large model-based interface automation testing method, device, equipment and medium. Background Art

[0002] Interface automation testing is a software testing method that uses automated tools to simulate the client sending requests to the server to verify whether the API (application programming interface) works as expected, including checking the correctness of the data, the response time of the service, and the exception handling capabilities.

[0003] In the practice of software interface testing, testers often face the challenge of performing a large number of repetitive tasks, which not only consumes a lot of valuable time but also increases the possibility of errors. Summary of the invention

[0004] Based on this, it is necessary to provide an interface automation testing method, device, equipment and medium based on a large model to address the above technical problems, which can at least reduce the time consumption of testers and avoid the misdetection that is prone to occur in manual interface testing.

[0005] In a first aspect, the present application provides an interface automation testing method based on a large model, comprising: generating an interface encapsulation API function according to an interface to be tested;

[0006] Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords;

[0007] Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

[0008] In one embodiment, a positive scenario use case is designed by following the steps below:

[0009] Create a target file in the resource layer of Robot Framework to store Chinese keywords;

[0010] Create multiple suites and create test cases in each suite layer, where each suite corresponds to an interface;

[0011] Delete the data during the test to ensure the test loop is closed.

[0012] In one of the embodiments, the abnormal scenario use case is designed by the following steps:

[0013] Based on the test cases of the positive scenario, multiple abnormal test cases are generated using the large model.

[0014] In one embodiment, the method further comprises:

[0015] The scenario use cases are modified, and the scenario use cases include positive scenario use cases and abnormal scenario use cases.

[0016] In one embodiment, the step of modifying the scenario use case includes:

[0017] Get multiple historical use cases;

[0018] Performing data preprocessing on the multiple historical use cases;

[0019] Based on multiple historical use cases after data preprocessing, the machine learning model SRC algorithm is used for classification, and the reconstruction algorithm in the SRC algorithm is improved;

[0020] The historical use cases that meet the preset response code standards are determined as scenario use cases, where the response code of each historical use case is predicted by the improved SRC algorithm.

[0021] In one embodiment, the improved SRC algorithm performs the following steps:

[0022] Calculate the similarity between historical use cases and the samples to be tested;

[0023] Select multiple samples that are most similar to the sample to be tested as the initial dictionary;

[0024] Given a sample to be tested, the improved OMP algorithm is used to reconstruct it and obtain multiple sparse representation errors;

[0025] The error code corresponding to the dictionary that minimizes the sparse representation error is selected as the prediction result of the SRC algorithm, and the error code is used to represent the prediction status of the sample to be tested.

[0026] On the second aspect, the present application also provides an interface automation testing device based on a large model, including: an interface encapsulation module to be tested, used to generate an interface encapsulation API function according to the interface to be tested; an API function encapsulation module, used to encapsulate the interface encapsulation API function to obtain encapsulated Chinese keywords; a test report generation module, used to perform interface automation testing based on the positive scenario use cases, abnormal scenario use cases and improved SRC algorithm pre-generated in RobotFramework, and generate a test report in a target format.

[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0028] Generate interface encapsulation API function according to the interface to be tested;

[0029] Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords;

[0030] Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

[0031] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0032] Generate interface encapsulation API function according to the interface to be tested;

[0033] Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords;

[0034] Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

[0035] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0036] Generate interface encapsulation API function according to the interface to be tested;

[0037] Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords;

[0038] Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

[0039] The above-mentioned large model-based interface automation testing method, device, equipment and medium can at least reduce the time consumption of testers and avoid the misdetection that is easy to occur in manual interface testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0041] Figure 1A schematic diagram of a flow chart of an interface automation testing method based on a large model in an embodiment;

[0042] Figure 2 A schematic diagram of a flow chart of an interface automation testing method based on a large model in another embodiment;

[0043] Figure 3 The following is a flowchart of designing a forward use case based on Robot Framework in one embodiment;

[0044] Figure 4 is a structural block diagram of a multimodal information generating device based on a visual regression model in one embodiment;

[0045] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment.

[0046] Reference numerals and descriptions:

[0047] 10. Test interface encapsulation module; 20. API function encapsulation module; 30. Test report generation module. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] The distributed relational database testing method provided in the embodiment of the present application can be applied to various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc.

[0050] It should be noted that the large model mentioned in this application can be a natural language processing large model LLAMA-2-70B-CHAT specially designed for understanding and generating natural language text. The model can handle complex language structures and semantics, making it perform well in natural language processing tasks such as text summarization, translation, question-answering systems, and sentiment analysis.

[0051] Robot Framework is a keyword-driven automated testing framework that supports the creation of scalable test scripts and can be integrated with a variety of libraries and tools. Its advantages are that it is easy to learn and use, using the graphical interface tool RIDE to lower the threshold for automation, has excellent scalability, supports a variety of libraries, allows data-driven testing, and runs across platforms. In addition, it also provides detailed test reports and can be integrated into the continuous integration / continuous deployment (CI / CD) process, which helps improve test efficiency and accuracy.

[0052] Please refer to Figure 1 In an exemplary embodiment, a large model-based interface automation testing method is provided, including the following steps S101 to S103. Among them:

[0053] Step S101, generating an interface encapsulation API function according to the interface to be tested.

[0054] Specifically, the detailed document of the interface to be tested can be exported as a JSON format file that complies with the Swagger 2.0 specification, and the natural language processing large model LLAMA-2-70B-CHAT can be guided to parse it with appropriate prompts. The model will generate API interface functions that conform to programming logic based on the input interface document.

[0055] As an example, the prompt is as follows: The json file provided is an interface in swagger format. Please use python's requests to generate the relevant request API.

[0056] For example, the encapsulation request template is as follows:

[0057] class RequestTestLib(object):

[0058] def func(self, token, param1, param2):

[0059] url = f"{self.base_url} / dataset / name / check"

[0060] headers = {

[0061] "Authorization": f"Bearer {token}"

[0062] }

[0063] params = {

[0064] "param1": param1,

[0065] " param1": param2

[0066] }

[0067] response = requests.get(url, headers=headers, params=params)

[0068] return response.status_code, json.loads(response.content).

[0069] Step S102, encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords.

[0070] Specifically, the API interface functions generated by the large model can be further encapsulated and converted into Chinese keywords that are easy to understand and operate. Appropriate prompts are input into the LLAMA-2-70B-CHAT large model to generate reasonable and readable keywords.

[0071] As an example, Prompt such as: The following provides the function header of the encapsulated API function and the keywords corresponding to the API function.

[0072] The api function is: def func1(self, token, param1, param2). The Robot Framework keywords are: [Arguments] ${param1}${param2}${ans}func1${param1}${param2}[Return] ${ans}. Based on the above two information, please generate the keywords of the following api function: def func2(self, token,param1, param2, …).

[0073] Step S103, based on the positive scenario use cases, abnormal scenario use cases and the improved SRC algorithm pre-generated in the Robot Framework, perform interface automation testing and generate a test report in the target format.

[0074] Specifically, you can design a positive scenario use case through the following steps: create a target file in the resource layer of Robot Framework to store Chinese keywords; create multiple suites, and create test cases in each suite layer, where each suite corresponds to an interface; delete the data during the test to ensure a closed test loop.

[0075] As an example, see Figure 3 , Figure 3 FIG. 1 is a flow chart of designing a forward use case based on Robot Framework in one embodiment. Figure 3 As shown in the figure, the steps to design a positive use case based on Robot Framework include:

[0076] Step S301: The resource layer creates a .robot file.

[0077] Step S302, creating a suite and a corresponding interface.

[0078] Step S303, creating a test case.

[0079] Step S304, test case data is deleted.

[0080] Here, based on manual testing experience, you can write reasonable assertions, design reasonable and effective test data, generate interface-related suites in Robot Framework, and design specific positive test cases under the suites, such as Figure 3 As shown, Chinese keywords in .robot files can be highly utilized by test cases and are independent of each other.

[0081] Specifically, the abnormal scenario use case is designed through the following steps: Based on the test case of the positive scenario, multiple abnormal test cases are generated using the large model.

[0082] Here, based on the test cases of the positive scenario, LLAMA-2-70B-CHAT is further used to generate a series of typical abnormal scenarios. These abnormal scenarios help test the robustness of the interface under abnormal input or edge cases.

[0083] As an example, Prompt provides a JSON file of the positive scenario test case and interface documentation of the interface. Please generate a typical abnormal scenario test case for the interface.

[0084] Optionally, the method further includes: correcting scenario use cases, wherein the scenario use cases include positive scenario use cases and abnormal scenario use cases.

[0085] Specifically, the steps of correcting the scenario use case include: obtaining multiple historical use cases; performing data preprocessing on the multiple historical use cases; classifying them based on the multiple historical use cases after data preprocessing using the machine learning model SRC algorithm, and improving the reconstruction algorithm in the SRC algorithm; determining the historical use cases that meet the preset response code standards as scenario use cases, wherein the response code of each historical use case is predicted by the improved SRC algorithm.

[0086] Among them, historically executed use cases can be collected as training data, such as test cases and execution result response codes (200, 400, 404, 500, 405, etc.). These data will be used as historical use cases for training machine learning models.

[0087] The collected data is preprocessed to form a key-value pair format, where each test case is a key and the status code is a value. Such a set of key-value pairs is a pair of training data.

[0088] Here, in order to facilitate subsequent application to model input, the test case text is converted into structured data, and then converted into a feature vector that can be understood by the machine learning model using the bag-of-words model. The execution results represent different sample categories.

[0089] Among them, since the prediction task is essentially a classification task, this application adopts the machine learning model SRC algorithm for classification, and improves the reconstruction algorithm in the SRC algorithm. Due to the large number of interfaces, the use cases between different interfaces are different. The core of the SRC algorithm requires a suitable dictionary matrix. First, the similarity between the historical test cases and the sample y to be tested is calculated, and the top k samples most similar to the sample to be tested are selected as the initial dictionary A for subsequent sparse representation. For each test sample y, the classic SRC algorithm usually uses the OMP (Orthogonal Matching Pursuit) algorithm to solve the sparse coefficient vector l, so that the test sample can be linearly represented by the training sample in the dictionary, and the sparse coefficient vector is as sparse as possible, that is, the l vector has as many zero values ​​as possible. The formula is shown below:

[0090] ;

[0091] In the above formula, e represents the acceptable error, y is the sample to be tested, and l is the sparse coefficient to be solved. The OMP algorithm is generally used to solve the above formula. In order to improve the problem of low efficiency in selecting the optimal atom in each iteration of the OMP algorithm, an improved OMP algorithm is proposed. The improved OMP algorithm is as follows:

[0092] Input: dictionary matrix A, adaptive selection of several use cases close to the sample to be tested to form a dictionary, the sample to be tested y, and the number of iterations s.

[0093] Initialization: Residual , the set of sequence numbers selected during each iteration , the observation matrix generated at each iteration is .

[0094] when implement.

[0095] Update number of iterations: .

[0096] Solve for the inner product: .

[0097] Construct an atomic support set: Select the atomic numbers corresponding to the inner product absolute value greater than or equal to the inner product average value to form a pre-selected atomic support set .

[0098] Update support set: .

[0099] when Stop iteration; otherwise, continue iteration.

[0100] calculate Least squares solution .

[0101] Update residual .

[0102] if : Stop iteration; otherwise: return to the first step.

[0103] Output: sparse coefficients .

[0104] Combined with the improved OMP algorithm, the improved SRC algorithm performs the following steps:

[0105] Calculate the similarity between historical use cases and the samples to be tested;

[0106] Select multiple samples that are most similar to the sample to be tested as the initial dictionary;

[0107] Given a sample to be tested, the improved OMP algorithm is used to reconstruct it and obtain multiple sparse representation errors;

[0108] The error code corresponding to the dictionary that minimizes the sparse representation error is selected as the prediction result of the SRC algorithm, and the error code is used to represent the prediction status of the sample to be tested.

[0109] Here, the final generated test report can be in .html format, showing the overall situation of the test, test execution time, and detailed parameters of a single test case.

[0110] As an example, see Figure 2 , Figure 2 FIG. 1 is a flow chart of an interface automation testing method based on a large model in another embodiment. Figure 2 As shown in the figure, the interface automation testing method based on the large model includes:

[0111] Step S201, the interface document is converted into JSON format.

[0112] Step S202, the large model encapsulates the API function.

[0113] Step S203: encapsulate Chinese keywords in the large model.

[0114] Step S204: design a positive scenario use case in the Robot Framework tool based on manual testing experience.

[0115] Step S205: The large model generates abnormal scenario use cases.

[0116] Step S206, the improved SRC algorithm predicts the response code code of the use case execution.

[0117] Step S207, determine whether the code is 200.

[0118] If the code is 200, execute step S208 and execute the interface test case with one click in Robot Framework.

[0119] If the code is not 200, step S209, correct the test case.

[0120] This application selects the appropriate automated testing tool Robot Framework, which has the advantage of simple grammatical structure, using keyword-driven form fill-in-the-blank style to complete the use case writing, and lowering the threshold for practitioners to use automated testing through the graphical compilation tool RIDE. In addition, the test resources of the framework are layered, and keywords can be highly utilized by test cases and are independent of each other, thereby reducing the impact of dependencies between interfaces. Using the large natural language processing model LLAMA-2-70B-CHAT, the interface document is parsed, and the API interface function that conforms to the programming logic is automatically generated, which simplifies the process of manually writing API call code, improves the adaptability of the test, and improves the efficiency of interface encapsulation. In Robot Framework, the API interface function is encapsulated into Chinese keywords. Using Chinese keywords to design test cases improves the readability and ease of use of test scripts. Easy-to-understand Chinese keywords and automated testing processes help promote collaboration between development, testing and other team members. Combined with manual testing experience, use assertions and test data to design positive scenario test cases to ensure the closed loop and rigor of the test. Using the large natural language processing model LLAMA-2-70B-CHAT, abnormal scenario test cases are generated to enhance the test of interface exception handling capabilities. In addition to improving test coverage, large models can also generate test cases to reduce human errors, improve test efficiency, and improve the accuracy of test results. Improve the OMP algorithm, optimize the SRC algorithm, and use use cases as the initial dictionary. These improvements are conducive to improving the algorithm's adaptability and classification accuracy. This method enables the algorithm to more accurately predict interface response codes and identify and correct erroneous use cases in advance. The optimized SRC classifier can more accurately predict interface responses and reduce false positives and negatives. By predicting and correcting use cases, the test cycle is shortened and the development process is accelerated.

[0121] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0122] Based on the same inventive concept, the embodiment of the present application also provides a large model-based interface automation testing device for a large model-based interface automation testing method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more large model-based interface automation testing device embodiments provided below can refer to the limitations of the large model-based interface automation testing method above, and will not be repeated here.

[0123] Please refer to Figure 4 In an exemplary embodiment, an interface automation testing device based on a large model is provided, including: an interface encapsulation module 10 to be tested, used to generate an interface encapsulation API function according to the interface to be tested; an API function encapsulation module 20, used to encapsulate the interface encapsulation API function to obtain encapsulated Chinese keywords; a test report generation module 30, used to perform interface automation testing based on the positive scenario use cases, abnormal scenario use cases and improved SRC algorithm pre-generated in the Robot Framework, and generate a test report in a target format.

[0124] Each module in the above-mentioned interface automation test device based on a large model can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0125] In an exemplary embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a multimodal information generation method based on a visual regression model is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0126] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0128] Generate interface encapsulation API function according to the interface to be tested;

[0129] Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords;

[0130] Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

[0131] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0132] Generate interface encapsulation API function according to the interface to be tested;

[0133] Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords;

[0134] Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

[0135] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0136] Generate interface encapsulation API function according to the interface to be tested;

[0137] Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords;

[0138] Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

[0139] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0140] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0141] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A large model-based interface automation testing method, characterized in that: include: Generate interface encapsulation API function according to the interface to be tested; Encapsulating the interface encapsulation API function to obtain encapsulated Chinese keywords; Based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, interface automation testing is performed to generate a test report in the target format.

2. The interface automation testing method based on a large model according to claim 1 is characterized in that: Design a positive scenario use case by following these steps: Create a target file in the resource layer of Robot Framework to store Chinese keywords; Create multiple suites and create test cases in each suite layer, where each suite corresponds to an interface; Delete the data during the test to ensure the test loop is closed.

3. The interface automation testing method based on a large model according to claim 2 is characterized in that: Design the exception scenario use case by following the steps below: Based on the test cases of the positive scenario, multiple abnormal test cases are generated using the large model.

4. The interface automation testing method based on a large model according to claim 3 is characterized in that: The method further comprises: The scenario use cases are modified, and the scenario use cases include positive scenario use cases and abnormal scenario use cases.

5. The interface automation testing method based on a large model according to claim 4 is characterized in that: The steps to modify the scenario use case include: Get multiple historical use cases; Performing data preprocessing on the multiple historical use cases; Based on multiple historical use cases after data preprocessing, the machine learning model SRC algorithm is used for classification, and the reconstruction algorithm in the SRC algorithm is improved; The historical use cases that meet the preset response code standards are determined as scenario use cases, where the response code of each historical use case is predicted by the improved SRC algorithm.

6. The interface automation testing method based on a large model according to claim 5 is characterized in that: The improved SRC algorithm performs the following steps: Calculate the similarity between historical use cases and the samples to be tested; Select multiple samples that are most similar to the sample to be tested as the initial dictionary; Given a sample to be tested, the improved OMP algorithm is used to reconstruct it and obtain multiple sparse representation errors; The error code corresponding to the dictionary that minimizes the sparse representation error is selected as the prediction result of the SRC algorithm, and the error code is used to represent the prediction status of the sample to be tested.

7. An interface automation testing device based on a large model, characterized in that: The device comprises: The interface encapsulation module to be tested is used to generate an interface encapsulation API function according to the interface to be tested; An API function encapsulation module is used to encapsulate the interface encapsulation API function to obtain encapsulated Chinese keywords; The test report generation module is used to perform interface automation testing based on the pre-generated positive scenario use cases, abnormal scenario use cases and improved SRC algorithm in Robot Framework, and generate test reports in the target format.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.