Test case generation method and device, electronic equipment and storage medium

By generating variable mapping files and test case tables, the test cases of the domain control controller are automatically generated, which solves the problem of long and prone to errors in the traditional method, and achieves efficient and accurate test case generation.

CN119127680APending Publication Date: 2024-12-13CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411138556.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the hardware-in-loop (HIL) testing of domain control controllers, traditional methods use manual construction of automatic test case sequences, which cost more time and are prone to making mistakes, resulting in low testing efficiency.

Method used

By determining the test signal variable list of the domain control controller, a variable mapping file is generated, and the target test case table and target test cases are automatically generated based on the test signal variable list, pre-determined test case templates and generation rules, to improve the efficiency of test case generation .

Benefits of technology

It shortens the test case preparation time, improves the efficiency of test case generation, reduces the possibility of errors, and improves the efficiency and quality of tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127680A_ABST
    Figure CN119127680A_ABST
Patent Text Reader

Abstract

The invention discloses a test case generation method and device, electronic equipment and a storage device. The method comprises the following steps: determining a test signal variable list of a domain controller, and generating a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system; generating a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule; and generating a target test case according to the target test case table and the variable mapping file. According to the technical scheme, the predetermined test case template is filled in the signal variable level according to the determined test signal variable list, the target test case table conforming to the test case generation rule is generated, conversion from the target test case table to the target test case is achieved through the variable mapping file, and the test signal variable generation efficiency is improved. The test case generation efficiency can be improved, and the test case preparation time can be shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle testing, and in particular to a test case generation method, device, electronic equipment and storage medium. Background Art

[0002] For the hardware-in-the-loop (HIL) automated testing of domain controllers, improving the automated test case generation technology and shortening the test case preparation time will greatly improve the test efficiency. In particular, the current domain controllers have a large number of interface signals. The traditional method of manually building an automated test case sequence in the HIL test system according to standard operations takes a lot of time and is prone to errors. Summary of the invention

[0003] The present invention provides a test case generation method, device, electronic equipment and storage medium, which can improve the test case generation efficiency and shorten the test case preparation time.

[0004] According to one aspect of the present invention, a test case generation method is provided, the method comprising:

[0005] Determine a test signal variable list of the domain controller, and generate a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system;

[0006] Generate a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule;

[0007] Generate a target test case according to the target test case table and the variable mapping file.

[0008] According to another aspect of the present invention, a test case generating device is provided, the device comprising:

[0009] A variable mapping file generation module is used to determine a test signal variable list of a domain controller, and generate a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system;

[0010] A test case table generation module, used to generate a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule;

[0011] The target test case generation module is used to generate a target test case according to the target test case table and the variable mapping file.

[0012] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the test case generation method described in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the test case generation method described in any embodiment of the present invention when executed.

[0017] The technical solution of the embodiment of the present invention determines the test signal variable list of the domain control controller, and generates a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system; generates a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule; generates a target test case according to the target test case table and the variable mapping file. The technical solution of the embodiment of the present invention fills the predetermined test case template at the signal variable level according to the determined test signal variable list, generates a target test case table that conforms to the test case generation rule, and realizes the conversion of the target test case table to the target test case through the variable mapping file, which can improve the test case generation efficiency and shorten the test case preparation time.

[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a flowchart of a test case generation method provided according to Embodiment 1 of the present invention;

[0021] Figure 2 is a flowchart of a test case generation method provided in Embodiment 2 of the present invention;

[0022] Figure 3is a structural schematic diagram of a test case generating device provided according to Embodiment 3 of the present invention;

[0023] Figure 4 It is a structural schematic diagram of an electronic device for implementing the test case generation method of an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Embodiment 1

[0027] Figure 1 A flowchart of a test case generation method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of generating test cases for a hardware-in-the-loop test system according to test requirements. The method can be executed by a test case generation device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0028] S110: Determine a test signal variable list of the domain controller, and generate a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system.

[0029] The vehicle's domain controller is an integrated controller used to manage and control multiple embedded electronic control units in the vehicle's electronic system. The domain controller can serve as the center of the vehicle's electronic system, and by processing and distributing data, it can coordinate and communicate between the various electronic control units to achieve comprehensive control and optimization of the vehicle system.

[0030] The test signal variable list includes an observation signal variable list and a simulation signal variable list, which can be determined based on the test requirements of the domain controller. When determining the test signal variable list based on the test requirements of the domain controller, the source of the observation signal variable list is mainly the signal variables corresponding to the control system flash file of the domain controller, and the source of the simulation signal variable list is mainly the simulation input signal variables and simulation output signal variables in the hardware-in-the-loop test system.

[0031] Among them, the Hardware in the Loop (HIL) test system can simulate the operating state of the controlled object by running a simulation model on a real-time processor, and connect with the electronic control unit under test through the I / O interface to achieve comprehensive and systematic testing of the electronic control unit, reduce development time and cost, and improve test efficiency and safety.

[0032] The variable mapping file includes a list of test signal variables, mapping addresses that can be identified by the HIL test system, and the mapping relationship between the two. The variable mapping file can be used as a signal variable definition and mapping address library file when generating test cases.

[0033] In an embodiment of the present invention, after determining the test signal variable list, that is, the observation signal variable list and the simulation signal variable list, based on the domain control controller test requirements, a variable mapping file can be generated through the hardware-in-the-loop test system according to the observation signal variable list and the simulation signal variable list, so as to ensure that the generated test cases can be directly and successfully executed by the HIL test system through the variable mapping file during the test case generation process.

[0034] Optionally, a variable mapping file is generated according to the test signal variable list by a hardware-in-the-loop test system, including: importing the test signal variables in the test signal variable list into the hardware-in-the-loop test system; linking the test signal variables to a mapping address recognizable by the hardware-in-the-loop test system, and generating a variable mapping file.

[0035] In an embodiment of the present invention, after determining the test signal variable list of the domain controller, the test signal variables in the test signal variable list can be imported into the HIL test system according to the HIL use case operating environment, and the test signal variables can be linked to the mapping address that the HIL test system can recognize, and a variable mapping file is generated. It should be noted that the test signal variables involved in the test case should all exist in the variable mapping file to avoid test case generation failure. Optionally, in order to ensure test coverage and speed up test preparation time, all analog bus transceiver signals in the HIL test system can be added to the variable mapping file for the communication interface test signal variables in the test signal variables. If the names of the analog bus transceiver signals are repeated, they can be identified by adding suffixes and the like.

[0036] S120 , generating a target test case table according to the test signal variable list, a predetermined test case template, and a test case generation rule.

[0037] Among them, the predetermined test case templates include the initialization worksheet (Init), the function worksheet (Fun), and the end worksheet (CleanUp). The initial worksheet corresponds to the test preparation part of the HIL test, such as powering on the system, enabling current output, connecting the configuration project, etc. The function worksheet corresponds to the test execution part of the HIL test, which can be a large worksheet or divided into multiple worksheets according to the signal group. The end worksheet corresponds to the test preparation part of the HIL test, such as disconnecting the configuration project connection, powering off the system, etc.

[0038] Among them, the test case generation rules are used to define the structure, name and type of the test case to be generated. Exemplarily, according to the test case generation rules, the structure of the test case to be generated can be determined as an initial part, a test step part and an end part. Accordingly, the content of the initial part comes from the initial worksheet, the content of the test step part comes from the function worksheet, and the content of the end part comes from the end worksheet.

[0039] In an embodiment of the present invention, a predetermined test case template can be filled at the signal variable level according to the test signal variable list, and at the same time, according to the test case generation rule, specific parameters in the test case template are set to obtain a target test case table for generating a target test case. By filling the test case template at the signal variable level, it is convenient to add and delete signal variables in the test case template according to test requirements, and it has strong readability.

[0040] S130: Generate a target test case according to the target test case table and the variable mapping file.

[0041] In the embodiment of the present invention, the target test case table can be automatically converted into a target test case executable by the HIL test system through a script and a variable mapping file, so as to improve the test case generation efficiency and shorten the test case preparation time.

[0042] Optionally, a target test case is generated according to the target test case table and the variable mapping file, including: traversing all signal variables in the target test case table to determine the mapping address corresponding to the signal variable in the variable mapping file; determining the test case execution part corresponding to the signal variable from the mapping address according to the execution type of the signal variable, and adding the test case execution part to the target test case table; generating an automatic test sequence file according to the target test case table after adding the test case execution part, and using the test case in the automatic test sequence file as the target test case.

[0043] In an embodiment of the present invention, a variable mapping file can be exported from a HIL test system, and the signal variables added in the target test case table can be traversed by a script to determine the mapping address corresponding to the signal variable in the variable mapping file. Afterwards, according to the execution type of the signal variable, the test case execution part that can be executed by the HIL test system corresponding to the signal variable is determined from the mapping address, and the test case execution part is added to the target test case table. Finally, an automatic test sequence file is generated according to the target test case table after adding the test case execution part, and the test case in the automatic test sequence file is used as the target test case. Through the variable mapping file, the target test case table can be converted into a target test case that can be successfully executed by the HIL test system, thereby improving the generation efficiency of the test case and shortening the test case preparation time.

[0044] Optionally, after obtaining the target test case, the target test case may be imported into the HIL test system for execution, and the predetermined test case template may be optimized according to the test result to improve the quality of the generated test case.

[0045] The technical solution of the embodiment of the present invention determines the test signal variable list of the domain control controller, and generates a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system; generates a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule; generates a target test case according to the target test case table and the variable mapping file. The technical solution of the embodiment of the present invention fills the predetermined test case template at the signal variable level according to the determined test signal variable list, generates a target test case table that conforms to the test case generation rule, and realizes the conversion from the target test case table to the target test case through the variable mapping file, which can improve the test case generation efficiency and shorten the test case preparation time.

[0046] Embodiment 2

[0047] Figure 2 This is a flow chart of a test case generation method provided by the second embodiment of the present invention. The embodiment of the present invention is optimized based on the above embodiment. For solutions not described in detail in the embodiment of the present invention, please refer to the above embodiment. Figure 2 As shown, the method includes:

[0048] S210: Determine a test signal variable list of the domain controller, and generate a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system.

[0049] S220: Import the test signal variable list into a predetermined test case template to generate a first test case table.

[0050] Among them, the predetermined test case template includes the initialization worksheet (Init), the function worksheet (Fun) and the end worksheet (CleanUp). The initial worksheet corresponds to the test preparation part of the HIL test, such as system power-on, enabling current output, connection configuration engineering, etc., as shown in Table 1 below:

[0051] Table 1 Initial worksheet

[0052]

[0053] The functional worksheet corresponds to the test execution part of the HIL test, as shown in Table 2 below:

[0054] Table 2 Functional worksheet

[0055]

[0056] The end worksheet corresponds to the test preparation part of the HIL test, such as disconnecting the configuration project connection and powering off the system, as shown in Table 3 below:

[0057] Table 3 End of worksheet

[0058]

[0059] In the embodiment of the present invention, the test signal variable list is imported into the predetermined test case template, that is, the predetermined test case template is filled at the signal variable level according to the test signal variable list, thereby generating a first test case table.

[0060] Optionally, the test signal variable list is imported into a predetermined test case template to generate a first test case form, including: filling in the initialization worksheet, the function worksheet and the end worksheet according to the test signal variable list, and correspondingly generating a test preparation worksheet, a test execution worksheet and a test end worksheet; generating the first test case form according to the test preparation worksheet, the test execution worksheet and the test end worksheet.

[0061] In an embodiment of the present invention, the initialization worksheet, the function worksheet and the end worksheet can be filled in respectively according to the test signal variable list, and a test preparation worksheet, a test execution worksheet and a test end worksheet are generated accordingly. Exemplarily, according to the test signal variable list, the signal variables, program names, execution types, values, waiting times, etc. in the initial worksheet can be filled in, the signal groups, signal variables, execution types, values, waiting times, etc. in the function worksheet can be filled in, and the signal variables, program names, execution types, values, waiting times, etc. in the end worksheet can be filled in, and a test preparation worksheet, a test execution worksheet and a test end worksheet can be generated accordingly. Among them, when filling in the execution type, for the analog signal variables in the test signal variables, the execution type of the analog input signal variables in the analog signal variables can be set to "write", and the execution type of the analog input signal variables can be set to "read", and for the observation signal variables in the test signal variables, the execution type of the calibrable signal variables in the observation signal variables can be set to "write", and the execution type of the observable part signal can be set to "read". Afterwards, a first test case table is generated according to the test preparation worksheet, the test execution worksheet and the test end worksheet.

[0062] Optionally, in the process of importing the test signal variable list into a predetermined test case template to generate a first test case table, it also includes: when filling in numerical items according to the test signal variable list, if the number of numerical items to be filled is greater than the number of columns corresponding to the numerical row, then starting another row under the numerical row to continue filling in the unfilled numerical items.

[0063] In the embodiment of the present invention, the numerical items can be regarded as an independent table. When filling the numerical items according to the test signal variable list, if the number of numerical items to be filled is greater than the number of columns corresponding to the numerical row, another row under the numerical row can be started to continue to fill the unfilled numerical items. Exemplarily, the numerical items in Tables 1-3 above can be regarded as an independent table, as shown in Table 4 below, where the number of columns corresponding to the numerical row contains 16 columns, namely Value0-Value15. If the number of numerical items to be filled is greater than 16, another row under the numerical row can be started to continue to fill the unfilled numerical items.

[0064] Table 4 Numerical items table

[0065]

[0066] S230: Determine the name and type of the test case to be generated according to the first test case table and the test case generation rule, and generate a second test case table based on the name and type.

[0067] In an embodiment of the present invention, the name and type of the test case to be generated can be determined according to the test case generation rules and the filled test case template, that is, the first test case table, and the second test case table can be generated based on the name and type.

[0068] Optionally, according to the first test case table and test case generation rules, the name and type of the test case to be generated are determined, including: determining the test execution worksheet in the first test case table, and determining the signal group in the test execution worksheet; determining the name and type of the test case to be generated corresponding to the signal group according to the test case generation rules.

[0069] Among them, the signal group is a collection of signal variables of a certain type. In the embodiment of the present invention, one signal group can correspond to one test case, or multiple signal groups can correspond to one test case. The specific number can be determined based on actual needs and test case generation rules.

[0070] In the example of the present invention, it is necessary to first determine the test execution worksheet in the first test case table, then determine the signal group in the test execution worksheet, and determine the name and type of the test case to be generated corresponding to the signal group according to the test case generation rule. Exemplarily, the name (TestCaseName) of the test case to be generated corresponding to the signal group can be determined according to the controller name, signal group name and test type corresponding to the signal group in the test execution worksheet. The automatic generation column (Generate) of the signal group can be set to determine the type of the test case to be generated, such as by setting the automatic generation column of the signal group row to Y, the test case generation of all signal variables under the signal group is realized; by setting the automatic generation column of the signal group row to N, the test case of all signal variables under the signal group is realized not to be generated; by setting the automatic generation column of the first signal group row in each test execution worksheet to Y, the other signal group rows remain empty, the signal variables of the entire test execution worksheet can be generated to a test case, which is called a fast test case, and is marked by fast. In addition, the generation of the use case corresponding to the signal variable in the signal group can be canceled by clearing the execution type row content corresponding to a certain signal variable row in the signal group. Afterwards, a second test case table may be generated based on the name and type. For example, the following Table 5 shows a second test case table.

[0071] Table 5 Second test case table

[0072]

[0073] S240: Use the first test case table and the second test case table as target test case tables.

[0074] In the embodiment of the present invention, after the first test case table and the second test case table are generated, the first test case table and the second test case table may be used as target test case tables for generating target test cases.

[0075] S250: Generate a target test case according to the target test case table and the variable mapping file.

[0076] The technical solution of the embodiment of the present invention determines the test signal variable list of the domain control controller, and generates a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system; imports the test signal variable list into a predetermined test case template to generate a first test case table; determines the name and type of the test case to be generated according to the first test case table and the test case generation rule, and generates a second test case table based on the name and type; uses the first test case table and the second test case table as the target test case table; generates a target test case according to the target test case table and the variable mapping file. The technical solution of the embodiment of the present invention fills the predetermined test case template at the signal variable level according to the determined test signal variable list, generates a target test case table that meets the test case generation rules, and realizes the conversion of the target test case table to the target test case through the variable mapping file, which can improve the test case generation efficiency and shorten the test case preparation time.

[0077] Embodiment 3

[0078] Figure 3 A schematic diagram of the structure of a test case generating device provided in Embodiment 3 of the present invention.

[0079] like Figure 3 As shown, the device comprises:

[0080] A variable mapping file generating module 310 is used to determine a test signal variable list of a domain controller, and generate a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system;

[0081] A test case table generating module 320, for generating a target test case table according to the test signal variable list, a predetermined test case template and a test case generating rule;

[0082] The target test case generating module 330 is used to generate a target test case according to the target test case table and the variable mapping file.

[0083] Optionally, the test case table generating module 320 includes:

[0084] A first test case table generating unit, used for importing the test signal variable list into a predetermined test case template to generate a first test case table;

[0085] A second test case table generating unit, configured to determine the name and type of the test case to be generated according to the first test case table and the test case generating rule, and to generate a second test case table based on the name and type;

[0086] The target test case table generating unit is used to use the first test case table and the second test case table as target test case tables.

[0087] Optionally, the test case template includes an initialization worksheet, a function worksheet and an end worksheet;

[0088] The first test case table generating unit comprises:

[0089] The worksheet filling subunit is used to fill the initialization worksheet, the function worksheet and the end worksheet according to the test signal variable list, and generate a test preparation worksheet, a test execution worksheet and a test end worksheet accordingly.

[0090] The first test case table generating subunit is used to generate the first test case table according to the test preparation worksheet, the test execution worksheet and the test end worksheet.

[0091] Optionally, the second test case table generating unit includes:

[0092] A signal group determination subunit, used to determine the test execution worksheet in the first test case table, and determine the signal group in the test execution worksheet;

[0093] The test case definition subunit is used to determine the name and type of the test case to be generated corresponding to the signal group according to the test case generation rule.

[0094] Optionally, the first test case table generating unit further includes:

[0095] The numerical item filling subunit is used to fill the numerical items according to the test signal variable list. If the number of numerical items to be filled is greater than the number of columns corresponding to the numerical row, a new row below the numerical row will be started to continue filling the unfilled numerical items.

[0096] Optionally, the variable mapping file generating module 310 includes:

[0097] A test signal variable importing unit, used for importing the test signal variables in the test signal variable list into the hardware-in-the-loop test system;

[0098] The variable mapping file generating unit is used to link the test signal variable to a mapping address recognizable by the hardware-in-the-loop test system to generate a variable mapping file.

[0099] Optionally, the target test case generation module 330 includes:

[0100] A mapping address determination unit, used to traverse all signal variables in the target test case table and determine the mapping addresses corresponding to the signal variables in the variable mapping file;

[0101] A test case execution part adding unit, used for determining the test case execution part corresponding to the signal variable from the mapping address according to the execution type of the signal variable, and adding the test case execution part to the target test case table;

[0102] The target test case generating unit is used to generate an automatic test sequence file according to the target test case table after adding the test case execution part, and use the test cases in the automatic test sequence file as target test cases.

[0103] The test case generation device provided in the embodiment of the present invention can execute the test case generation method provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0104] Embodiment 4

[0105] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0106] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0107] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0108] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a test case generation method.

[0109] In some embodiments, the test case generation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the test case generation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the test case generation method in any other appropriate manner (e.g., by means of firmware).

[0110] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0111] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0112] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0113] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0114] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0115] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0116] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0117] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A test case generation method, characterized in that: The method comprises: Determine a test signal variable list of the domain controller, and generate a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system; Generate a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule; Generate a target test case according to the target test case table and the variable mapping file.

2. The method according to claim 1, characterized in that Generate a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule, including: Importing the test signal variable list into a predetermined test case template to generate a first test case table; Determine the name and type of the test case to be generated according to the first test case table and the test case generation rule, and generate a second test case table based on the name and type; The first test case table and the second test case table are used as target test case tables.

3. The method according to claim 2, characterized in that The test case template includes an initialization worksheet, a function worksheet and an end worksheet; Importing the test signal variable list into a predetermined test case template to generate a first test case table, including: According to the test signal variable list, the initialization worksheet, the function worksheet and the end worksheet are filled respectively, and a test preparation worksheet, a test execution worksheet and a test end worksheet are generated accordingly; The first test case table is generated according to the test preparation worksheet, the test execution worksheet and the test completion worksheet.

4. The method according to claim 3, characterized in that: Determine the name and type of the test case to be generated according to the first test case table and the test case generation rule, including: Determine the test execution worksheet in the first test case table, and determine a signal group in the test execution worksheet; The name and type of the test case to be generated corresponding to the signal group are determined according to the test case generation rule.

5. The method according to claim 2, characterized in that: In the process of importing the test signal variable list into a predetermined test case template to generate a first test case table, the process further includes: When filling the numerical items according to the test signal variable list, if the number of the numerical items to be filled is greater than the number of columns corresponding to the numerical row, another row below the numerical row is started to continue filling the unfilled numerical items.

6. The method according to claim 1, characterized in that Generate a variable mapping file according to the test signal variable list through the hardware-in-the-loop test system, including: Importing the test signal variables in the test signal variable list into a hardware-in-the-loop test system; The test signal variable is linked to a mapping address recognizable by the hardware-in-the-loop test system to generate a variable mapping file.

7. The method according to claim 1, characterized in that Generating a target test case according to the target test case table and the variable mapping file includes: Traversing all signal variables in the target test case table, and determining a mapping address corresponding to the signal variable in the variable mapping file; According to the execution type of the signal variable, determining the test case execution part corresponding to the signal variable from the mapping address, and adding the test case execution part to the target test case table; An automatic test sequence file is generated according to the target test case table after adding the test case execution part, and the test cases in the automatic test sequence file are used as target test cases.

8. A test case generating device, characterized in that: The device comprises: A variable mapping file generation module is used to determine a test signal variable list of a domain controller, and generate a variable mapping file according to the test signal variable list through a hardware-in-the-loop test system; A test case table generation module, used to generate a target test case table according to the test signal variable list, a predetermined test case template and a test case generation rule; The target test case generation module is used to generate a target test case according to the target test case table and the variable mapping file.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the test case generating 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 instructions, and the computer instructions are used to enable a processor to implement the test case generation method according to any one of claims 1 to 7 when executed.