Test case creation method and device, electronic equipment and storage medium
By obtaining engineering parameters from real-time test application software and using EXCEL tools to create and modify test case templates, the problem of inefficient creation of test case in the existing technology is solved, and the effect of quickly generating multiple test cases is achieved.
Patent Information
- Application Number
- CN202411891658.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The creation of test cases in the prior art is inefficient, and testers need to manually write a large number of test cases, resulting in low efficiency.
By obtaining engineering parameters from real-time test application software, using EXCEL tools to create test case templates, and copy and modify the templates to generate multiple target test cases.
It improves the efficiency of creating test cases, reduces the time and effort of testers to manually write test cases, and realizes the rapid generation of multiple test cases.
Smart Images

Figure CN119807060A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a method, device, electronic device and storage medium for creating a test case. Background Art
[0002] As autonomous driving technology continues to advance, the requirements for vehicle reliability are increasing. To meet this high standard, autonomous vehicle simulation in simulation verification test scenarios becomes critical. To ensure comprehensive test coverage, a large number of test cases must be designed and executed to fully verify the stability and accuracy of the system to meet the stringent challenges faced by autonomous driving technology.
[0003] In the prior art, a large number of test cases are usually written one by one by testers and imported into simulation automation testing software for simulation automation testing, resulting in low efficiency in creating test cases. Summary of the invention
[0004] Based on the above problems, the present application provides a test case creation method, device, electronic device and storage medium, the purpose of which is to improve the efficiency of test case creation.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] In a first aspect, the present application provides a method for creating a test case, comprising:
[0007] In response to an instruction to import a target engineering object, obtaining engineering parameters corresponding to the target engineering object from the real-time test application software;
[0008] In response to the export instruction, calling the EXCEL tool to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain the test case template;
[0009] In response to the instruction of test case generation, based on the test case template, the EXCEL tool is called to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases.
[0010] Optionally, in the method as described above, in response to the instruction of test case generation, based on the test case template, calling the EXCEL tool to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases, including:
[0011] In response to the instruction of test case generation, based on the test case template, calling the EXCEL tool to copy the test case template to obtain a plurality of first test cases;
[0012] Calling the EXCEL tool to modify the target parameter value of each first test case in the plurality of first test cases respectively, to obtain a plurality of second test cases; the target parameter value of each second test case in the plurality of second test cases is different;
[0013] Based on the expected results corresponding to each of the second test cases input by the user, multiple target test cases are obtained.
[0014] Optionally, in the method as described above, in response to the instruction to import the target engineering object, obtaining engineering parameters corresponding to the target engineering object from the real-time test application software includes:
[0015] In response to an instruction to import a target engineering object, a middleware program is used to parse engineering information corresponding to the target engineering object obtained from the real-time test application software to obtain engineering parameters corresponding to the target engineering object; the middleware program communicates with the real-time test application software via the ASAM XIL protocol.
[0016] Optionally, in the method described above, the engineering parameters corresponding to the target engineering object include input variables, output variables and parameter configurations.
[0017] Optionally, in the method as described above, for each target test case in the multiple target test cases, the method further includes:
[0018] Based on the target test case, generate a test script corresponding to the target test case;
[0019] Performing real-time test application library configuration on the test script and adding simulation functions to obtain an executable test script; the simulation functions are used to perform data interaction with the simulation model in the real-time test application software;
[0020] In response to the start execution instruction, the real-time test application software is called to perform simulation testing based on the executable test script to obtain simulation data.
[0021] Optionally, in the method as described above, in response to the start running instruction, calling the real-time test application software to perform simulation testing based on the executable test script to obtain simulation data includes:
[0022] In response to a start-run instruction, the start-run instruction is sent to the real-time test application software through a middleware program, so that the real-time test application software obtains the executable test script and executes the executable test script to generate simulation data;
[0023] In response to an end-of-run instruction sent by the real-time test application software through a middleware program, simulation data corresponding to the executable test script is acquired from the real-time test application software.
[0024] Optionally, the method as described above further includes:
[0025] Based on the simulation data, determining a simulation curve corresponding to the target test case;
[0026] Determining the execution result of the target test case based on the simulation data and the expected result corresponding to the target test case;
[0027] According to the simulation curve and execution results corresponding to each target test case, a test report is generated for display to the user.
[0028] In a second aspect, the present application provides a test case creation device, comprising:
[0029] An acquisition module, configured to acquire engineering parameters corresponding to the target engineering object from the real-time test application software in response to an instruction to import the target engineering object;
[0030] The template creation module is used to call the EXCEL tool in response to the export instruction to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain the test case template;
[0031] The test case generation module is used to respond to the instruction of test case generation, based on the test case template, call the EXCEL tool to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases.
[0032] In a third aspect, the present application provides an electronic device, the device comprising: a processor, and a memory communicatively connected to the processor;
[0033] Memory stores computer-executable instructions;
[0034] The processor executes the computer-executable instructions stored in the memory to implement the test case creation method described in any one of the above embodiments.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the test case creation method described in any of the above embodiments.
[0036] In response to the instruction to import the target engineering object, the engineering parameters corresponding to the target engineering object are obtained from the real-time test application software; then in response to the export instruction, the EXCEL tool is called to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain a test case template; then in response to the instruction to generate the test case, based on the created test case template, the EXCEL tool is called to copy the test case template and modify the target parameter values in the test case template to obtain multiple target test cases. The method of the present application uses a preset template and engineering parameters obtained from the real-time test application software. By creating a test case template through the EXCEL tool, and copying and modifying the target parameter values of the test case template, multiple test cases in the current scenario can be obtained without the need for testers to write them one by one, thereby improving the efficiency of test case creation. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0038] Figure 1 A flowchart of an embodiment of a method for creating a test case provided by the present application;
[0039] Figure 2 is a schematic diagram of a test case template in this embodiment;
[0040] Figure 3 A flowchart of another embodiment of a method for creating a test case provided by the present application;
[0041] Figure 4 A flowchart of another embodiment of a method for creating a test case provided by the present application;
[0042] Figure 5 A schematic diagram of the structure of an embodiment of a test case creation device provided by the present application;
[0043] Figure 6 A schematic diagram of the structure of another embodiment of a test case creation device provided by the present application;
[0044] Figure 7 A structural schematic diagram of another embodiment of a test case creation device provided by the present application;
[0045] Figure 8A schematic structural diagram of an embodiment of an electronic device provided in the present application. DETAILED DESCRIPTION
[0046] As described above, the main method of creating test cases is to rely on manual writing by testers. They need to write test cases one by one according to the test requirements, resulting in low efficiency in test case creation.
[0047] After research, the inventors have proposed a test case creation method, device, electronic device and storage medium to solve the technical problem of low test case creation efficiency in the prior art.
[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution 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 are within the scope of protection of this application.
[0049] See also Figure 1 , which is a flow chart of an embodiment of a method for creating a test case provided by the present application. The method is applied to TestManger software, which is used for modeling and simulating automated testing. Figure 1 As shown, the method includes:
[0050] S101: In response to an instruction to import a target engineering object, obtaining engineering parameters corresponding to the target engineering object from real-time test application software.
[0051] In this embodiment, for example, the middleware program is a XILServer middleware program developed based on C# language; the real-time test application software is NI VeriStand software. After receiving the instruction of importing the target engineering object issued by the user, the engineering information corresponding to the target engineering object is obtained from the NI VeriStand software using the XIL Server middleware program, and the obtained engineering information is parsed and processed using the XIL Server middleware program to obtain the engineering parameters corresponding to the target engineering object. Among them, the engineering parameters corresponding to the target engineering object include but are not limited to input variables, output variables and parameter configuration.
[0052] S102: In response to the export instruction, calling the EXCEL tool to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain a test case template.
[0053] In this embodiment, in response to the export instruction, the EXCEL tool is called to export the preset template and the target parameters required to create the current test case selected by the user from the engineering parameters according to requirements to the EXCEL tool, so that the user can write the format description based on the preset use case and use the EXCEL tool to create a test case template in the preset template, thereby obtaining a test case template.
[0054] For example, the preset template may include but is not limited to the use case unique identifier, type, type name, use case details description, test case parameter initialization, step description and expected results. Specifically, the use case unique identifier is the identification of the test case, which is used for unique management of the use case; the type includes the use case and the step, and a use case can contain multiple steps; the type name includes the test case name corresponding to the use case and the step name corresponding to the step; the test case parameter initialization is to set the parameters of the initialization state, loop state, exit state and exit condition based on the target parameters.
[0055] It is understandable that in order to facilitate the tester's understanding, the user can describe the use case details and step description items in the preset template.
[0056] For example, the preset use case writing format description includes initialization state, loop state, exit state, exit condition, pass condition, and use case parameter call, etc. Among them, the initialization state is used to set the python output, that is, to assign values to the model input in the NIVeriStand software, and the writing format is: set_xxx=1; the loop state is to accumulate / subtract the model input in a specified form within a given time, and the writing format is: loop_xxx+=1; the exit state is to assign values to the model output after the step ends, and its state writing format is: end_xxx=1, etc.; the exit condition is the exit condition for the end of the configuration step, for example: if there is an expression for the exit step, the writing format is [keyword_(exit condition expression) / whether to exit the working condition mark / maximum duration]; if there is no expression for the exit step, the writing format is [keyword_whether to exit the working condition mark / maximum duration] or [keyword_() / whether to exit the working condition mark / maximum duration].
[0057] Specifically, taking the acceleration test of a vehicle as an example, the test case template obtained is as follows: Figure 2 As shown, the initialization state is set_EngineOnOff=1, which means starting the engine; the loop state is loop accelerator+=0.1, which means stepping down the accelerator pedal step by step; the exit condition is wait_(accelerator==1) / 0 / 10, which means the step will be exited until the accelerator pedal is opened to 100%, or the acceleration lasts for more than 10 seconds.
[0058] S103: In response to the instruction of test case generation, based on the test case template, calling the EXCEL tool to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases.
[0059] In this embodiment, in response to the instruction of test case generation, based on the created test case template, the EXCEL tool is called to copy the test case template to obtain multiple identical test case templates; then the target parameter value of each test case template in these identical test case templates is modified by the EXCEL tool to obtain multiple test cases with different target parameter values. In response to the user inputting the corresponding expected result in each second test case, multiple target test cases are obtained.
[0060] In this embodiment, in response to the instruction to import the target engineering object, the engineering parameters corresponding to the target engineering object are obtained from the real-time test application software; then in response to the export instruction, the EXCEL tool is called to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain a test case template; then in response to the instruction to generate the test case, based on the created test case template, the EXCEL tool is called to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases. The method of the present application uses a preset template and engineering parameters obtained from the real-time test application software. By creating a test case template through the EXCEL tool, and copying and modifying the target parameter value of the test case template, multiple test cases in the current scenario can be obtained without the need for testers to write one by one, thereby improving the efficiency of test case creation.
[0061] See also Figure 3 , which is a flowchart of another embodiment of a test case creation method provided by the present application. Figure 1 , Figure 3 A specific implementation method of "in response to the instruction of test case generation, based on the test case template, calling the EXCEL tool to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases" in S103 is shown, specifically combined with Figure 3 Introduced in S1031-S1033.
[0062] S1031: In response to the instruction for generating the test case, based on the test case template, calling the EXCEL tool to copy the test case template to obtain a plurality of first test cases.
[0063] In this embodiment, for example, if 10 test cases are created, then in response to the instructions for generating the test cases, based on the test case template, the EXCEL tool is called to copy the test case template 10 times to obtain 10 first test cases. At this time, the target parameter values in these first test cases are the same.
[0064] S1032: Calling an EXCEL tool to modify the target parameter value of each of the multiple first test cases respectively to obtain multiple second test cases.
[0065] Among them, the target parameter value of each second test case in the multiple second test cases is different.
[0066] In this embodiment, the EXCEL tool is called to modify the target parameter values in the 10 first test cases obtained. For example, Figure 2 The test case shown in is continuous acceleration to 100% throttle, and the continuous acceleration to 100% throttle is modified to continuous acceleration to 30% throttle, continuous acceleration to 50% throttle, etc. Specifically, the value in accelerator==1 is modified to accelerator==0.3, accelerator==0.5, etc., thereby obtaining multiple second test cases.
[0067] S1033: Obtain multiple target test cases based on the expected results corresponding to each second test case input by the user.
[0068] In this embodiment, for example, the user inputs the expected result corresponding to each second test case for each second test case, and obtains the target test case corresponding to each second test case.
[0069] In this embodiment, in response to an instruction to generate a test case, based on the test case template, an EXCEL tool is called to copy the test case template to obtain multiple first test cases; then the EXCEL tool is called to modify the target parameter value of each first test case in the multiple first test cases to obtain multiple second test cases, and based on the expected results corresponding to each second test case input by the user, multiple target test cases are obtained, thereby realizing the rapid creation of multiple target test cases and improving the efficiency of test case creation.
[0070] Combination Figure 3 As shown, before executing S1031-S1033, referring to the previous embodiment, S101-S102 are executed to obtain the engineering parameters and create the test case template.
[0071] See also Figure 4, which is a flowchart of another embodiment of a test case creation method provided by the present application. Figure 1 , Figure 4 A specific implementation method of "obtaining engineering parameters corresponding to the target engineering object from the real-time test application software in response to an instruction to import the target engineering object" in S101 is shown, specifically in combination with Figure 4 Introduction to S1011.
[0072] S1011: In response to an instruction to import a target engineering object, the engineering information corresponding to the target engineering object obtained from the real-time test application software is parsed using a middleware program to obtain engineering parameters corresponding to the target engineering object.
[0073] The middleware program communicates with the real-time test application software through the ASAM XIL protocol.
[0074] In this embodiment, in response to the user's instruction to import the target engineering object, the XILServer middleware program is called through TCP communication, so that the XIL Server middleware program obtains the engineering information corresponding to the target engineering object from the NIVeriStand software through the ASAM XILAPI interface protocol, and uses the XILServer middleware program to perform engineering analysis on the obtained engineering information, thereby obtaining the engineering parameters corresponding to the target engineering object.
[0075] In this embodiment, in response to the user's instruction to import the target engineering object, the middleware program is called to obtain the parsed engineering parameters from the real-time test application software, thereby achieving automatic export and parsing of the engineering information of the target engineering object from the real-time test application software, thereby improving the efficiency and accuracy of obtaining the engineering parameters.
[0076] Combination Figure 4 As shown, after executing S1011, referring to the previous embodiment, S102-S103 are executed to obtain multiple target test cases.
[0077] Further, based on the above embodiment, for each target test case in the multiple target test cases, the method may further include:
[0078] Based on the target test case, generate the test script corresponding to the target test case.
[0079] In this embodiment, TestManger generates a Python test script corresponding to the target test case based on the obtained target test case.
[0080] The real-time test application library is configured for the test script and simulation functions are added to obtain an executable test script.
[0081] Among them, the simulation function is used to exchange data with the simulation model in the real-time test application software.
[0082] In this embodiment, the generated python test script is configured with the NIVeriStand library, and a simulation function is added to obtain an executable test script that can be used for simulation testing.
[0083] In response to the start-run instruction, the real-time test application software is called to perform simulation testing based on the executable test script to obtain simulation data.
[0084] In this embodiment, in response to a start-run instruction issued by a user, TestManger calls NI Veristand through the XIL Server middleware program to perform simulation testing based on the obtained executable test script and obtain simulation data.
[0085] In this embodiment, based on the target test case, a test script corresponding to the target test case is generated; the test script is configured with a real-time test application library and a simulation function is added to obtain an executable test script; in response to a start running instruction, the real-time test application software is called to perform a simulation test based on the executable test script to obtain simulation data, thereby reducing the time and effort of manually writing scripts, thereby speeding up the testing process and improving the efficiency of simulation testing.
[0086] Further, based on the above embodiment, a specific implementation of “in response to the start running instruction, calling the real-time test application software to perform simulation testing based on the executable test script to obtain simulation data” includes:
[0087] In response to the start running instruction, the start running instruction is sent to the real-time test application software through the middleware program, so that the real-time test application software obtains and executes the executable test script to generate simulation data.
[0088] In this embodiment, TestManager responds to the start-run instruction issued by the user and sends the start-run instruction to NI VeriStand software through the XILServer middleware program. In response to the start-run instruction, NI VeriStand software obtains the executable test script from TestManager and executes the executable test script, performs simulation testing and obtains simulation data corresponding to the executable test script.
[0089] In response to an end-of-run instruction sent by the real-time test application software through the middleware program, simulation data corresponding to the executable test script is acquired from the real-time test application software.
[0090] In this embodiment, when the executable test script completes the simulation test, the NI VeriStand software sends an end-of-run instruction to the TestManager through the XILServer middleware program. In response to the end-of-run instruction, the TestManager obtains the simulation data corresponding to the executable test script from the NI VeriStand software.
[0091] In this embodiment, in response to a start-run instruction, the start-run instruction is sent to the real-time test application software through a middleware program, so that the real-time test application software obtains and executes an executable test script to generate simulation data; and then in response to an end-run instruction sent by the real-time test application software through the middleware program, the simulation data corresponding to the executable test script is obtained from the real-time test application software. The method of the present application transmits the start-run instruction and the end-run instruction through the middleware program, which can ensure that the instructions can be quickly and accurately conveyed to the real-time test application software and TestManager, thereby improving the response of the simulation test.
[0092] Furthermore, based on the above embodiment, the method may further include:
[0093] Based on the simulation data, the simulation curve corresponding to the target test case is determined.
[0094] In this embodiment, a corresponding simulation curve is drawn based on the acquired simulation data.
[0095] Based on the simulation data and the expected results corresponding to the target test case, the execution result of the target test case is determined.
[0096] In this embodiment, based on the obtained simulation data and the expected result corresponding to the target test case, it is determined whether the test has passed. If the data obtained by simulation does not reach the expected result, it means that the execution result is that the test has failed; if the data obtained by simulation reaches the expected result, it means that the execution result is that the test has passed. For example, Figure 2 As shown in the figure, the obtained simulation data is the vehicle speed, and the expected result corresponding to the current target test case is velocity.value>50, which means that the expected result is that the vehicle speed exceeds 50. If the obtained vehicle speed is 45, the corresponding execution result is failed; if the obtained vehicle speed is 55, the corresponding execution result is failed.
[0097] According to the simulation curve and execution results corresponding to each target test case, a test report is generated for display to the user.
[0098] In this embodiment, a test report is generated in the form of charts, documents, etc. according to the simulation curve and execution results corresponding to each target test case, and is displayed to the user.
[0099] In this embodiment, based on the simulation data, the simulation curve corresponding to the target test case is determined; then based on the simulation data and the expected results corresponding to the target test case, the execution results of the target test case are determined, and the simulation curve and execution results corresponding to each target test case are used to generate a test report for display to the user, providing intuitive and clear test results so that users can quickly obtain test conclusions.
[0100] See also Figure 5 , which is a structural schematic diagram of an embodiment of a test case creation device provided by the present application. Figure 5 As shown, the device 50 includes an acquisition module 51 , a template creation module 52 and a test case generation module 53 .
[0101] The acquisition module 51 is used for acquiring engineering parameters corresponding to the target engineering object from the real-time test application software in response to an instruction to import the target engineering object.
[0102] The template creation module 52 is used to call the EXCEL tool in response to the export instruction to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain the test case template.
[0103] The test case generation module 53 is used to respond to the test case generation instruction, based on the test case template, call the EXCEL tool to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases.
[0104] A test case creation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0105] Further, based on the above embodiments, the test case generation module 53 is specifically used to respond to the test case generation instruction, based on the test case template, call the EXCEL tool to copy the test case template to obtain multiple first test cases; call the EXCEL tool to modify the target parameter value of each first test case in the multiple first test cases, respectively, to obtain multiple second test cases; based on the expected results corresponding to each second test case input by the user, obtain multiple target test cases.
[0106] A test case creation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0107] Further, based on the above embodiment, the acquisition module 51 is specifically used to respond to the instruction of importing the target engineering object, and use the middleware program to parse the engineering information corresponding to the target engineering object obtained from the real-time test application software to obtain the engineering parameters corresponding to the target engineering object.
[0108] A test case creation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0109] See also Figure 6 , which is a structural schematic diagram of another embodiment of a test case creation device provided by the present application. Figure 6 As shown, based on the above embodiment, the device 50 may further include a simulation module 54 .
[0110] Specifically, the simulation module 54 is used to generate a test script corresponding to the target test case for each target test case in multiple target test cases based on the target test case; configure the test script in a real-time test application library and add simulation functions to obtain an executable test script; in response to a start running instruction, call the real-time test application software to perform a simulation test based on the executable test script to obtain simulation data.
[0111] A test case creation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0112] Further, based on the above embodiments, the simulation module 54 is specifically used to respond to a start running instruction, send the start running instruction to the real-time test application software through the middleware program, so that the real-time test application software obtains the executable test script and executes the executable test script to generate simulation data; in response to an end running instruction sent by the real-time test application software through the middleware program, obtain the simulation data corresponding to the executable test script from the real-time test application software.
[0113] A test case creation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0114] See also Figure 7 , which is a structural schematic diagram of another embodiment of a test case creation device provided by the present application. Figure 7 As shown, based on the above embodiment, the device 50 may further include a reporting module 55 .
[0115] Specifically, the reporting module 55 is used to determine the simulation curve corresponding to the target test case based on the simulation data; determine the execution result of the target test case based on the simulation data and the expected result corresponding to the target test case; and generate a test report for display to the user based on the simulation curve and execution result corresponding to each target test case.
[0116] A test case creation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0117] See also Figure 8 , which is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 80 may include: a processor 81 and a memory 82.
[0118] The processor 81 is in communication connection with the memory 82 , and the memory 82 is used to store computer-executable instructions; the processor 81 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the computer-executable instructions stored in the memory 82 .
[0119] Optionally, the memory 82 may be independent or integrated with the processor 81. Optionally, when the memory 82 is a device independent of the processor 81, the electronic device 80 may further include: a bus for connecting the above devices.
[0120] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.
[0121] An embodiment of the present application also provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement the above-mentioned method. The implementation principle and technical effect are similar and will not be repeated here.
[0122] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for creating a test case, characterized in that: include: In response to an instruction to import a target engineering object, obtaining engineering parameters corresponding to the target engineering object from the real-time test application software; In response to the export instruction, calling the EXCEL tool to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain the test case template; In response to the instruction of test case generation, based on the test case template, the EXCEL tool is called to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases.
2. The method according to claim 1, characterized in that The step of responding to the instruction of test case generation, based on the test case template, calling the EXCEL tool to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases includes: In response to the instruction of test case generation, based on the test case template, calling the EXCEL tool to copy the test case template to obtain a plurality of first test cases; Calling the EXCEL tool to modify the target parameter value of each first test case in the plurality of first test cases respectively, to obtain a plurality of second test cases; the target parameter value of each second test case in the plurality of second test cases is different; Based on the expected results corresponding to each of the second test cases input by the user, multiple target test cases are obtained.
3. The method according to claim 1, characterized in that The step of obtaining engineering parameters corresponding to the target engineering object from the real-time test application software in response to the instruction to import the target engineering object includes: In response to an instruction to import a target engineering object, a middleware program is used to parse engineering information corresponding to the target engineering object obtained from the real-time test application software to obtain engineering parameters corresponding to the target engineering object; the middleware program communicates with the real-time test application software via an ASAM XIL protocol.
4. The method according to claim 3, characterized in that The engineering parameters corresponding to the target engineering object include input variables, output variables and parameter configuration.
5. The method according to claim 1, characterized in that: For each target test case in the plurality of target test cases, the method further comprises: Based on the target test case, generate a test script corresponding to the target test case; Performing real-time test application library configuration on the test script and adding simulation functions to obtain an executable test script; the simulation functions are used to perform data interaction with the simulation model in the real-time test application software; In response to the start execution instruction, the real-time test application software is called to perform simulation testing based on the executable test script to obtain simulation data.
6. The method according to claim 5, characterized in that In response to the start-run instruction, calling the real-time test application software to perform simulation testing based on the executable test script to obtain simulation data includes: In response to a start-run instruction, the start-run instruction is sent to the real-time test application software through a middleware program, so that the real-time test application software obtains the executable test script and executes the executable test script to generate simulation data; In response to an end-of-run instruction sent by the real-time test application software through a middleware program, simulation data corresponding to the executable test script is acquired from the real-time test application software.
7. The method according to claim 6, characterized in that The method further comprises: Based on the simulation data, determining a simulation curve corresponding to the target test case; Determining the execution result of the target test case based on the simulation data and the expected result corresponding to the target test case; According to the simulation curve and execution results corresponding to each target test case, a test report is generated for display to the user.
8. A test case creation device, characterized in that: include: An acquisition module, configured to acquire engineering parameters corresponding to the target engineering object from the real-time test application software in response to an instruction to import the target engineering object; The template creation module is used to call the EXCEL tool in response to the export instruction to export the preset template and the target parameters determined from the engineering parameters to the EXCEL tool to obtain the test case template; The test case generation module is used to respond to the instruction of test case generation, based on the test case template, call the EXCEL tool to copy the test case template and modify the target parameter value in the test case template to obtain multiple target test cases.
9. An electronic device, characterized in that: The device comprises: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Test case generation method and device, and electronic device
CN112084667A
Method and device for automatically generating and executing test case, equipment and storage medium
CN112486846A
Automatic method for creating test cases in batches based on web platform
CN116501636A
Apparatuses, methods, and computer program products for conducting automated tests
US20150278075A1