Interface case automatic generation and test method and device, equipment and storage medium
By building an automated test framework and automatically generating request parameters, the problem of existing testing tools being difficult to quickly generate test cases and inefficiency is solved, and efficient interface test data reuse and complete testing process are realized, which improves testing efficiency and data reuse rate.
Patent Information
- Application Number
- CN202411564338.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-03-25
AI Technical Summary
Existing test tools are difficult to quickly generate test cases, and the interface test data reuse rate is low, resulting in low testing efficiency. The overall test framework often encounters problems such as integration problems, limited customization, weak scalability, and data security risks.
Provides an automatic generation and testing method for interface use cases. By building an automated testing framework, integrating pre-compiled multiple test case planning data, automatically generating request parameters, finding and combining test cases, conducting interface tests, and generating test reports.
It significantly improves testing efficiency, improves the reuse rate of interface test data, realizes a complete interface testing process, supports customization and expansion, and can be seamlessly integrated into the CI/CD process, reducing release risks.
Smart Images

Figure CN119690820A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing technology, and in particular to a method, device, equipment and storage medium for automatically generating and testing interface use cases. Background Art
[0002] With the rapid development of information technology, application programming interface (API) plays a vital role in the interaction between software systems. As a key link to ensure system quality, API interface testing is becoming increasingly important.
[0003] The current existing testing tools are difficult to quickly generate test cases, and the interface test data reuse rate is low, the testing efficiency is low, and the overall testing framework often encounters problems such as integration difficulties, limited customization, weak scalability, and data security risks. These problems hinder the promotion of business applications and force projects to rely on high-cost manual testing, which is inefficient. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and storage medium for automatically generating and testing interface use cases, so as to at least solve the technical problem of low testing efficiency in related technologies.
[0005] According to one aspect of an embodiment of the present application, a method for automatically generating and testing an interface use case is provided, comprising:
[0006] Building an automated testing framework for interface testing, wherein the automated testing framework integrates a plurality of pre-compiled test case plan data;
[0007] Add an application programming interface to be tested, and automatically generate request parameters corresponding to the application programming interface;
[0008] Based on the request parameters corresponding to the application programming interface, searching the test case plan data corresponding to the application programming interface in the automated testing framework, and obtaining the test case to be executed based on the test case plan data combination;
[0009] Perform interface testing based on the test case to be executed to obtain test results.
[0010] In one embodiment, an automated testing framework for interface testing is constructed, including:
[0011] Build an automated testing framework for interface testing based on the pytest testing framework.
[0012] In one embodiment, building an automated testing framework for interface testing further includes:
[0013] Create a Python test file starting with test_; define an independent test function in the test file, using the form of def test_function_name():, to read and execute the test data in the yaml file.
[0014] In one embodiment, before reading and executing the test data in the yaml file, the method further includes:
[0015] Write test case plan data based on business scenarios, where the test case plan data includes one or more of single-interface use cases, multi-interface linkage use cases, and target test scenario use cases;
[0016] The test case plan data is stored in a yaml file, and the interface basic data is stored in a yaml file.
[0017] In one embodiment, building an automated testing framework for interface testing further includes:
[0018] Create custom assertions;
[0019] Create fixtures and use pytest's fixture functionality to share test setup and cleanup code;
[0020] Create a packaging logic file to encapsulate the test logic.
[0021] In one embodiment, performing interface testing based on the test case to be executed includes:
[0022] Based on the request interface and request parameters in the test case data, the interface to be tested is called to perform the test and obtain the return value;
[0023] Asserting the return value and saving the assertion content in the test report;
[0024] Extract the target business value from the return value and store it as a variable;
[0025] Subsequent interfaces are based on the injected variables as request parameters.
[0026] In one embodiment, after performing interface testing based on the test case to be executed and obtaining the test result, the method further includes:
[0027] Automatically printing the test results;
[0028] Automatically generate test reports and log files.
[0029] According to another aspect of an embodiment of the present application, there is provided an interface use case automatic generation and testing device, comprising:
[0030] A framework building module, used to build an automated testing framework for interface testing, wherein the automated testing framework integrates a plurality of pre-compiled test case plan data;
[0031] An interface acquisition module, used to add an application programming interface to be tested and automatically generate request parameters corresponding to the application programming interface;
[0032] A test case generation module, configured to search for test case plan data corresponding to the application programming interface in the automated testing framework based on request parameters corresponding to the application programming interface, and obtain a test case to be executed based on the test case plan data combination;
[0033] The test module is used to perform interface testing based on the test case to be executed and obtain test results.
[0034] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned interface use case automatic generation and testing method through the above-mentioned computer program.
[0035] According to another aspect of the embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned interface use case automatic generation and testing method when running.
[0036] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0037] The present application relates to a data-driven interface automation testing method, which combines related modules by building a framework. Through the corresponding interface samples, the corresponding test data can be quickly generated in batches to complete the parameterization of interface request parameters. Moreover, the test data can be referenced in different use case sets, and different test case flows can be quickly combined to accelerate the construction of test case scenarios. The test efficiency is significantly improved, and the reuse rate of interface test data is greatly improved. The assertion and reporting modules supporting the framework are used to make it have a complete interface testing process. The overall framework supports customization and expansion, and can be seamlessly integrated into the CI / CD process to achieve automated construction, testing and deployment. It helps to speed up software delivery, improve software quality, and reduce release risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0039] Figure 1 is a flow chart of an interface use case automatic generation and testing method according to an embodiment of the present application;
[0040] Figure 2 is a schematic diagram of an interface testing method according to an embodiment of the present application;
[0041] Figure 3 It is a schematic diagram of an interface use case automatic generation and testing device according to an embodiment of the present application;
[0042] Figure 4 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] The following is combined with Figure 1-2 The automatic generation and testing method of interface use cases in the embodiment of the present application is described in detail. It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this respect. On the contrary, the implementation of the present application can be applied to any applicable scenario. Figure 1 As shown, the method mainly includes the following steps:
[0046] S101 builds an automated testing framework for interface testing, which integrates multiple pre-compiled test case plan data.
[0047] Specifically, an automated testing framework for interface testing is built based on the pytest testing framework. In one embodiment, the underlying layer relies on the third-party pytest testing framework to define and encapsulate the test in a required format, and Python's package management tool pip is used to install pytest, ensuring that after pytest is successfully installed, it can be imported and used in the Python environment.
[0048] Furthermore, create a test file according to the custom framework. Create a Python test file starting with test_; define an independent test function in the test file, using the form of def test_function_name(): to read and execute the test data in the yaml file.
[0049] In one embodiment, according to the convention of pytest, create Python files starting with test_ (e.g., test_api.py), which will contain test cases and test data. In the test file, define an independent test function in the form of def test_function_name():, which contains the reading and execution actions of the test data yaml file.
[0050] Furthermore, test case plan data is written according to a custom framework. In one embodiment, test case plan data is written based on business scenarios, and the test case plan data includes one or more of single interface use cases, multi-interface linkage use cases, and target test scenario use cases; the test case plan data is stored in a yaml file, and the basic interface data is stored in a yaml file. According to the business scenario requirements, the basic interface data can be set to be referenced by different test plan use case data to reduce the redundancy of use case data.
[0051] Since the framework is data-driven, the test logic will be carried by the YAML file. In the test file, write code to read the data in the YAML file and perform test actions.
[0052] The yaml file contains the basic data of the interface (such as the request address and request parameters) and the test case plan data arranged according to the business scenario. These data can include single interface test cases, multi-interface linkage test cases or specific test scenario cases.
[0053] This interface basic data can also be referenced in different test files, that is, referenced by different test plan use case data. Whether it needs to be referenced can be set according to the needs of the business scenario to reduce the redundancy of use case data.
[0054] Furthermore, custom framework encapsulation and reuse are achieved.
[0055] Specifically, write auxiliary functions to encapsulate commonly used test logic, such as sending HTTP requests, parsing responses, and ending and exiting.
[0056] Use pytest's fixtures feature to share test setup and cleanup code. Fixtures can be functions, variables, or objects that are executed before or after the test function to prepare and clean up the test environment.
[0057] Create custom assertion functions or methods to enhance validation capabilities and ensure the accuracy and reliability of test results.
[0058] In one embodiment, the test core logic execution process of the framework includes: first obtaining the test case plan data that needs to be read, and the case data arranged in the plan includes the case name, request interface, request parameters, assertion content, variable injection, and interface subsequent operation information. The core logic function is executed in sequence through the above information, and the interface is called through the request interface and request parameter information to obtain the final return value; through the assertion content information, the return value of the previous step can be asserted and the result can be saved and reflected in the final test report; through the variable injection information, variables can be injected for certain specific business values in the return value, and the subsequent interface can obtain the injection value in the above interface for input, so that the entire test flow can use real variable data for interaction, ensuring the flexibility of the test data; through the subsequent operation of the interface, special requirements after different interface requests can be processed to ensure that the interface request situation of the real environment is simulated.
[0059] In an exemplary scenario, there are two test files, file a is a login module test case, and file b is a page operation module test case (including add, delete, modify and query operations). According to the above logic, file b needs to be logged in before it can perform add, delete, modify and query. In the test framework, it is only necessary to reference the login interface data in the yaml file corresponding to file a in the yaml file corresponding to file b when arranging the test plan. The scenario of the orchestration use case is login->add->query->modify->query->delete->query. After the use case is added, the corresponding name is injected into the variable. The subsequent query interface can use the name that changes each time to query, and it can also determine whether the corresponding name exists in the return value to make an assertion. After the new interface request is added, it may take some time to successfully insert in the real scenario. Therefore, in the subsequent operation of the interface, wait for N seconds before continuing to execute the next interface to ensure that the query interface can accurately find the corresponding data and will not cause assertion failure due to the actual business scenario; the entire test scenario is executed as described above, and a test report is finally obtained.
[0060] After the automatic test framework is generated, test files are grouped into directories, using module imports and pytest tags to organize test cases.
[0061] The test framework provided in the embodiment of the present application includes the basic API of all modules, a test case plan data set, a common module library, a config file library, a corresponding test data file storage location, a corresponding log file storage location, a corresponding module library storage location, a corresponding test report storage location, and a corresponding tool module storage location.
[0062] S102 adds an application programming interface to be tested, and automatically generates request parameters corresponding to the application programming interface.
[0063] Test based on the defined automated test framework. First, add the application programming interface to be tested, add the basic API based on the API module in the test framework, and use the tool code in the tools module in the framework to generate parameter data for the request sample of the API module.
[0064] The test framework provided in the embodiment of the present application, the tools module can integrate multiple tools, and the tools in the framework can be used to automatically generate parameter data required for API requests, so as to achieve the effect of quickly generating parameterized data corresponding to the interface parameters.
[0065] S103 searches for test case plan data corresponding to the application programming interface in the automated testing framework based on request parameters corresponding to the application programming interface, and obtains a test case to be executed based on the test case plan data combination.
[0066] The method provided in the embodiment of the present application, the case module in the framework, integrates multiple test case plan data, finds the test case plan data of the API module in the corresponding case, arranges and combines them according to the test scenario, and obtains the corresponding test case.
[0067] The method of the present application can combine the test case plan data pre-defined in the framework to quickly generate corresponding test cases in batches when performing software testing. Improve the reuse of corresponding interface test data, use the combined test data to form a use case flow to perform use case arrangement, realize the reuse of test data and improve the coverage of use case scenarios. Improve testing efficiency.
[0068] S104 performs interface testing based on the test case to be executed to obtain a test result.
[0069] Set the execution parameters of the test case in the configuration file (config), such as environment, log level, test data file path, etc. Use a run script (such as run.py) to execute the test case according to the settings in the configuration file.
[0070] Furthermore, the pytest command-line tool is used to run the test and execute the test process based on the encapsulated core logic.
[0071] Specifically, the interface to be tested is called based on the request interface and request parameters in the test case data to obtain the return value. According to the request interface and request parameter information in the test case, an HTTP request is sent using an encapsulated auxiliary function. Process the request, including setting the correct HTTP method (GET, POST, PUT, DELETE, etc.), adding a request header, sending a request body, etc. Get the return value, receive the response of the interface call, and extract the return value. Parse the return value as needed, such as converting the JSON response body into a Python dictionary.
[0072] Furthermore, assert the return value and save the assertion content in the test report. Use the assertion content information in the test case to assert the return value of the interface call. Verify whether the actual return value meets expectations, such as status code, data in the response body, etc. Record the assertion results so that they can be reflected in the final test report.
[0073] Furthermore, the target business value is extracted from the return value and stored as a variable. If the test case contains variable injection information, a specific business value is extracted from the interface return value and stored as a variable.
[0074] Furthermore, the subsequent interfaces are based on the injected variables as request parameters. In the subsequent interface calls, these variables are used as request parameters to ensure that the real variable data is used in the entire test process.
[0075] In one embodiment, after performing interface testing based on the test case to be executed and obtaining the test result, the method further includes: automatically printing the test result and automatically generating a test report and a log file.
[0076] In the interface testing framework, it is a common practice to record the test results into report and log files, which helps users review and analyze the results of test execution. First, make sure there is a report folder in the project for test reports and a log folder for log files. Users can confirm the results of test execution by viewing the report files in the report folder and the log files in the log folder. Users can obtain statistical information of test results, such as the total number of test cases, the number of failures, the number of passes, etc., by viewing the XML report file in the report folder. The log file will provide more detailed information, including the execution status and failure reasons of each test case.
[0077] With its powerful integrated deployment capabilities, this framework system innovatively uses the deployment package mode to transmit test data. The on-site deployment package execution test not only verifies the correctness and stability of the system at a very fast speed, but also significantly accelerates the software delivery process, ensures the high quality of the software, and significantly reduces the deployment risk and labor input costs, achieving a double leap in efficiency and quality. For example: When the implementation personnel carry it to the customer's site for deployment, traditionally, testers need to be dispatched to accompany them to perform tedious manual tests to ensure that the program is correct and runs stably. However, using the interface test deployment package solution of this framework system, the implementation personnel can work independently: first deploy the product version, and then directly run the test deployment package to automatically verify the correctness and stability of the system. This move not only greatly reduces the dependence on additional testers, but also significantly improves the efficiency and accuracy of on-site verification, achieving a win-win situation of cost savings and efficiency optimization.
[0078] In order to facilitate understanding of the method provided in the embodiment of the present application, Figure 2 Further description. The test process includes adding a basic API and adding a basic API request case. The present application can automatically generate the parameter data required for the API request based on the framework tool tools. Furthermore, the framework also integrates pre-generated test data, that is, test case plan data, which is arranged and combined based on the test case plan data to obtain the test case and execute the test case. Based on the config file, it is determined whether it is a use case that meets the configuration. If so, a log and a test report are generated. If it is a use case that does not meet the configuration, it ends directly.
[0079] The solution of this application has at least the following beneficial effects:
[0080] 1. Automatically and quickly generate parameterized data corresponding to interface parameters.
[0081] 2. Improve the reuse of corresponding interface test data, use the method of combining test data to form a use case flow to arrange use cases, realize the reuse of test data and improve the coverage of use case scenarios; test data can be referenced in different use case sets, and different test case flows can be quickly combined.
[0082] 3. Use mirror package execution to deploy and execute, which greatly improves the use scenarios of the framework.
[0083] 4. Customized assertions with various assertion methods.
[0084] 5. Make use of the assertion and reporting modules that come with the framework to provide it with a complete interface testing process. The overall framework supports customization and expansion.
[0085] According to another aspect of the embodiment of the present application, there is also provided an interface case automatic generation and testing device for implementing the above-mentioned interface case automatic generation and testing method. Figure 3 As shown, the device comprises:
[0086] A framework construction module 401 is used to construct an automated test framework for interface testing, wherein the automated test framework integrates a plurality of pre-compiled test case plan data;
[0087] The interface acquisition module 402 is used to add the application programming interface to be tested and automatically generate request parameters corresponding to the application programming interface;
[0088] The test case generation module 403 is used to search the test case plan data corresponding to the application programming interface in the automated testing framework based on the request parameters corresponding to the application programming interface, and obtain the test case to be executed based on the test case plan data combination;
[0089] The testing module 404 is used to perform interface testing based on the test cases to be executed and obtain test results.
[0090] It should be noted that the automatic generation and testing device for interface use cases provided in the above embodiments only uses the division of the above functional modules as an example when executing the automatic generation and testing method for interface use cases. In actual applications, the above functional distribution can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the automatic generation and testing device for interface use cases provided in the above embodiments and the automatic generation and testing method for interface use cases embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0091] According to another aspect of the embodiments of the present application, an electronic device corresponding to the interface use case automatic generation and testing method provided in the above embodiments is also provided to execute the above interface use case automatic generation and testing method.
[0092] Please refer to Figure 4 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 4 As shown, the electronic device includes: a processor 500, a memory 501, a bus 502 and a communication interface 503, and the processor 500, the communication interface 503 and the memory 501 are connected via the bus 502; the memory 501 stores a computer program that can be run on the processor 500, and when the processor 500 runs the computer program, it executes the interface use case automatic generation and testing method provided in any of the aforementioned embodiments of the present application.
[0093] The memory 501 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 503 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0094] The bus 502 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 501 is used to store programs, and the processor 500 executes the programs after receiving the execution instructions. The interface use case automatic generation and testing method disclosed in any implementation of the aforementioned embodiment of the present application may be applied to the processor 500, or implemented by the processor 500.
[0095] The processor 500 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 500. The above processor 500 can be a general-purpose processor, including a central processing unit (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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field 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. The storage medium is located in the memory 501, and the processor 500 reads the information in the memory 501 and completes the steps of the above method in combination with its hardware.
[0096] The electronic device provided in the embodiment of the present application and the interface use case automatic generation and testing method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented therein.
[0097] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium corresponding to the interface use case automatic generation and testing method provided in the aforementioned embodiments, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the interface use case automatic generation and testing method provided in any of the aforementioned embodiments.
[0098] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0099] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the interface use case automatic generation and testing method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0100] 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 specification.
[0101] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.
Claims
1. A method for automatically generating and testing interface use cases, characterized in that: include: Building an automated testing framework for interface testing, wherein the automated testing framework integrates a plurality of pre-compiled test case plan data; Add an application programming interface to be tested, and automatically generate request parameters corresponding to the application programming interface; Based on the request parameters corresponding to the application programming interface, searching the test case plan data corresponding to the application programming interface in the automated testing framework, and obtaining the test case to be executed based on the test case plan data combination; Perform interface testing based on the test case to be executed to obtain test results.
2. The method according to claim 1, characterized in that Build an automated testing framework for interface testing, including: Build an automated testing framework for interface testing based on the pytest testing framework.
3. The method according to claim 2, characterized in that Build an automated testing framework for interface testing, including: Create a Python test file starting with test_; define an independent test function in the test file, using the form of def test_function_name():, to read and execute the test data in the yaml file.
4. The method according to claim 3, characterized in that Before reading and executing the test data in the yaml file, it also includes: Write test case plan data based on business scenarios, where the test case plan data includes one or more of single-interface use cases, multi-interface linkage use cases, and target test scenario use cases; The test case plan data is stored in a yaml file, and the interface basic data is stored in a yaml file.
5. The method according to claim 2, characterized in that: Build an automated testing framework for interface testing, including: Create custom assertions; Create fixtures and use pytest's fixture functionality to share test setup and cleanup code; Create a packaging logic file to encapsulate the test logic.
6. The method according to claim 1, characterized in that Performing interface testing based on the test case to be executed includes: Based on the request interface and request parameters in the test case data, the interface to be tested is called to perform the test and obtain the return value; Asserting the return value and saving the assertion content in the test report; Extract the target business value from the return value and store it as a variable; Subsequent interfaces are based on the injected variables as request parameters.
7. The method according to claim 1, characterized in that After performing interface testing based on the test case to be executed and obtaining the test result, the method further includes: Automatically printing the test results; Automatically generate test reports and log files.
8. An interface use case automatic generation and testing device, characterized in that: include: A framework building module, used to build an automated testing framework for interface testing, wherein the automated testing framework integrates a plurality of pre-compiled test case plan data; An interface acquisition module, used to add an application programming interface to be tested and automatically generate request parameters corresponding to the application programming interface; A test case generation module, configured to search for test case plan data corresponding to the application programming interface in the automated testing framework based on request parameters corresponding to the application programming interface, and obtain a test case to be executed based on the test case plan data combination; The test module is used to perform interface testing based on the test case to be executed and obtain test results.
9. An electronic device, characterized in that: It comprises a processor and a memory storing program instructions, wherein the processor is configured to execute the interface use case automatic generation and testing method as claimed in any one of claims 1 to 7 when executing the program instructions.
10. A computer-readable medium, characterized in that Computer-readable instructions are stored thereon, and the computer-readable instructions are executed by a processor to implement an automatic generation and testing method for interface use cases as described in any one of claims 1 to 7.