Automatic testing method, device and equipment and storage medium
By generating test case templates and using a large language model to call interface functions, automated testing of automotive components was achieved. This solved the problem of the manpower and material resources required for manually writing test code in existing technologies, improving testing efficiency and reducing maintenance costs.
Patent Information
- Application Number
- CN202511201720.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-12-19
AI Technical Summary
In the current technology, testing of automotive components requires manually writing automated test code, which is labor-intensive and resource-intensive, and the cost of subsequent maintenance and changes is high.
By reading the requirements document, test case templates are generated, and the interface functions are called from the interface function database using a large language model to generate test programs, thus achieving automated testing.
It has enabled automated testing of automotive parts, improving testing efficiency, saving manpower and resources, and reducing code writing and maintenance work.
Smart Images

Figure CN121166532A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of automobile design, in particular, to an automatic testing method, device, equipment and storage medium. BACKGROUND
[0002] In the process of automobile manufacturing, the whole vehicle hardware, software and functions of the automobile need to be tested to ensure the rationality and practicability of the whole vehicle design. In the prior art, when testing the parts of the automobile, corresponding test codes need to be manually written, and then the test codes are run to test various functions of the parts.
[0003] In the prior art, a special automatic test personnel needs to write codes for testing according to the characteristics of the automatic test codes, which consumes manpower and material resources, and the cost of later maintenance and change of the automatic test codes is huge. SUMMARY
[0004] Embodiments of the present application provide an automatic testing method, device, equipment and storage medium, which aims to realize automatic testing of automobile parts.
[0005] The first aspect of the embodiments of the present application provides an automatic testing method, which comprises: reading a requirement document to determine the test requirements corresponding to the requirement document; generating test cases corresponding to the test requirements according to a test case template; inputting the test cases into a large language model; calling the interface functions corresponding to the test cases from a pre-created interface function database through the large language model to generate test programs corresponding to the test requirements; executing corresponding test tasks through the test programs.
[0006] Optionally, before reading the requirement document to determine the test requirements corresponding to the requirement document, the method further comprises: determining the interface functions corresponding to each test device; storing the interface functions of each test device into the interface function database; creating corresponding function annotations according to the function effects of the interface functions.
[0007] Optionally, the method further comprises: creating a table file; adding a function annotation corresponding to the interface function in each row of the table file to obtain the test case template.
[0008] Optionally, the generating the test case corresponding to the test requirement according to the test case template comprises: dividing the test requirement into corresponding test steps; finding a function annotation corresponding to each of the test steps in the test case template; substituting a keyword in each of the test steps into a designated position of the function annotation to obtain the test case.
[0009] Optionally, the calling the interface function corresponding to the test case from the pre-created interface function database through the large language model to generate the test program corresponding to the test requirement comprises: matching a corresponding function annotation for each of the test steps in the test case through the large language model; determining a prompt word corresponding to the function annotation through the large language model; calling the interface function corresponding to the test case according to the prompt word through the large language model to generate the test program.
[0010] Optionally, before the calling the interface function corresponding to the test case from the pre-created interface function database through the large language model to generate the test program corresponding to the test requirement, the method further comprises: determining a function name and a corresponding parameter corresponding to each line of function annotation in the test case template; generating a corresponding prompt word for each line of the function annotation according to the function name and the corresponding parameter.
[0011] Optionally, the executing a corresponding test task through the test program comprises: running the test program in a test device corresponding to the test task; testing a to-be-tested device through the test device; receiving test data generated by the to-be-tested device in the testing process.
[0012] The second aspect of the embodiments of the present application provides an automatic testing device, and the device comprises: a test requirement generation module configured to read a requirement document and determine a test requirement corresponding to the requirement document; a test case generation module configured to generate a test case corresponding to the test requirement according to a test case template; a test case input module configured to input the test case into a large language model; A test program generation module is configured to invoke, by the large language model, an interface function corresponding to the test case from a pre-created interface function database to generate a test program corresponding to the test requirement. A test task execution module is configured to execute a corresponding test task by the test program.
[0013] Optionally, the apparatus further comprises: An interface function determination module is configured to determine an interface function corresponding to each device to be tested. A database creation module is configured to store the interface function of each device to be tested into the interface function database. A function annotation module is configured to create a corresponding function annotation according to the function of the interface function.
[0014] Optionally, the apparatus further comprises: A table creation module is configured to create a table file. A template generation module is configured to add a function annotation corresponding to the interface function in each row of the table file to obtain a test case template.
[0015] Optionally, the test case generation module comprises: A test step determination submodule is configured to divide the test requirement into corresponding test steps. A function annotation determination submodule is configured to find a function annotation corresponding to each test step in the test case template. A test case generation submodule is configured to substitute a keyword in each test step into a designated position of the function annotation to obtain the test case.
[0016] Optionally, the test program generation module comprises: A function annotation matching submodule is configured to match, by the large language model, a function annotation corresponding to each test step in the test case. A prompt word determination submodule is configured to determine, by the large language model, a prompt word corresponding to the function annotation. A test program generation submodule is configured to invoke, by the large language model, an interface function corresponding to the test case according to the prompt word to generate the test program.
[0017] Optionally, the apparatus further comprises: A function determination module is configured to determine a function name and corresponding parameters of each row of function annotation in the test case template. A prompt word generation module is configured to generate a corresponding prompt word for each row of function annotation according to the function name and the corresponding parameters.
[0018] Optionally, the test task execution module comprises: a test program running submodule, configured to run the test program in the test device corresponding to the test task; a device testing submodule, configured to test the to-be-tested device by the test device; a test data receiving submodule, configured to receive test data generated by the to-be-tested device in the testing process.
[0019] The third aspect of the embodiments of the present application provides a readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method in the first aspect of the present application.
[0020] The fourth aspect of the embodiments of the present application provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method in the first aspect of the present application when executing the computer program.
[0021] The automatic testing method provided in the present application reads the requirement document to determine the test requirements corresponding to the requirement document, generates the test case corresponding to the test requirements according to the test case template, inputs the test case into the large language model, calls the interface function corresponding to the test case from the pre-created interface function database through the large language model, generates the test program corresponding to the test requirements, and executes the corresponding test task through the test program.
[0022] In the method, the test case template is pre-written, the corresponding test case is generated according to the test case template in the case of obtaining the requirement document, the interface function corresponding to the test case is called through the large model, the test program corresponding to the test requirements is generated, and then the corresponding test task is executed, thereby realizing the automatic testing of the automobile, improving the efficiency of the automobile component testing, and saving manpower and material resources. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0024] Figure 1 is a structural diagram of the automatic testing system provided by an embodiment of the present application; Figure 2 is a flowchart of the automatic testing method provided by an embodiment of the present application; Figure 3An automatic test flowchart proposed by an embodiment of the present application; Figure 4 A schematic diagram of an automatic test device proposed by an embodiment of the present application; Figure 5 A schematic diagram of an electronic device proposed by an embodiment of the present application. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of the present application.
[0026] The test of a vehicle is performed in the research and development design stage of the vehicle, for verifying the performance, function, durability, reliability of parts, systems and the whole vehicle, finding design defects, and optimizing design. When testing the vehicle, the corresponding code needs to be run to perform the test task, so as to complete the test of the vehicle. The present application performs automatic test of the vehicle through an automatic test system, which generates automatic test code based on a large model and performs the corresponding test task. Referring to Figure 1 , Figure 1 A structural diagram of an automatic test system proposed by an embodiment of the present application, as shown in Figure 1 , the system includes a test case template module, a test device API module, and a large language model prompt word module. The system has the functions of storing the code of API (interface function), creating a test case template, writing a test case, writing a prompt word of a large language model, and generating automatic test code through a large model. The test requirement document is input into the system, and the automatic test code can be generated. Then the code is sent to the test device to perform the test of the vehicle.
[0027] Referring to Figure 2 , Figure 2 A flowchart of an automatic test method proposed by an embodiment of the present application, as shown in Figure 2 , specifically comprising the following steps: S11: reading a requirement document to determine the test requirement corresponding to the requirement document.
[0028] In the embodiment, the requirement document is a document recording the test requirement, and the test requirement includes information such as the parts to be tested and the functions to be tested.
[0029] In the embodiment, when testing the parts of the vehicle, the requirement document is first read by the automatic test system to extract the keywords in the document and determine the test requirement corresponding to the requirement document.
[0030] For example, the requirement document can be a table type document, for example, the content in the document is to test the seat heating function of a car, to determine whether the seat heating of the car is running normally, whether the preset temperature can be reached within a set time, etc., and the corresponding test requirement is to start the seat heating function, heat the seat to the preset temperature value, etc.
[0031] S12: generating a test case corresponding to the test requirement according to the test case template.
[0032] In this embodiment, the test case template is pre-constructed and includes annotations of interface functions corresponding to each test device. The test case includes specific test steps for testing the function of the target component.
[0033] In this embodiment, after determining the test requirement, the annotations of the interface functions stored in the test case template are searched, the content line completely applicable to the test step corresponding to the test requirement is found, the test step is written according to the format of the content line, and then the test case is obtained.
[0034] For example, one of the test steps in the test requirement is to read a signal, the tester checks the test case template, finds the annotation corresponding to the interface function used to read the signal in the test case template, and writes the corresponding test case according to the annotation.
[0035] S13: inputting the test case into a large language model.
[0036] In this embodiment, the large language model masters the complex rules of human language through massive text training and can complete text generation, logical reasoning, knowledge question and answer, etc.
[0037] In this embodiment, the automatic test system inputs the test case into the large language model.
[0038] S14: calling the interface function corresponding to the test case from a pre-created interface function database through the large language model to generate a test program corresponding to the test requirement.
[0039] In this embodiment, the interface function database is used to store the interface functions used for testing each component and function. The interface function (API, Application Programming Interface) is a pre-defined function and a bridge for interaction between different software systems, which realizes data transmission or function calling through defined functions, protocols, etc.
[0040] In this embodiment, the large language model analyzes the test case, and the large language model matches the corresponding content line in the template according to each step of the test case, then matches the corresponding prompt word according to the content line, and finally the large language model generates the automatic test code, that is, the test program, by using the test step, the pre-generated prompt word and the code of the corresponding interface function.
[0041] For example, the system runs the large language model, the large language model matches the corresponding content line in the template according to one of the test steps, after finding the corresponding content line, the large language model matches the corresponding prompt word according to the content line, the large language model runs the prompt word, and the large language model generates the automatic test code of the test step, that is, the test program, by combining the function code in the test recognition API module.
[0042] S15: Perform the corresponding test task through the test program.
[0043] In this embodiment, after obtaining the test program, the test device runs the test program to test the to-be-tested device.
[0044] For example, after obtaining the test program for testing the seat heating function, the test program is run in the seat heating controller to obtain the corresponding test data.
[0045] In this embodiment, the corresponding test case is generated through the test requirement, and the corresponding test code is generated through the large language model according to the test case, and then the automatic test of the automobile is completed.
[0046] In another embodiment of the present application, before reading the requirement document and determining the test requirement corresponding to the requirement document, the method further comprises: S21: Determine the interface function corresponding to each to-be-tested device.
[0047] In this embodiment, the to-be-tested device is a device that needs to be tested for hardware or function in the automobile design process.
[0048] In this embodiment, each test device has a corresponding interface function for testing the test device by calling these interface functions, and first the interface function corresponding to each to-be-tested device needs to be determined.
[0049] S22: Store the interface function of each to-be-tested device into the interface function database.
[0050] In this embodiment, the interface function database is used to store the interface function and provides the function of finding the interface function.
[0051] In the embodiment, the interface function of each device to be tested is stored in the interface function database, so that the interface function corresponding to the test case can be called at any time.
[0052] S23: According to the function of the interface function, the corresponding function annotation is created.
[0053] In the embodiment, the function annotation is used to represent the function of the function implementation.
[0054] In the embodiment, the function annotation is also created according to the function of the interface function.
[0055] For example, an API function is can_read(signal_name, value), according to the function of the function, the code annotation of the function is created as "read can signal according to signal name XXX, judge signal value as XXX".
[0056] In the embodiment, the interface function used for testing is determined and the interface function database is created, the calling of the interface function is realized, and the interface function is annotated, so that the large model can call the corresponding interface function according to the annotation, and the testing efficiency is improved.
[0057] In another embodiment of the present application, the method further comprises: S31: Create a table file.
[0058] S32: Add a function annotation corresponding to the interface function in each row of the table file to obtain the test case template.
[0059] In the embodiment, the function annotation corresponding to each interface function is stored in the test case template.
[0060] In the embodiment, when creating the test case template, a table file is first created, and then the function annotation corresponding to each interface function is added to the table file to obtain the test case template.
[0061] For example, the test case template is in excel format, and there is only one column of content, each row of content corresponds to the code annotation of a function of the interface function of the test device, and the code annotation is directly copied.
[0062] In the embodiment, by creating the test case template as the basis for automatically generating the test case, the automatic generation of the test program is facilitated.
[0063] In another embodiment of the present application, the test case corresponding to the test requirement is generated according to the test case template, which comprises: S41: The test requirement is divided into corresponding test steps.
[0064] In this embodiment, the components, functions, etc. that need to be tested are listed in the test requirements, and the test requirements are analyzed to divide the test requirements into corresponding test steps.
[0065] For example, the test requirement is to test whether the seat heating function of the vehicle is normally started, whether the seat is heated to the preset temperature within the specified time, etc. The decomposed test steps can be sending a seat heating start signal, receiving a seat heating start response signal, monitoring the seat temperature, etc.
[0066] S42: Find the function annotation corresponding to each test step in the test case template.
[0067] In this embodiment, the function annotation of the interface function of each component test is included in the test case template. In the test case template, the function annotation of the function that implements the function of each step is found, and then the function annotation of each test step is found.
[0068] For example, there is a test step that needs to read a can signal, and the signal name of this can signal is energy_mode. After reading, it is judged that the signal value is 1. At this time, the tester checks the test case template and finds that the content of a certain line is "read the can signal according to the signal name XXX, and judge that the signal value is XXX".
[0069] S43: Substitute the keywords in each test step into the specified position of the function annotation to obtain the test case.
[0070] In this embodiment, the keywords in each test step are substituted into the specified position of the function annotation, and then the keywords of each step are substituted into the function annotation to obtain the corresponding test case.
[0071] For example, there is a test step that needs to read a can signal, and the signal name of this can signal is energy_mode. After reading, it is judged that the signal value is 1. At this time, the tester checks the test case template and finds that the content of a certain line is "read the can signal according to the signal name XXX, and judge that the signal value is XXX", which is completely applicable to this test step. Therefore, when writing the test case, the tester directly writes this test step as "read the can signal according to the signal name energy_mode, and judge that the signal value is 1" according to the template content.
[0072] In this embodiment, by substituting the keywords in the test steps into the function annotation of the test case template, the test case is obtained. The generated test case includes the test steps required by the test target component and the function information of each step, which is beneficial to the generation of corresponding test code by the large model.
[0073] In another embodiment of the present application, the calling the interface function corresponding to the test case from the pre-created interface function database by the large language model to generate the test program corresponding to the test requirement comprises: S51: matching the function annotation corresponding to each test step in the test case by the large language model.
[0074] In the present embodiment, the large language model matches the function annotation corresponding to each test step in the test case after receiving the test case, and matches the corresponding content line in the test case template according to the content in the test step.
[0075] For example, the system runs the large language model, and the large language model matches the corresponding content behavior "reading the can signal according to the signal name XXX, judging the signal value as XXX" in the template according to the test step "reading the can signal according to the signal name energy_mode, judging the signal value as 1".
[0076] S52: determining the prompt word corresponding to the function annotation by the large language model.
[0077] In the present embodiment, the prompt word is a word for driving the large model to reason, and the large model performs corresponding reasoning according to the content in the prompt word.
[0078] In the present embodiment, after the function annotation is determined, the prompt word corresponding to the function annotation is determined, and the corresponding prompt word is pre-written for each function annotation in the test case template, and the corresponding prompt word can be matched through the function annotation.
[0079] For example, the large language model matches the corresponding content behavior "reading the can signal according to the signal name XXX, judging the signal value as XXX" in the template according to the test step "reading the can signal according to the signal name energy_mode, judging the signal value as 1", and then matches the corresponding prompt word "generating the code of calling function can_read, passing the signal name to the signal_name parameter, and passing the signal value to the value parameter" according to the content line.
[0080] S53: calling the interface function corresponding to the test case according to the prompt word by the large language model to generate the test program.
[0081] In the present embodiment, the large language model calls the corresponding interface function according to the prompt word after determining the prompt word corresponding to each function annotation corresponding to the test case, and generates the test program.
[0082] For example, according to the test step "read the can signal according to the signal name energy_mode, and judge that the signal value is 1", the large language model matches the corresponding content behavior "read the can signal according to the signal name XXX, and judge that the signal value is XXX" in the template, and then according to the content line, the corresponding prompt word is matched as "generate the code of the calling function can_read, pass the signal name to the signal_name parameter, and pass the signal value to the value parameter". Finally, the large language model runs the prompt word, and the large language model generates the final automatic test code of the test step as can_read(energy_mode, 1) in combination with the function code can_read(signal_name, value) in the test device API module. Other test steps in the test case are also written and generated code in the same way, so as to complete the automatic generation of the automatic test code of the full test case.
[0083] In this embodiment, the large language model analyzes the test case, matches the corresponding function annotation and prompt word, generates the corresponding test code under the driving of the prompt word, and realizes the automatic generation of the test program.
[0084] In another embodiment of the present application, before the large language model calls the interface function corresponding to the test case from the pre-created interface function database to generate the test program corresponding to the test requirement, the method further comprises: S61: Determine the function name corresponding to each line of function annotation in the test case template and the corresponding parameter.
[0085] In this embodiment, each line of function annotation in the test case template is analyzed to determine the function name corresponding to the line of function annotation and the corresponding parameter.
[0086] For example, the content of a certain line in the test case template is "read the can signal according to the signal name XXX, and judge that the signal value is XXX", the function name is the can function, and the corresponding parameters are the signal name signal_name and the signal value value.
[0087] S62: Generate a corresponding prompt word for each line of the function annotation according to the function name and the corresponding parameter.
[0088] In this embodiment, a corresponding prompt word is generated for each line of function annotation according to the function name and the corresponding parameter. The prompt word includes the function name to be called and the parameter to be defined.
[0089] For example, the content of a certain row is "read the can signal according to the signal name XXX, and judge the signal value as XXX", and the prompt word of this row of content is "generate the code of the calling function can_read, pass the signal name to the signal_name parameter, and pass the signal value to the value parameter".
[0090] In this embodiment, the corresponding prompt word is determined by analyzing the function annotation, and then the large model can be driven to generate the corresponding test program, thereby improving the efficiency of automobile testing.
[0091] In another embodiment of the present application, the execution of the corresponding test task by the test program comprises: S71: running the test program in the test device corresponding to the test task.
[0092] In this embodiment, the test device can test the to-be-tested device and test its hardware or function.
[0093] In this embodiment, the test program is run in the test device corresponding to the test task.
[0094] For example, the test task is to test the seat heating function, and the related test program of the seat heating is run in the seat heating controller.
[0095] S72: testing the to-be-tested device by the test device.
[0096] In this embodiment, the test program is run by the test device to test the to-be-tested device.
[0097] S73: receiving the test data generated by the to-be-tested device in the test process.
[0098] In this embodiment, the test data generated by the to-be-tested device in the test process is received. The test data is statistically analyzed to achieve the purpose of testing the hardware or function of the to-be-tested device.
[0099] In another embodiment of the present application, reference is made to Figure 3 , Figure 3 is an automatic test flowchart proposed in an embodiment of the present application, as shown in Figure 3As shown, the corresponding test case is generated according to the requirement document, the test case template is pre-written, which includes the function annotations of the interface functions corresponding to each test device, and the interface function database is also pre-generated, and the corresponding prompt words need to be written for each function annotation in the test case template, the test case is input into the large language model, the corresponding function annotation is matched according to each test step in the test case, and the corresponding prompt word is determined, the corresponding test code is generated according to the prompt word of each test step and the corresponding interface function, and the automatic test of the automobile is realized.
[0100] In another embodiment of the present application, the system can not only be used by users of various test devices to improve the work efficiency of test device users, but also can be integrated into test devices. The test device no longer provides the API in the form of code to the test device user, but only provides the test case template in natural language to the test device user. The test device user no longer needs to write and maintain the automatic test script code, thereby improving the ease of use and user experience of the test device.
[0101] In the above embodiments of the present application, the test case written in natural language automatically generates the automatic test code, thereby completely canceling the writing and maintenance work of the automatic test code. Only the code annotations of all APIs of the test device need to be written, and then the corresponding large language model prompt words are written. The code annotations and the large language model prompt words do not need to be maintained subsequently with the test case. The system has very little development workload, and saves manpower and time.
[0102] Based on the same inventive concept, an embodiment of the present application provides an automatic test device. Referring to Figure 4 , Figure 4 is a schematic diagram of the automatic test device 400 according to an embodiment of the present application. As shown in the figure, Figure 4 the device includes: a test requirement generation module 401 configured to read a requirement document and determine a test requirement corresponding to the requirement document; a test case generation module 402 configured to generate a test case corresponding to the test requirement according to a test case template; a test case input module 403 configured to input the test case into a large language model; a test program generation module 404 configured to call an interface function corresponding to the test case from a pre-created interface function database through the large language model, and generate a test program corresponding to the test requirement; a test task execution module 405 configured to execute a corresponding test task through the test program.
[0103] Optionally, the device further includes: An interface function determination module is configured to determine an interface function corresponding to each device to be tested; A database creation module is configured to store the interface function of each device to be tested into the interface function database; A function annotation module is configured to create a corresponding function annotation according to the function of the interface function.
[0104] Optionally, the apparatus further comprises: A table creation module is configured to create a table file; A template generation module is configured to add a function annotation corresponding to the interface function in each row of the table file to obtain the test case template.
[0105] Optionally, the test case generation module comprises: A test step determination submodule is configured to divide the test requirement into corresponding test steps; A function annotation determination submodule is configured to find a function annotation corresponding to each test step in the test case template; A test case generation submodule is configured to substitute a keyword in each test step into a specified position of the function annotation to obtain the test case.
[0106] Optionally, the test program generation module comprises: A function annotation matching submodule is configured to match a function annotation corresponding to each test step in the test case through the large language model; A prompt word determination submodule is configured to determine a prompt word corresponding to the function annotation through the large language model; A test program generation submodule is configured to call an interface function corresponding to the test case according to the prompt word through the large language model to generate the test program.
[0107] Optionally, the apparatus further comprises: A function determination module is configured to determine a function name and corresponding parameters of each row of function annotation in the test case template; A prompt word generation module is configured to generate a corresponding prompt word for each row of function annotation according to the function name and the corresponding parameters.
[0108] Optionally, the test task execution module comprises: A test program running submodule is configured to run the test program in a test device corresponding to the test task; A device testing submodule is configured to test a device to be tested through the test device; The test data receiving submodule is configured to receive test data generated by the to-be-tested device during a test.
[0109] Based on the same inventive concept, another embodiment of the present application provides an electronic device, Figure 5 FIG. 1 is a schematic diagram of an electronic device 500 according to an embodiment of the present application, which comprises a memory 502, a processor 501, and a computer program stored in the memory and executable on the processor. When the processor executes, the automatic test method according to any of the above embodiments of the present application is implemented.
[0110] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts are described in the part of the method embodiment.
[0111] Each embodiment in the present specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts between the embodiments can be referred to each other.
[0112] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, or computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0113] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device processor to produce a machine, so that the instructions executed by the computer or other programmable terminal device processor produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The device that implements the functions specified in one or more flows and / or blocks Figure 1 The device that implements the functions specified in one or more flows and / or blocks
[0114] These computer program instructions can also be stored in a computer readable storage medium that can guide the computer or other programmable terminal device to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a product comprising instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The device that implements the functions specified in one or more flows and / or blocksFigure 1 the function specified in one or more of the blocks.
[0115] These computer program instructions can also be loaded into computer or other programmable terminal device to cause a series of operational steps to be performed on the computer or other programmable terminal device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable terminal device provide steps for implementing the operations specified in the flowchart block or blocks. Figure 1 one or more of the flows or blocks Figure 1 the function specified in one or more of the blocks.
[0116] Although preferred embodiments of the application have been described, those skilled in the art will recognize that additional modifications and changes can be made thereto without departing from the scope of the present application. Accordingly, the appended claims are intended to cover all such modifications and changes as fall within the scope of the application.
[0117] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are more especially used for the purpose of identification of conceptual breach. In addition, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or terminal device. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element. In other words, the term "comprises" does not exclude the presence of additional elements that are not expressly listed or inherent to such process, method, article, or terminal device.
[0118] The above provides an automated testing method, device, equipment and storage medium, the principle and implementation mode of the present application are described in the text by applying specific examples, the above example is only used to help understand the method and core idea of the present application; At the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; The above description of the present application should not be understood as a limitation.
Claims
1. An automated testing method, characterized in that, The method includes: Read the requirements document and determine the test requirements corresponding to the requirements document; Generate test cases corresponding to the test requirements based on the test case template; Input the test cases into the large language model; The test program corresponding to the test requirement is generated by calling the interface function corresponding to the test case from the pre-created interface function database through the large language model. The corresponding test task is executed through the test program.
2. The automated testing method according to claim 1, characterized in that, Before reading the requirements document and determining the test requirements corresponding to the requirements document, the method further includes: Determine the corresponding interface function for each device under test; Store the interface functions of each device under test into the interface function database; Create corresponding function comments based on the function's purpose in the interface.
3. The automated testing method according to claim 2, characterized in that, The method further includes: Create a spreadsheet file; Add a function comment corresponding to the interface function to each row of the table file to obtain the test case template.
4. The automated testing method according to claim 1, characterized in that, The step of generating test cases corresponding to the test requirements based on the test case template includes: The test requirements are divided into corresponding test steps; Find the function comment corresponding to each test step in the test case template; The test cases are obtained by substituting the keywords from each test step into the specified positions in the function comments.
5. The automated testing method according to claim 1, characterized in that, The step of calling the interface function corresponding to the test case from the pre-created interface function database through the large language model to generate the test program corresponding to the test requirement includes: The large language model is used to match corresponding function annotations for each test step in the test case. The prompt words corresponding to the function annotations are determined using the large language model. The test program is generated by calling the corresponding interface function of the test case based on the prompt word using the large language model.
6. The automated testing method according to claim 1, characterized in that, Before generating the test program corresponding to the test requirement by calling the interface function corresponding to the test case from the pre-created interface function database through the large language model, the method further includes: Determine the function name and corresponding parameters for each line of function comments in the test case template; Based on the function name and the corresponding parameters, generate corresponding prompt words for each line of the function comment.
7. The automated testing method according to claim 1, characterized in that, The execution of the corresponding test task through the test program includes: The test program is run on the test equipment corresponding to the test task. The device under test is tested using the aforementioned test equipment; Receive test data generated by the device under test during the test process.
8. An automated testing device, characterized in that, The device includes: The test requirement generation module is used to read the requirement document and determine the test requirements corresponding to the requirement document; The test case generation module is used to generate test cases corresponding to the test requirements based on the test case template. The test case input module is used to input the test cases into the large language model; The test program generation module is used to call the interface function corresponding to the test case from the pre-created interface function database through the large language model to generate the test program corresponding to the test requirement. The test task execution module is used to execute the corresponding test tasks through the test program.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.