Test case generation method and system for test interface
By parsing user interface files and generating corresponding module codes and application codes for interface calls, the automatic test case generation of N-API tool code is realized, solving the problem of inefficient manual writing of test cases in the existing technology, and improving interface testing accuracy and efficiency.
Patent Information
- Application Number
- CN202411152552.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-24
AI Technical Summary
The method of manually writing test cases in the prior art cannot accurately test the code business functions generated by N-API tools, resulting in inefficient testing, especially when the number of interfaces is large, manual writing workload is huge, and the application layer skills are lacking, resulting in It is difficult for developers to test effectively.
By parsing user interface files and interface information, the module code required by the application and the application code for interface calls are generated, and test cases for interface testing are generated based on these codes, so that the application code for interface testing is automatically generated.
Automatically generating test cases reduces the workload of manual writing, improves the accuracy and efficiency of testing, reduces application development costs, and can accurately test the code business functions generated by N-API tools.
Smart Images

Figure CN119179637A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a test case generation method and system for a test interface. Background Art
[0002] The N-API framework code generation tool (i.e., N-API tool) is a tool that can generate N-API framework code, business framework code, and GN file (a configuration file for building a system) based on the ts (typescript, a computer programming language) interface file in the path specified by the user. When developing the interface between JS applications and N-API, using this N-API tool, the underlying framework developers do not need to pay attention to the upper-level application conversion logic such as Nodejs syntax and data type conversion between C++ and JS applications, but only need to pay attention to the underlying business logic, which can greatly improve the efficiency of software development.
[0003] Currently, after the N-API tool generates an interface implementation file based on the interface definition file, developers are required to write application code separately and call the code generated by the tool definition, so as to use the separately written code to test whether the business functions of the tool-generated code are consistent with expectations; the professional skills of developers responsible for interface implementation are generally concentrated on the system layer, and the skills at the application layer are relatively lacking, resulting in the inability of the separately written application code to well test the business functions of the code generated by the N-API tool; moreover, when the number of interfaces processed by the N-API tool is large, the workload of manually writing test cases is huge, resulting in low testing efficiency of the interface implementation files. Summary of the invention
[0004] The main purpose of the present invention is to provide a test case generation method and system for a test interface, aiming to solve the problem in the prior art that the method of manually writing test cases cannot accurately test the business functions of the code generated by the N-API tool.
[0005] To achieve the above object, the present invention provides a test case generation method for a test interface, the test case generation method for the test interface comprising the following steps: Parse user interface files and interface information; Generate the module code required by the application and the application code called by the interface according to the parsed file information, interface parameters and return value information; A test case for interface testing is generated according to the module code and the application code called by the interface.
[0006] Optionally, the parsing of the user interface file and the interface information specifically includes: Parsing the user interface file to obtain corresponding module information; Parsing the interface information in the user interface file; Obtain the number of parameters, parameter types, and return value type information in the user interface file.
[0007] Optionally, parsing the user interface file to obtain corresponding module information specifically includes: Create a plugin configuration file and create a file containing the N-API plugin code; Compile the plug-in configuration file and the file containing the N-API plug-in code to obtain a parsing plug-in; The parsing plug-in is run, and the user interface file is parsed based on the parsing plug-in to obtain corresponding module information.
[0008] Optionally, generating the module code required for the application and the application code for the interface call according to the parsed file information, interface parameters and return value information specifically includes: Define application interface call file template and interface call template; Generate the code for importing the module in the user interface file according to the module information corresponding to the user interface file, and obtain the module code required by the application; Generate application code for the interface call according to the interface parameters and the return value information.
[0009] Optionally, generating a code for importing a module in the user interface file according to the module information corresponding to the user interface file specifically includes: According to the application interface calling file template and the module information, compile and obtain the module corresponding to the user interface file based on the compilation configuration file; The module corresponding to the user interface file is imported, and the module corresponding to the user interface file is tested, and the code of the imported module in the user interface file is obtained based on the test result.
[0010] Optionally, generating the application code for the interface call according to the interface parameters and the return value information specifically includes: Define an interface function for receiving the parameter, and perform parameter checking on the parameter through the interface function to ensure that the parameter is a number; Generate application code for the interface call according to the parameter, the return value and the interface function.
[0011] Optionally, generating a test case for interface testing according to the module code and the application code called by the interface specifically includes: Configure the test framework and assertion library; In the test project directory, create a test file, and generate test cases for verifying the interface function according to the module code and the application code called by the interface; The test interface is tested based on the test case, and the corresponding test result is displayed.
[0012] In addition, to achieve the above-mentioned purpose, the present invention also provides a test case generation system for a test interface, wherein the test case generation system for a test interface comprises: Parsing module, used for parsing user interface files and interface information; The code generation module is used to generate the module code required by the application and the application code called by the interface according to the parsed file information, interface parameters and return value information; The test case generation module is used to generate a test case for interface testing according to the module code and the application code called by the interface.
[0013] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a test case generation program for a test interface stored in the memory and runnable on the processor, and when the test case generation program for the test interface is executed by the processor, the steps of the test case generation method for the test interface as described above are implemented.
[0014] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a test case generation program for a test interface, and when the test case generation program for the test interface is executed by a processor, the steps of the test case generation method for the test interface as described above are implemented.
[0015] In the present invention, by parsing the user interface file and interface information, the module code required for the application and the application code called by the interface can be generated according to the file information, interface parameters and return value information obtained by the parsing, and the test case for the interface test can be generated according to the module code and the application code called by the interface. The present invention can automatically generate the module code required for the application and the application code called by the interface, and finally realize the automatic generation of the application code for the interface test, so that the code business function generated by the N-API tool can be accurately tested, and the efficiency of the application interface test is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of a preferred embodiment of a method for generating test cases for a test interface of the present invention; Figure 2 It is a structural diagram of a preferred embodiment of a test case generation system for a test interface of the present invention; Figure 3It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0018] Currently, after the N-API tool generates an interface implementation file based on the interface definition file, developers are required to write application code separately and call the code generated by the tool definition, so as to use the separately written code to test whether the business functions of the tool-generated code are consistent with expectations; the professional skills of developers responsible for interface implementation are generally concentrated on the system layer, and the skills at the application layer are relatively lacking, resulting in the inability of the separately written application code to well test the business functions of the code generated by the N-API tool; moreover, when the number of interfaces processed by the N-API tool is large, the workload of manually writing test cases is huge, resulting in low testing efficiency of the interface implementation files.
[0019] In order to solve the problem that the method of manually writing test cases in the prior art cannot accurately test the code business functions generated by the N-API tool, a test case generation method for a test interface is provided in an embodiment of the present invention. The method parses the user interface file and interface information, and can generate the module code required by the application and the application code called by the interface according to the file information, interface parameters and return value information obtained by parsing, and generates a test case for interface testing according to the module code and the application code called by the interface. The present invention can automatically generate the module code required by the application and the application code called by the interface, and finally realize the automatic generation of application code for interface testing, so that the code business functions generated by the N-API tool can be accurately tested, and the efficiency of application interface testing is improved.
[0020] The test case generation method of the test interface described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the test case generation method of the test interface includes the following steps: Step S10: parsing the user interface file and interface information.
[0021] It should be noted that in the present application, the test case generation method of the test interface is a method implemented based on the N-API framework code generation tool (i.e., the N-API tool). The N-API framework (Native Application Programming Interface) is a set of native module extension development frameworks in the OpenHarmony system. The framework is developed based on the Node.js N-API specification and can provide developers with the ability to interact between JavaScript and C / C++ modules.
[0022] It can be understood that in the present application, software developers develop JS applications based on the N-API tool and then obtain application code files; these application code files include interface definition files, based on which interface implementation files can be generated (interface implementation files can implement the functions defined by the interface); in order to test whether these interface implementation files meet the expected requirements, corresponding test cases are required for testing, therefore, in the present application, the application interface files and interfaces developed by the developers are first parsed; then, based on the parsed file information, interface parameters, and return value information, the module code required for the application and the application code for the interface call are generated; finally, based on these module codes and the application code for the interface call, the application code for the interface test is automatically generated, so that the test case for the interface test can be obtained based on these application codes for the interface test.
[0023] In this application, based on the N-API tool, test cases for interface testing can be automatically generated, reducing the workload of manually writing test cases. Moreover, the code accuracy of the automatically generated test cases for interface testing is high, which can realize an efficient and accurate application interface automatic testing process and reduce the application development cost.
[0024] In this application, the application interface files and interfaces developed by the developer are first parsed through the N-API tool plug-in to obtain the file information, interface parameters, and return value information in the application interface files, so as to generate the module code required for the application and the application code for the interface call based on the parsed information.
[0025] Furthermore, the parsing of the user interface file and interface information specifically includes: parsing the user interface file to obtain corresponding module information; parsing the interface information in the user interface file; obtaining the number of parameters, parameter types and return value type information in the user interface file.
[0026] Specifically, in this application, since the N-API tool itself is an API for building Node.js plug-ins, the N-API tool is not a tool directly used to parse application interface files. If you want to parse interface files, you need to use the N-API tool in combination with other tools or libraries to implement it. For example, you can use the N-API tool to build a Node.js plug-in, and the Node.js plug-in can call other libraries (for example, libraries for parsing JSON, XML or other data formats) to process interface files; in this application, the user interface file is parsed through the Node.js plug-in to obtain the corresponding module information, and the interface information in the user interface file is analyzed, and the number of parameters, parameter types and return value type information in the user interface file are obtained from the parsed module information and interface information, and the parsed result of the user interface file can be obtained.
[0027] Furthermore, the parsing of the user interface file to obtain corresponding module information specifically includes: creating a plug-in configuration file and creating a file containing N-API plug-in code; compiling a parsing plug-in according to the plug-in configuration file and the file containing N-API plug-in code; running the parsing plug-in, and parsing the user interface file based on the parsing plug-in to obtain corresponding module information.
[0028] Specifically, in this application, the process of parsing the user interface file and obtaining the corresponding module information mainly includes: First, you need to create a Node.js plug-in. This process requires the use of the N-API tool to create a Node.js plug-in to handle the reading and parsing of the interface file. The Node.js plug-in needs to be compiled according to the corresponding plug-in configuration file and the corresponding file containing the N-API plug-in code.
[0029] Then, the interface file is read through the Node.js plug-in; in the Node.js plug-in, the file system module (fs module) can be used to read the interface file content. That is, the built-in fs module of the Node.js plug-in can be called through the N-API tool, or the file content can be passed as input to the Node.js plug-in to read the interface file.
[0030] After that, parse the interface file; this process requires implementing parsing logic in the Node.js plug-in according to the format of the interface file (for example, JSON, XML, or a custom format). This process can use an existing parsing library or manually implement the parsing code.
[0031] Finally, extract the module information; this process requires extracting the module information required by the user interface file from the parsed data. Extracting the module information usually involves traversing the data structure and extracting related fields to obtain the module information required by the user interface file. After extracting the module information required by the user interface file, use the N-API tool to return the extracted module information to the Node.js environment to implement the parsing process of the module information of the user interface file.
[0032] Specifically, in the present application, when reading the interface file through the Node.js plug-in, in addition to obtaining the module information of the user interface file, the interface information in the user interface file can also be parsed, and the number of interface parameters, parameter types, and return value type information, etc. can be extracted from the parsed data, so as to use the N-API tool to return the extracted information to the Node.js environment, thereby realizing the generation of module code and application code for interface calls.
[0033] Step S20: Generate module code required by the application and application code called by the interface according to the file information, interface parameters and return value information obtained by parsing.
[0034] Specifically, in the present application, after parsing the JSON file through the above Node.js plug-in, file information, interface parameters and return value information are obtained; wherein, the file information includes function name information, the interface parameters include function parameters, and the return value information includes return value type.
[0035] In this application, the information obtained by parsing the Node.js plug-in can be used to generate N-API module code through an automated generation tool, that is, to generate the corresponding C++ code (module code required for the application) according to the interface definition; wherein the basic structure of the N-API module is as follows: define functions, initialize modules, and export functions.
[0036] And generate interface call code through automatic generation tool, that is, call the generated N-API module by automatically writing Node.js code. Among them, the automatic generation tool can write a script to parse the configuration file and generate C++ code and Node.js code (module code required by the application and application code for interface call).
[0037] Furthermore, the module code required for the application and the application code for the interface call are generated based on the parsed file information, interface parameters and return value information, specifically including: defining an application interface call file template and an interface call template; generating the code for importing the module in the user interface file based on the module information corresponding to the user interface file to obtain the module code required for the application; generating the application code for the interface call based on the interface parameters and the return value information.
[0038] Specifically, in the present application, in the process of generating N-API module code through an automated generation tool, it is necessary to define an application interface call file template and an interface call template; wherein the application interface call file template is a C++ file template that defines how to expose the interface to Node.js; the interface call template is a Node.js file template that is used to import and use C++ modules; these templates can use a template engine (such as EJS or Handlebars) to automatically generate these files.
[0039] According to the template defined above, the module information corresponding to the user interface file can be used to generate the code for importing the module in the user interface file, and the interface parameters and return value information can be used to generate the application code for the interface call. The code for importing the module in the user interface file can be written into a Node.js script using an automated generation tool, and the Node.js script is used to read the template information of the interface file, and the code for importing the module is generated using the above template; the specific method for generating the code is: generating an index.js file according to the module information in the interface.json file, which includes examples of module import and function call.
[0040] Furthermore, the application code for the interface call is generated according to the interface parameters and the return value information, specifically including: compiling the module corresponding to the user interface file based on the compilation configuration file according to the application interface calling file template and the module information; importing the module corresponding to the user interface file, and testing the module corresponding to the user interface file, and obtaining the code for the imported module in the user interface file based on the test result.
[0041] Specifically, in the present application, based on the above Node.js script, the application interface is used to call the file template and module information to compile the module corresponding to the user interface file; then, the created test file (for example, the index.js file) is used to detect whether the module corresponding to the user interface file meets expectations. If it meets expectations, the code for importing the module in the final user interface file is output.
[0042] Furthermore, the method specifically includes: defining an interface function for receiving the parameter, and performing parameter checking on the parameter through the interface function to ensure that the parameter is a number; generating application code for the interface call based on the parameter, the return value and the interface function.
[0043] Specifically, in the present application, in the process of generating the application code for the interface call, the description of the interface file interface.json (interface parameters, return value information) is used to generate the application code for the interface call through the above Node.js script; the specific process of generating the application code for the interface call is: define an interface function that receives parameters, and after checking the corresponding parameters, use the node-gyp tool to compile the C++ code based on the parameters, return values and interface functions, and write the Node.js call code (i.e., the application code for the interface call).
[0044] Step S30: Generate a test case for interface testing according to the module code and the application code called by the interface.
[0045] Specifically, in the present application, based on the module code required by the application and the application code called by the interface obtained in the above step S20, the functions and parameters of the application interface can be determined; then, by using the Node.js test framework (such as Mocha or Jest) to write test cases, test cases for interface testing can be generated.
[0046] Furthermore, the test cases for interface testing are generated based on the module code and the application code called by the interface, specifically including: configuring a test framework and an assertion library; creating a test file in a test project directory, and generating test cases for verifying interface functions based on the module code and the application code called by the interface; testing the test interface based on the test cases, and displaying corresponding test results.
[0047] Specifically, in this application, in the process of generating test cases for interface testing, it is necessary to configure the test framework and assertion library, where the test framework uses the Node.js test framework; then, in the test project directory, create a test.js file, and use Mocha or Jest to write test code for verifying the application interface function; finally, add the test script to package.json, use npm test to execute the test and check the results. Through the above writing process, the test case is obtained. After testing and checking, a large number of interface tests can be implemented based on the test case.
[0048] In the present invention, by parsing the user interface file and interface information, the module code required for the application and the application code called by the interface can be generated according to the file information, interface parameters and return value information obtained by the parsing, and the test case for the interface test can be generated according to the module code and the application code called by the interface. The present invention can automatically generate the module code required for the application and the application code called by the interface, and finally realize the automatic generation of the application code for the interface test, so that the code business function generated by the N-API tool can be accurately tested, and the efficiency of the application interface test is improved.
[0049] Furthermore, if Figure 2 As shown, based on the test case generation method of the test interface, the present invention also provides a test case generation system of the test interface, wherein the test case generation system of the test interface includes: Parsing module 21, used for parsing user interface files and interface information; The code generation module 22 is used to generate the module code required by the application and the application code called by the interface according to the file information, interface parameters and return value information obtained by parsing; The test case generation module 23 is used to generate a test case for interface testing according to the module code and the application code called by the interface.
[0050] Furthermore, if Figure 3 As shown, based on the test case generation method and system of the above-mentioned test interface, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Figure 3 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0051] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a test case generation program 40 for a test interface is stored on the memory 20, and the test case generation program 40 for the test interface can be executed by the processor 10, thereby realizing the test case generation method for the test interface in the present application.
[0052] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the test case generation method of the test interface.
[0053] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0054] In one embodiment, when the processor 10 executes the test case generation program 40 of the test interface in the memory 20, the following steps are implemented: Parse user interface files and interface information; Generate the module code required by the application and the application code called by the interface according to the parsed file information, interface parameters and return value information; A test case for interface testing is generated according to the module code and the application code called by the interface.
[0055] Optionally, the parsing of the user interface file and the interface information specifically includes: Parsing the user interface file to obtain corresponding module information; Parsing the interface information in the user interface file; Obtain the number of parameters, parameter types, and return value type information in the user interface file.
[0056] Optionally, parsing the user interface file to obtain corresponding module information specifically includes: Create a plugin configuration file and create a file containing the N-API plugin code; Compile the plug-in configuration file and the file containing the N-API plug-in code to obtain a parsing plug-in; The parsing plug-in is run, and the user interface file is parsed based on the parsing plug-in to obtain corresponding module information.
[0057] Optionally, generating the module code required for the application and the application code for the interface call according to the parsed file information, interface parameters and return value information specifically includes: Define application interface call file template and interface call template; Generate the code for importing the module in the user interface file according to the module information corresponding to the user interface file, and obtain the module code required by the application; Generate application code for the interface call according to the interface parameters and the return value information.
[0058] Optionally, generating a code for importing a module in the user interface file according to the module information corresponding to the user interface file specifically includes: According to the application interface calling file template and the module information, compile and obtain the module corresponding to the user interface file based on the compilation configuration file; The module corresponding to the user interface file is imported, and the module corresponding to the user interface file is tested, and the code of the imported module in the user interface file is obtained based on the test result.
[0059] Optionally, generating the application code for the interface call according to the interface parameters and the return value information specifically includes: Define an interface function for receiving the parameter, and perform parameter checking on the parameter through the interface function to ensure that the parameter is a number; Generate application code for the interface call according to the parameter, the return value and the interface function.
[0060] Optionally, generating a test case for interface testing according to the module code and the application code called by the interface specifically includes: Configure the test framework and assertion library; In the test project directory, create a test file, and generate test cases for verifying the interface function according to the module code and the application code called by the interface; The test interface is tested based on the test case, and the corresponding test result is displayed.
[0061] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a test case generation program for a test interface, and when the test case generation program for the test interface is executed by a processor, the steps of the test case generation method for the test interface as described above are implemented.
[0062] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or terminal including the element.
[0063] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0064] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A test case generation method for a test interface, characterized in that: The test case generation method of the test interface includes: Parse user interface files and interface information; Generate the module code required by the application and the application code called by the interface according to the parsed file information, interface parameters and return value information; A test case for interface testing is generated according to the module code and the application code called by the interface.
2. The test case generation method for a test interface according to claim 1, characterized in that: The parsing of the user interface file and the interface information specifically includes: Parsing the user interface file to obtain corresponding module information; Parsing the interface information in the user interface file; Obtain the number of parameters, parameter types, and return value type information in the user interface file.
3. The test case generation method for a test interface according to claim 2, characterized in that: The parsing of the user interface file to obtain corresponding module information specifically includes: Create a plugin configuration file and create a file containing the N-API plugin code; Compile the plug-in configuration file and the file containing the N-API plug-in code to obtain a parsing plug-in; The parsing plug-in is run, and the user interface file is parsed based on the parsing plug-in to obtain corresponding module information.
4. The test case generation method for a test interface according to claim 1, characterized in that: The generating of the module code required by the application and the application code called by the interface according to the parsed file information, interface parameters and return value information specifically includes: Define application interface call file template and interface call template; Generate the code for importing the module in the user interface file according to the module information corresponding to the user interface file, and obtain the module code required by the application; Generate application code for the interface call according to the interface parameters and the return value information.
5. The test case generation method for a test interface according to claim 4, characterized in that: The step of generating a code for importing a module in the user interface file according to the module information corresponding to the user interface file specifically includes: According to the application interface calling file template and the module information, compile and obtain the module corresponding to the user interface file based on the compilation configuration file; The module corresponding to the user interface file is imported, and the module corresponding to the user interface file is tested, and the code of the imported module in the user interface file is obtained based on the test result.
6. The test case generation method for a test interface according to claim 1, characterized in that: The generating the application code for the interface call according to the interface parameters and the return value information specifically includes: Define an interface function for receiving the parameter, and perform parameter checking on the parameter through the interface function to ensure that the parameter is a number; Generate application code for the interface call according to the parameter, the return value and the interface function.
7. The test case generation method for a test interface according to claim 1, characterized in that: The generating of a test case for interface testing according to the module code and the application code called by the interface specifically includes: Configure the test framework and assertion library; In the test project directory, create a test file, and generate test cases for verifying the interface function according to the module code and the application code called by the interface; The test interface is tested based on the test case, and the corresponding test result is displayed.
8. A test case generation system for a test interface, characterized in that: The test case generation system of the test interface includes: Parsing module, used for parsing user interface files and interface information; The code generation module is used to generate the module code required by the application and the application code called by the interface according to the parsed file information, interface parameters and return value information; The test case generation module is used to generate a test case for interface testing according to the module code and the application code called by the interface.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a test case generation program for a test interface stored in the memory and executable on the processor. When the test case generation program for the test interface is executed by the processor, the steps of the test case generation method for the test interface as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a test case generation program for a test interface, and when the test case generation program for the test interface is executed by a processor, the steps of the test case generation method for the test interface as described in any one of claims 1-7 are implemented.
