Method and device for automatically checking simulation test cases, electronic equipment and medium
By using automated verification methods to match the format and content of test cases, the problems of low efficiency and low accuracy caused by manual writing are solved, and efficient and accurate autonomous driving test case writing is achieved.
Patent Information
- Application Number
- CN202310161131.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-02-23
AI Technical Summary
In existing technologies, the writing of autonomous driving test cases relies on manual labor, resulting in high manpower consumption, low accuracy and low development efficiency, and unable to keep up with the speed of system iteration.
An automated verification method is used to extract test cases that meet preset conditions, eliminate cases that do not meet format requirements, split them into target step documents, determine the format and content matching, generate error logs and optimization suggestions, and improve writing speed and accuracy.
It improves the accuracy of test cases and the first-time pass rate of script tests, reduces manpower consumption, and improves writing speed and development efficiency.
Smart Images

Figure CN116185857B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of simulation testing of autonomous vehicles, and in particular to an automated verification method, device, electronic equipment, and medium for simulation test cases. Background Art
[0002] Currently, testing methods for autonomous driving are divided into real-world vehicle testing in closed-loop areas, real-world vehicle testing on real roads, and simulation testing in virtual environments. Real-world vehicle testing, as the earliest and most widely used method, has been extensively utilized by major manufacturers. However, it faces significant limitations due to its inability to fully address limited test scenarios, high testing costs, and difficulty reproducing extreme operating conditions. Simulation testing, as the preferred approach for autonomous driving testing, perfectly addresses these pain points and has been continuously improved and developed in recent years. Currently, functional simulation testing of autonomous driving systems utilizes a SIL (Software in the Loop) simulation testing approach, which is divided into three steps: test cases, test scenarios, and test scripts. Test cases and test scenarios evolve with the continuous upgrade of autonomous driving systems, and the required test scripts also change accordingly. However, with the increasing speed of autonomous driving system iterations and the continuous refinement of test cases and test scenarios, the number of test scripts is also increasing. To achieve full test script coverage, the accuracy requirements for test case writing are also increasing. As the core input of the entire autonomous driving simulation process, writing accurate and effective test cases is of paramount importance.
[0003] However, test case development currently relies primarily on manual labor, which exacerbates shortcomings such as low efficiency, high human resource requirements, and the tendency for manual errors. This severely impacts the speed of algorithm development and iteration. As test case complexity increases, relying solely on manual labor to complete this task can no longer keep up with the speed of system iteration, necessitating an urgent solution. Summary of the Invention
[0004] The present application provides an automated verification method, device, electronic device and medium for simulation test cases, which solves the current problems of high manpower consumption, low accuracy and low development efficiency in test case writing, improves the writing speed, and improves the accuracy of test cases and the first-time pass rate of script testing.
[0005] The first aspect of the present application provides an automated verification method for simulation test cases, comprising the following steps: extracting multiple test cases that meet preset extraction conditions, segmenting the information of each test case, and eliminating test cases that do not meet the first preset format requirements to obtain multiple cases to be tested; based on the information of each case to be tested, splitting each case to be tested into target step documents corresponding to each case to be tested, determining the current case to be tested, and judging whether the target step document corresponding to the current case to be tested meets the second preset format requirements; if the target step document corresponding to the current case to be tested meets the second preset format requirements, then judging whether the target step document corresponding to the current case to be tested meets the preset content matching requirements, and when the preset content matching requirements are met, using the next case to be tested as the new current case to be tested, until all the multiple cases to be tested are verified, and obtaining the automated verification results of the simulation test cases.
[0006] The above technical means have solved the current problems of high manpower consumption, low accuracy and low development efficiency in test case writing, improved the writing speed, and improved the accuracy of test cases and the first-time pass rate of script testing.
[0007] Furthermore, the determination of whether the target step document corresponding to the current case to be tested meets the second preset format requirement includes: crawling out the contents of the test condition, observation interface, execution operation and input interface columns based on the target step document corresponding to the current case to be tested; storing the contents of the test condition, the observation interface, the execution operation and the input interface columns as dictionaries condition, interface, execoperation and inputinterface respectively; writing the dictionaries condition, interface, execoperation and inputinterface into the format check alarmformat_step to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirement based on the check results.
[0008] According to the above technical means, by judging whether the target step document corresponding to the current case to be tested meets the second preset format requirement, the error rate of writing cases is reduced and the accuracy of test cases is improved.
[0009] Furthermore, the determination of whether the target step document corresponding to the current case to be tested meets the preset content matching requirements includes: traversing the step information of the current case to be tested, and determining whether the current case to be tested has missing or added step numbers based on the step information; if the current case to be tested has the missing or added step numbers, checking the current case to be tested based on a preset sweep function to determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirements based on the inspection results.
[0010] According to the above technical means, by judging whether the target step document corresponding to the current case to be tested meets the preset content matching requirements, the error rate of writing cases is reduced and the accuracy of test cases is improved.
[0011] Furthermore, after eliminating the test cases that do not meet the first preset format requirement, it also includes: outputting an alarm format and generating an error log, wherein the alarm format consists of a case number, steps and alarm type.
[0012] According to the above technical means, based on the generated alarm format and error log, it is convenient for case personnel to find error cases in a timely and accurate manner and make corresponding modifications.
[0013] Furthermore, after outputting the alarm format and generating the error log, the method further includes: generating a verification optimization suggestion according to the error log, so as to optimize the automated verification of the simulation test case according to the verification optimization suggestion.
[0014] According to the above technical means, based on the generated error log, case personnel can make corresponding modifications and optimizations.
[0015] Furthermore, the information of each test case includes: a test case ID (Identity Document), a test overview, test conditions, execution operations, judgment conditions, and a test case priority.
[0016] According to the above technical means, test cases that do not meet the first preset format requirement are eliminated based on the information of each test case, thereby improving the accuracy of the test cases and the first-time pass rate of the script test.
[0017] The second aspect of the present application provides an automatic verification device for simulation test cases, including: an extraction module for extracting multiple test cases that meet preset extraction conditions, and dividing the information of each test case, and eliminating test cases that do not meet the first preset format requirements to obtain multiple cases to be tested; a judgment module for splitting each case to be tested into target step documents corresponding to each case to be tested based on the information of each case to be tested, and determining the current case to be tested, and judging whether the target step document corresponding to the current case to be tested meets the second preset format requirements; a verification module for judging whether the target step document corresponding to the current case to be tested meets the preset content matching requirements if the target step document corresponding to the current case to be tested meets the second preset format requirements, and when the preset content matching requirements are met, using the next case to be tested as the new current case to be tested, until all the multiple cases to be tested are verified to obtain the automatic verification results of the simulation test cases.
[0018] Furthermore, the judgment module is also used to: crawl out the contents of the test conditions, observation interface, execution operation and input interface columns based on the target step document corresponding to the current case to be tested; store the contents of the test conditions, the observation interface, the execution operation and the input interface columns as dictionaries condition, interface, execoperation and inputinterface respectively; write the dictionaries condition, interface, execoperation and inputinterface into the format check alarmformat_step to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirement based on the inspection results.
[0019] Furthermore, the verification module is also used to: traverse the step information of the current case to be tested, and determine whether the current case to be tested has missing or added step numbers based on the step information; if the current case to be tested has missing or added step numbers, then check the current case to be tested based on a preset sweep function to determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirements based on the inspection results.
[0020] Furthermore, after eliminating the test cases that do not meet the first preset format requirements, the extraction module is also used to: output an alarm format and generate an error log, wherein the alarm format consists of a case number, steps and alarm type.
[0021] Furthermore, after outputting the alarm format and generating the error log, the extraction module is further used to: generate verification optimization suggestions based on the error log, so as to optimize the automated verification of the simulation test case according to the verification optimization suggestions.
[0022] Furthermore, the information of each test case includes: test case ID, test overview, test conditions, execution operation, judgment condition and test case priority.
[0023] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement an automated verification method for simulation test cases as described in the above embodiment.
[0024] The fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the automated verification method of the simulation test case as described in the above embodiment.
[0025] Therefore, the present application divides the information of multiple test cases that meet the preset extraction conditions, and eliminates the test cases that do not meet the first preset format requirements to obtain multiple cases to be tested, and splits each case to be tested into the target step document corresponding to each case to be tested, determines the current case to be tested, and if the target step document corresponding to the current case to be tested meets the second preset format requirements, then determines whether the target step document corresponding to the current case to be tested meets the preset content matching requirements. When the preset content matching requirements are met, the next case to be tested is used as the new current case to be tested, until multiple cases to be tested are verified, and the automated verification results of the simulation test cases are obtained. Thus, the current problems of high manpower consumption, low accuracy and low development efficiency in the writing of test cases are solved, the writing speed is improved, and the accuracy of the test cases and the one-time pass rate of the script test are improved.
[0026] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0028] Figure 1 A flowchart of an automated verification method for a simulation test case provided according to an embodiment of the present application;
[0029] Figure 2A flowchart of an automated verification method for a simulation test case according to a specific embodiment of the present application;
[0030] Figure 3 Schematic diagram of a block diagram of an automated verification device for a simulation test case according to an embodiment of the present application;
[0031] Figure 4 Schematic diagram of the structure of an electronic device according to an embodiment of the present application.
[0032] Explanation of the accompanying drawings: 10 - automated verification device for simulation test cases, 100 - extraction module, 200 - judgment module, 300 - verification module, 403 - communication interface, 401 - memory, 402 - processor. DETAILED DESCRIPTION
[0033] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0034] The following describes the automated verification method, device, electronic device and medium of the simulation test case of the embodiment of the present application with reference to the accompanying drawings. In view of the problems of large labor consumption, low accuracy and low development efficiency of the current test case writing mentioned in the above background technology, the present application provides an automated verification method for simulation test cases, in which the information of multiple test cases that meet the preset extraction conditions are extracted are segmented, and the test cases that do not meet the first preset format requirements are eliminated to obtain multiple cases to be tested, and each case to be tested is split into the target step document corresponding to each case to be tested, and the current case to be tested is determined. If the target step document corresponding to the current case to be tested meets the second preset format requirements, then it is determined whether the target step document corresponding to the current case to be tested meets the preset content matching requirements. When the preset content matching requirements are met, the next case to be tested is used as the new current case to be tested, until the multiple cases to be tested are verified, and the automated verification result of the simulation test case is obtained. Thus, the problems of large labor consumption, low accuracy and low development efficiency of the current test case writing are solved, the writing speed is improved, and the accuracy of the test case and the one-time pass rate of the script test are improved.
[0035] Specifically, Figure 1 A flowchart of an automated verification method for a simulation test case provided in an embodiment of the present application.
[0036] like Figure 1 As shown, the automated verification method for the simulation test case includes the following steps:
[0037] In step S101, a plurality of test cases meeting a preset extraction condition are extracted, and information of each test case is segmented, and test cases that do not meet a first preset format requirement are eliminated to obtain a plurality of cases to be tested.
[0038] In some embodiments, the information of each test case includes: a test case ID, a test overview, test conditions, execution operations, judgment conditions, and a test case priority.
[0039] Specifically, after configuring the version number and absolute file path of the case document, the embodiment of the present application runs the script to extract the case, ensuring that the generated script corresponds to the latest version of the test case. According to the test case writing rules, the key case information in multiple test cases is extracted, and a sheet named test_cases is generated. The extracted case information contains six parts: test case ID, test overview, test conditions, execution operation, judgment condition and case priority. The information of each test case obtained is segmented by using logical operators or characters as identification bits, and the regular operation function (re.) provided by Python is used to segment the test overview, test conditions, execution operation and judgment condition into the dictionary SheetOverview, and then write the first preset format requirement for each test case to check and judge. The function is alarmformat_caseinfo, and the test cases that do not meet the first preset format requirement are eliminated to obtain multiple cases to be tested.
[0040] Furthermore, in some embodiments, after eliminating the test cases that do not meet the first preset format requirement, it also includes: outputting an alarm format and generating an error log, wherein the alarm format consists of a case number, steps, and alarm type.
[0041] Optionally, in some embodiments, after outputting the alarm format and generating the error log, the method further includes: generating a verification optimization suggestion based on the error log, so as to optimize the automated verification of the simulation test case according to the verification optimization suggestion.
[0042] It is understood that after eliminating the test cases that do not meet the first preset format requirements, an alarm format is output and an error log named error_log is automatically generated in the current directory. The alarm format consists of: case number + step + alarm type: content + format. Verification optimization suggestions are generated based on the error log, allowing script editors to optimize the automated verification of simulation test cases based on the error log.
[0043] In step S102, based on the information of each case to be tested, each case to be tested is split into target step documents corresponding to each case to be tested, and the current case to be tested is determined to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirement.
[0044] Specifically, the information of each case to be tested is extracted, and the description of each test case is split into corresponding target step documents. In the target step document corresponding to each test case, B1:G2 (Excel cell label) is the original test overview content, including case ID, test overview, test conditions, execution operations, judgment conditions, etc.; B4:G36 is the entire content of the test steps and pass conditions, of which B4:G4 is the header, which are test conditions, observation interface, execution operations and input interface respectively; B5:B25 is the step annotation, i.e. Step1-Step20. The embodiment of the present application uses regular expressions (i.e. the second preset format requirement) to match the target step documents corresponding to the case to be tested.
[0045] Optionally, in some embodiments, determining whether the target step document corresponding to the current case to be tested meets the second preset format requirement includes: crawling out the contents of the test condition, observation interface, execution operation and input interface columns based on the target step document corresponding to the current case to be tested; storing the contents of the test condition, observation interface, execution operation and input interface columns as dictionaries condition, interface, execoperation and inputinterface respectively; writing the dictionaries condition, interface, execoperation and inputinterface into the format check alarmformat_step to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirement based on the check results.
[0046] Specifically, this application implements the target step document corresponding to the current case to be tested, uses the pandas function in Python to interact with Excel, crawls out the content under the test conditions, observation interface, execution operation and input interface columns, and stores them as dictionaries condition, interface, execoperation and inputinterface respectively, and writes the format check alarmformat_step, and judges whether the target step document corresponding to the current case to be tested meets the second preset format requirements based on the inspection results.
[0047] In step S103, if the target step document corresponding to the current case to be tested meets the second preset format requirement, it is determined whether the target step document corresponding to the current case to be tested meets the preset content matching requirement, and when the preset content matching requirement is met, the next case to be tested is used as the new current case to be tested, until multiple cases to be tested are verified, and the automated verification result of the simulation test case is obtained.
[0048] It can be understood that if the target step document corresponding to the current case to be tested meets the second preset format requirement, it is determined whether the target step document corresponding to the current case to be tested meets the preset content matching requirement. Otherwise, the alarm format is output and an error log is generated. The alarm format is: case number + step + alarm type: content + format.
[0049] Among them, in some embodiments, determining whether the target step document corresponding to the current case to be tested meets the preset content matching requirements includes: traversing the step information of the current case to be tested, and determining whether there are missing or added step numbers in the current case to be tested based on the step information; if there are missing or added step numbers in the current case to be tested, checking the current case to be tested based on a preset sweep function to determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirements based on the inspection results.
[0050] Specifically, after ensuring that the target step document corresponding to the current case to be tested meets the second preset format requirement, a linkage comparison check of the case information and the step document content is required. The punctuation marks of each test step of the target step document corresponding to the current case to be tested are identified as identifiers, and the format of the identified test steps will be converted to the format of: "number:conditon / operation / judgement:information:singal;". The expression and value of the key information singal are extracted from a single step, and the signal information in the generated dictionary is compared for deviation. The step information in each case is traversed to check whether there are missing or added step numbers. For special signals that require additional editing, check whether there are missing execution conditions. The main function Check_case.py performs the operation. If the check result shows missing or added step numbers, it is judged that the target step document corresponding to the current case to be tested does not meet the preset content matching requirements, and an error log is output.
[0051] The embodiment of the present application adopts a For loop method to set the largest case number as the loop end mark to ensure that no case number is missed during the verification process. When the target step document corresponding to the case to be tested meets the preset content matching requirements, the next case to be tested is used as the new current case to be tested until multiple cases to be tested are verified to obtain the automated verification results of the simulation test case.
[0052] During the execution of the embodiment of the present application, if errors such as case number non-existence, signal name undefined, parameter value garbled, missing test steps, etc. occur, an alarm format is output and an error log is generated to facilitate script editors to improve this tool.
[0053] In order to enable those skilled in the art to further understand the automated verification method of the simulation test case of the embodiment of the present application, the following is described in detail with reference to specific embodiments. Figure 2 shown.
[0054] In step S201, test cases are extracted.
[0055] In step S202, case information is extracted.
[0056] In step S203, Python crawls test case information.
[0057] In step S204, it is determined whether the test case meets the first preset format requirement. If so, step S205 is executed; if not, step S206 is executed.
[0058] In step S205, Python crawls step document information.
[0059] In step S206, an error log is generated.
[0060] In step S207, it is determined whether the target step document corresponding to the current test case meets the second preset format requirement. If so, step S208 is executed; if not, step S206 is executed.
[0061] In step S208, it is determined whether the target step document corresponding to the current test case meets the preset content matching requirement. If so, step S209 is executed; if not, step S203 is executed.
[0062] In step S209, it is determined whether all cases have been verified. If not, the process proceeds to step S203.
[0063] In step S210, the verification ends.
[0064] According to the automated verification method for simulation test cases proposed in the embodiment of the present application, the information of multiple test cases that meet the preset extraction conditions are segmented, and the test cases that do not meet the first preset format requirements are eliminated to obtain multiple cases to be tested, and each case to be tested is split into the target step document corresponding to each case to be tested, and the current case to be tested is determined. If the target step document corresponding to the current case to be tested meets the second preset format requirements, it is determined whether the target step document corresponding to the current case to be tested meets the preset content matching requirements. When the preset content matching requirements are met, the next case to be tested is used as the new current case to be tested, until multiple cases to be tested are verified, and the automated verification results of the simulation test cases are obtained. Thus, the current problems of high manpower consumption, low accuracy and low development efficiency in the writing of test cases are solved, the writing speed is improved, and the accuracy of the test cases and the one-time pass rate of the script test are improved.
[0065] Next, an automated verification device for a simulation test case proposed in an embodiment of the present application will be described with reference to the accompanying drawings.
[0066] Figure 3 It is a block diagram of an automated verification device for a simulation test case according to an embodiment of the present application.
[0067] like Figure 3 As shown, the automatic verification device 10 of the simulation test case includes: an extraction module 100, a judgment module 200 and a verification module 300.
[0068] Among them, the extraction module 100 is used to extract multiple test cases that meet the preset extraction conditions, and to segment the information of each test case and eliminate the test cases that do not meet the first preset format requirements to obtain multiple cases to be tested; the judgment module 200 is used to split each case to be tested into the target step documents corresponding to each case to be tested based on the information of each case to be tested, and to determine the current case to be tested, and to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirements; the verification module 300 is used to determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirements if the target step document corresponding to the current case to be tested meets the second preset format requirements, and when the preset content matching requirements are met, the next case to be tested is used as the new current case to be tested, until multiple cases to be tested are verified to obtain the automated verification results of the simulation test cases.
[0069] Optionally, in some embodiments, the judgment module 200 is further used to: crawl out the contents of the test condition, observation interface, execution operation and input interface columns based on the target step document corresponding to the current case to be tested; store the contents of the test condition, observation interface, execution operation and input interface columns as dictionaries condition, interface, execoperation and inputinterface respectively; write the dictionaries condition, interface, execoperation and inputinterface into the format check alarmformat_step to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirement based on the check results.
[0070] Optionally, in some embodiments, the verification module 300 is further used to: traverse the step information of the current case to be tested, and determine whether there are missing or added step numbers in the current case to be tested based on the step information; if there are missing or added step numbers in the current case to be tested, check the current case to be tested based on a preset sweep function to determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirements based on the inspection results.
[0071] Optionally, in some embodiments, after eliminating the test cases that do not meet the first preset format requirements, the extraction module 100 is further used to: output an alarm format and generate an error log, wherein the alarm format consists of a case number, steps and alarm type.
[0072] Optionally, in some embodiments, after outputting the alarm format and generating the error log, the extraction module 100 is further used to: generate verification optimization suggestions based on the error log, so as to optimize the automated verification of the simulation test case according to the verification optimization suggestions.
[0073] Optionally, in some embodiments, the information of each test case includes: a test case ID, a test overview, a test condition, an execution operation, a judgment condition, and a test case priority.
[0074] It should be noted that the above explanation of the embodiment of the automatic verification method of the simulation test case is also applicable to the automatic verification device of the simulation test case of this embodiment, and will not be repeated here.
[0075] According to the automated verification device for simulation test cases proposed in the embodiment of the present application, the information of multiple test cases that meet the preset extraction conditions are segmented, and the test cases that do not meet the first preset format requirements are eliminated to obtain multiple cases to be tested, and each case to be tested is split into the target step document corresponding to each case to be tested, and the current case to be tested is determined. If the target step document corresponding to the current case to be tested meets the second preset format requirements, it is determined whether the target step document corresponding to the current case to be tested meets the preset content matching requirements. When the preset content matching requirements are met, the next case to be tested is used as the new current case to be tested, until multiple cases to be tested are verified, and the automated verification results of the simulation test cases are obtained. Thus, the current problems of high manpower consumption, low accuracy and low development efficiency in the writing of test cases are solved, the writing speed is improved, and the accuracy of the test cases and the one-time pass rate of the script test are improved.
[0076] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0077] Memory 401 , processor 402 , and computer programs stored in the memory 401 and executable on the processor 402 .
[0078] When the processor 402 executes the program, the automated verification method of the simulation test case provided in the above embodiment is implemented.
[0079] Furthermore, the electronic device further includes:
[0080] The communication interface 403 is used for communication between the memory 401 and the processor 402 .
[0081] The memory 401 is used to store computer programs that can be run on the processor 402 .
[0082] The memory 401 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.
[0083] If the memory 401, the processor 402, and the communication interface 403 are implemented independently, the communication interface 403, the memory 401, and the processor 402 can be connected to each other via a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0084] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.
[0085] The processor 402 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
[0086] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the automated verification method of the simulation test case described above.
[0087] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0088] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0089] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0090] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.
[0091] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0092] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. An automated verification method for simulation test cases, characterized in that: The following steps are involved: Extracting multiple test cases that meet the preset extraction conditions, segmenting the information of each test case, and eliminating test cases that do not meet the first preset format requirements to obtain multiple cases to be tested; Based on the information of each case to be tested, split each case to be tested into target step documents corresponding to each case to be tested, determine a current case to be tested, and determine whether the target step document corresponding to the current case to be tested meets a second preset format requirement; as well as If the target step document corresponding to the current case to be tested meets the second preset format requirement, then determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirement, and when the preset content matching requirement is met, use the next case to be tested as the new current case to be tested, until all the multiple cases to be tested are verified, and obtain the automated verification result of the simulation test case.
2. The method according to claim 1, characterized in that The determining whether the target step document corresponding to the current case to be tested meets the second preset format requirement includes: Based on the target step document corresponding to the current test case, crawl out the contents of the test condition, observation interface, execution operation and input interface columns; Store the contents of the test condition, the observation interface, the execution operation and the input interface columns into dictionaries condition, interface, execoperation and inputinterface respectively; The dictionary condition, interface, execoperation and inputinterface are written into the format check alarmformat_step to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirement according to the check result.
3. The method according to claim 2, characterized in that The determining whether the target step document corresponding to the current case to be tested meets the preset content matching requirement includes: Traversing the step information of the current case to be tested, and determining whether there are any missing or added step numbers in the current case to be tested based on the step information; If the current case to be tested has the missing or added step number, the current case to be tested is checked based on the preset sweep function to determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirements based on the check result.
4. The method according to claim 1, wherein After eliminating the test cases that do not meet the first preset format requirement, the method further includes: Output an alarm format and generate an error log, wherein the alarm format consists of a case number, a step, and an alarm type.
5. The method according to claim 4, characterized in that After outputting the alarm format and generating the error log, the method further includes: A verification optimization suggestion is generated according to the error log, so as to optimize the automated verification of the simulation test case according to the verification optimization suggestion.
6. The method according to claim 1, characterized in that The information of each test case includes: test case ID, test overview, test conditions, execution operation, judgment condition and test case priority.
7. An automated verification device for simulation test cases, characterized in that: include: An extraction module is used to extract multiple test cases that meet the preset extraction conditions, segment the information of each test case, and eliminate test cases that do not meet the first preset format requirements to obtain multiple cases to be tested; a judgment module, configured to split each to-be-tested case into target step documents corresponding to each to-be-tested case based on information of the case to-be-tested case, determine a current to-be-tested case, and judge whether the target step document corresponding to the current to-be-tested case meets a second preset format requirement; as well as A verification module is used to determine whether the target step document corresponding to the current case to be tested meets the preset content matching requirement if the target step document corresponding to the current case to be tested meets the second preset format requirement, and when the preset content matching requirement is met, the next case to be tested is used as the new current case to be tested, until all the multiple cases to be tested are verified, thereby obtaining the automated verification result of the simulation test case.
8. The device according to claim 7, characterized in that The judgment module is further configured to: Based on the target step document corresponding to the current test case, crawl out the contents of the test condition, observation interface, execution operation and input interface columns; Store the contents of the test condition, the observation interface, the execution operation and the input interface columns into dictionaries condition, interface, execoperation and inputinterface respectively; The dictionary condition, interface, execoperation and inputinterface are written into the format check alarmformat_step to determine whether the target step document corresponding to the current case to be tested meets the second preset format requirement according to the check result.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the automated verification method for the simulation test case according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the automated verification method for a simulation test case according to any one of claims 1 to 6.
Citation Information
Patent Citations
Test case processing method and device
CN109558317A
Method and device for automatically detecting use case format
CN109634863A