Test case generation method and device, equipment, medium and product

By converting the data of the table to be converted into test cases suitable for different HIL models, the problem of non-universal test cases under different HIL models in the automotive industry is solved, and the universality and consistency of test cases are achieved, ensuring the test results accuracy.

CN119248651APending Publication Date: 2025-01-03FAW JIEFANG AUTOMOTIVE CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411403638.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the automotive industry, the hardware-in-loop (HIL) test models of each company are different, resulting in uncommon test cases and lack of consistency in test reports, making it difficult to achieve test cases conversion and generation under different HIL models.

Method used

By obtaining the data to be converted based on the data chart template, importing the hardware in-loop test model and description file at the target end, and using the API interface of the HIL model to convert the data to be converted into test cases to realize the test under different HIL models Use case generation.

Benefits of technology

It improves the universality of test case generation, meets the test case requirements of different HIL models, ensures the consistency and accuracy of the test environment, and provides more accurate and reliable test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248651A_ABST
    Figure CN119248651A_ABST
Patent Text Reader

Abstract

The invention discloses a test case generation method and device, equipment, a medium and a product, and relates to the technical field of testing. The test case generation method comprises the steps that to-be-converted table data written based on a data chart template is acquired; importing a hardware-in-the-loop test model and a description file of the target end, and performing variable activation based on the table data to be converted; and converting the to-be-converted table data into a test case based on an API interface of a hardware-in-loop test HIL model. The to-be-converted table data in the table format is converted based on the API interfaces of the HIL model provided by different target ends, and the test case suitable for the HIL model is obtained. According to the invention, the conversion generation of the test cases under different HIL models is realized, the universality of the generation of the test cases is improved, and the requirements of the test cases of different HIL models are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Currently, when Internet companies are performing software iteration and upgrade, in order to ensure that the unchanged parts of the software are not affected by the iteration and upgrade, they should test the unchanged parts of the software with all test cases. In order to save time and ensure the reliability of the software, automated testing has been introduced.

[0003] In the current automotive industry, automotive controller software usually needs to be used together with sensors and actuators to complete integration testing. Therefore, the concept of Hardware-In-the-Loop (HIL) testing is introduced in integration testing.

[0004] However, in the automotive industry, the HILs of different controllers purchased by each enterprise may come from multiple companies, and each company's HIL has its own automated integrated testing software. The test cases between them are not universal, and the test reports are not consistent. Summary of the invention

[0005] The present invention provides a test case generation method, device, equipment, medium and product to realize the generation of test cases for different test platforms.

[0006] According to a first aspect of the present invention, there is provided a test case generation method, comprising:

[0007] Get the table data to be converted based on the data chart template;

[0008] Importing the hardware-in-the-loop test model and description file of the target end, and activating variables based on the table data to be converted;

[0009] Based on the API interface of the hardware-in-the-loop test HIL model, the table data to be converted is converted into a test case.

[0010] According to a second aspect of the present invention, there is provided a test case generating device, comprising:

[0011] A data acquisition module, used to acquire table data to be converted written based on a data chart template;

[0012] A variable activation module, used for importing the hardware-in-the-loop test model and description file of the target end, and activating the variables based on the table data to be converted;

[0013] The use case conversion module is used to convert the table data to be converted into a test case based on the API interface of the hardware-in-the-loop test HIL model.

[0014] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0015] at least one processor; and

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

[0017] 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.

[0018] According to a fourth 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.

[0019] According to a fifth aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the test case generation method of any embodiment of the present invention is implemented.

[0020] The technical solution of the embodiment of the present invention is to obtain the table data to be converted written based on the data chart template; import the hardware-in-the-loop test model and description file of the target end, and activate the variables based on the table data to be converted; based on the API interface of the hardware-in-the-loop test HIL model, convert the table data to be converted into a test case. By converting the table data to be converted in a tabular format based on the API interface of the HIL model provided by different target ends, a test case suitable for the HIL model is obtained. The conversion generation of test cases under different HIL models is realized, the universality of test case generation is improved, and the requirements of test cases for different HIL models are met.

[0021] 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

[0022] 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.

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

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

[0025] Figure 3 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0026] 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.

[0027] 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.

[0028] Embodiment 1

[0029] Figure 1 A flowchart of a test case generation method is provided for the first embodiment of the present invention. This embodiment can be applied to the generation of test cases, such as the generation of platform-based collaborative automatic test cases for commercial vehicles. 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:

[0030] S110, obtaining table data to be converted written based on a data chart template.

[0031] Among them, the data chart template includes: use case information items, test prerequisite items, test operation step items, test result items and test post-condition items. For example, each item in the data chart template can specifically include: TestCase (use case information item) includes: TestCaseID (test case ID), TestCaseDecription (test case description); Pre-Condition (test prerequisite item) includes: Source (signal source: ECU or HIL model), ParameterName (variable name), Value (variable value), WaitTime (waiting time after execution); TestSteps (test operation step item) includes: Source (signal source: ECU or HIL model), ParameterName (variable name), Value (variable value), WaitTime (waiting time after execution); TestResult (test result item) includes: Source (signal source: ECU or HIL model), SignalName (signal name), RefValue (expected result), Operation (comparison method for expected results), Range Min (limit minimum value), Range Max (limit maximum value), Value (actual value), WaitTime (waiting time after execution), Pass / Fail (pass / fail); End-Condition (test post-condition item): Source (signal source: ECU or HIL model), ParameterName (variable name), Value (variable value), WaitTime (waiting time after execution).

[0032] In this embodiment, the table data to be converted can be understood as test case related data in the form of an Excel table.

[0033] Specifically, relevant testers can fill in the table data to be converted based on the instructions given in the data chart template, and the processor can obtain the table data to be converted written based on the data chart template.

[0034] S120, importing the hardware-in-the-loop test model and description file of the target end, and activating variables based on the data in the table to be converted.

[0035] In this embodiment, the target end can be understood as the device end of different manufacturers for testing. The hardware-in-the-loop test HIL model can be understood as a technology for testing embedded control systems (such as vehicle control systems, BMS battery management systems, and MCU motor controllers in the automotive field). The description file can be understood as a description file for ECU calibration, which is mainly used for the description of internal ECU variables for measurement and calibration purposes, so as to achieve compatibility and data exchange between different calibration tools and environments, such as A2L files.

[0036] Specifically, the hardware-in-the-loop test model and description file of the target end are imported, and the variables to be executed in the table data to be converted are activated.

[0037] S130 , based on the API interface of the hardware-in-the-loop test HIL model, convert the table data to be converted into test cases.

[0038] In this embodiment, the Application Programming Interface (API) interface can be understood as a protocol for connecting different software systems, components or services. Through the API interface, developers can access and use the functions and data of other software systems without knowing their internal implementation details. Test cases can be understood as a set of inputs, operations and expected results used to verify whether a software system meets specific requirements.

[0039] Specifically, since the HIL model of each target end may be different, the processor can perform conversion through a pre-written script, for example, by calling the script to read and write the table data to be converted, and write the read data content into the structure reserved by the API interface, and package it to generate a test case belonging to the HIL model.

[0040] The technical solution of the embodiment of the present invention is to obtain the table data to be converted written based on the data chart template; import the hardware-in-the-loop test model and description file of the target end, and activate the variables based on the table data to be converted; based on the API interface of the hardware-in-the-loop test HIL model, convert the table data to be converted into a test case. By converting the table data to be converted in a tabular format based on the API interface of the HIL model provided by different target ends, a test case suitable for the HIL model is obtained. The conversion generation of test cases under different HIL models is realized, the universality of test case generation is improved, and the requirements of test cases for different HIL models are met.

[0041] Further, based on the above embodiment, based on the API interface of the hardware-in-the-loop test HIL model, the steps of converting the table data to be converted into test cases can be refined as follows:

[0042] S1301, reading the test case content included in the table data to be converted.

[0043] In this embodiment, the test case content can be understood as the content that supports the test case to be tested.

[0044] Specifically, the processor can call a pre-written script. According to the script content, the processor can first obtain the file name and extension of the table data to be converted, and distinguish different test cases in the data table to be converted by reading the tags contained in the table data to be converted, determine the test case name in each tag and add it to the test case content.

[0045] Among them, based on the above embodiment, the step of reading the test case content included in the table data to be converted can be refined as follows:

[0046] Determine the labels in the table data to be converted; based on the labels, determine the test items included in the table data to be converted; read the column data under the labels from the table data to be converted to obtain the test case content of the test item.

[0047] In this embodiment, the label can be understood as a label set in the table to distinguish each test item. The test items can be understood as different contents of the test, such as different items corresponding to different subsystems or devices of the test, such as fan and throttle test items. The table data to be converted is distinguished by columns for different contents, and each column in the table data to be converted corresponds to different items of data.

[0048] Specifically, the processor can traverse the table data to be converted, determine the labels in the table data to be converted, and determine the project names and the number of projects of the test projects contained in the table data to be converted based on the labels. The processor can read the column data under each label from the table data to be converted to obtain the test case content of the test project.

[0049] S1302: Fill the test case content into the structure reserved by the HIL model API interface to obtain the test case to be packaged.

[0050] In this embodiment, the structure can be understood as being used to define a group of related data fields to facilitate data transmission and processing in API calls. The test cases to be packaged can be understood as the corresponding individual test cases in the table data to be converted, and usually multiple test cases are set in a data table to be converted.

[0051] Specifically, the processor may traverse the test case content, and fill the test-related content in the traversal result into the structure reserved by the HIL model API interface to obtain the test case to be packaged.

[0052] Among them, based on the above embodiment, the test case content can be filled into the structure reserved by the HIL model API interface to obtain the steps of the test case to be packaged as follows:

[0053] Traverse each line of the test case content; determine the index of the current line, if the target column of the current line has a value, create a test step object and add the test step object to the test case to be packaged; otherwise, determine the next line based on the index and return to the creation step of the test step object until the traversal of the test case content is completed and the test case to be packaged is obtained.

[0054] In this embodiment, the current row can be understood as the row currently being traversed. The target column can be understood as the column used to determine the step. The test step object can be understood as the object used to describe each operation in the test case. The index can be understood as the row used to locate the traversed row.

[0055] Specifically, the processor can traverse each line of the test case content, determine the index of the current line, and if the target column of the current line has a value, create a test step object and add the test step object to the test case to be packaged; otherwise, determine the next line based on the index, and return to the creation step of the test step object until the traversal of the test case content is completed and the test case to be packaged is obtained.

[0056] Iterates through the rows in a table. Specifically, it uses the variables TC.StartRow and TC.EndRow+1 to determine the range of rows that need to be traversed. In each row, it checks whether there are values ​​in columns 4, 8, 12, and 16, and creates corresponding objects (such as TestStep or TestResult) based on these values ​​and adds them to the corresponding lists. Finally, the TestCase object is added to the TestCases list and the list is returned.

[0057] S1303. Create preconditions and postconditions for the test steps according to the test case content.

[0058] In this implementation, the precondition can be understood as the conditions or requirements that must be met before executing the test case to ensure the normal progress of the test and the accuracy of the test. The postcondition can be understood as the operations that must be performed or the conditions that must be met after the test case is executed to ensure the recovery of the test environment and the cleaning of data. Among them, these conditions may involve multiple aspects such as software environment, hardware environment, data status and network connection.

[0059] Specifically, the processor can call the creation method of preconditions and postconditions under the class configured by the API interface, create instance objects of test step preconditions and postconditions, and assign values ​​through corresponding conditions in the test case content to obtain the preconditions and postconditions of the test steps.

[0060] Among them, based on the above embodiment, the steps of creating the preconditions and postconditions of the test steps according to the test case content can be refined as follows:

[0061] Call the create precondition block method of the class of the API interface, create an instance object of the test step precondition based on the test case content, and assign it to the precondition variable as the precondition of the test step; call the create postcondition block method of the class of the API interface, create an instance object of the test step postcondition based on the test case content, and assign it to the postcondition variable as the postcondition of the test step.

[0062] In this embodiment, the class can be understood as a basic building block in object-oriented programming, which provides a structured way to organize and manage related data and operations. It is a basic building block in object-oriented programming, which provides a structured way to organize and manage related data and operations, such as TCG.api.PackageApi.TestStepApi. The method of creating a precondition block can be understood as a function for creating a precondition. The precondition block is usually used to check whether a specific condition is met before performing certain operations, such as CreateTsPreconditionBlock(). The instance object can be understood as a specific object corresponding to the definition of the class. Each instance object has its own data and methods, and the state of the object can be changed or a specific operation can be performed by calling the method. The precondition variable can be understood as a precondition used to describe the test case. By defining and satisfying the precondition variable, it can ensure that the test is executed in the expected environment, thereby providing more accurate and reliable test results, such as TSPrecondition. The method of creating a postcondition block can be understood as a function for creating a postcondition, such as CreateTsPostconditionBlock(). Postcondition variables can be understood as being used to describe postconditions in test cases. By defining and satisfying postcondition variables, it is possible to ensure that the results of the operation meet expectations, thereby providing more accurate and reliable test results, which can be represented by TSEndcondition, for example.

[0063] Specifically, the processor can call the create precondition block method of the API interface class, create an instance object of the test step precondition based on the test case content, and assign it to the precondition variable as the precondition of the test step; call the create postcondition block method of the API interface class, create an instance object of the test step postcondition based on the test case content, and assign it to the postcondition variable as the postcondition of the test step.

[0064] S1304: Package the test cases to be packaged, the preconditions and the postconditions to obtain the test cases.

[0065] Specifically, the processor may uniformly package the test cases to be packaged, the preconditions, and the postconditions that belong to the table data to be converted to obtain the test cases.

[0066] The technical solution of the embodiment of the present invention obtains the table data to be converted written based on the data chart template; imports the hardware-in-the-loop test model and description file of the target end, and activates the variables based on the table data to be converted. Read the test case content in the table data to be converted, and fill the test case content into the structure reserved by the API interface of the hardware-in-the-loop test HIL model according to the different test items represented by the tags, obtain the test case to be packaged, and create the preconditions and postconditions of the test steps according to the test case content. By setting the preconditions and postconditions, the consistency and accuracy of the test environment are ensured, and the results of the operation are ensured to meet expectations, thereby providing more accurate and reliable test results. The test cases to be packaged, the preconditions and postconditions are packaged, and the table data to be converted is converted into test cases. The conversion generation of test cases under different HIL models is realized, the universality of test case generation is improved, and the requirements of test cases of different HIL models are met. It can enable automobile manufacturers to have more choices when purchasing HIL for different projects.

[0067] Embodiment 2

[0068] Figure 2 This is a schematic diagram of the structure of a test case generation device provided by Embodiment 3 of the present invention. Figure 2 As shown, the device includes: a data acquisition module 21, a variable activation module 22 and a use case conversion module 23.

[0069] The data acquisition module 21 is used to acquire the table data to be converted written based on the data chart template;

[0070] A variable activation module 22, used for importing the hardware-in-the-loop test model and description file of the target end, and activating the variables based on the table data to be converted;

[0071] The use case conversion module 23 is used to convert the table data to be converted into a test case based on the API interface of the hardware-in-the-loop test HIL model.

[0072] The technical solution of the embodiment of the present invention is to obtain the table data to be converted written based on the data chart template; import the hardware-in-the-loop test model and description file of the target end, and activate the variables based on the table data to be converted; based on the API interface of the hardware-in-the-loop test HIL model, convert the table data to be converted into a test case. By converting the table data to be converted in a tabular format based on the API interface of the HIL model provided by different target ends, a test case suitable for the HIL model is obtained. The conversion generation of test cases under different HIL models is realized, the universality of test case generation is improved, and the requirements of test cases for different HIL models are met.

[0073] The data chart template includes: use case information items, test prerequisite items, test operation steps items, test result items and test post-condition items.

[0074] Furthermore, the use case conversion module 23 includes:

[0075] A content reading unit, used for reading the test case content included in the table data to be converted;

[0076] A worksheet determination unit, used to fill the test case content into the structure reserved by the HIL model API interface to obtain the test case to be packaged;

[0077] A condition determination unit, used to create preconditions and postconditions of test steps according to the test case content;

[0078] The use case determination unit is used to package the test case to be packaged, the precondition and the postcondition to obtain a test case.

[0079] Wherein, the content reading unit is specifically used for:

[0080] Determine the labels in the table data to be converted;

[0081] Based on the label, determining the test items included in the table data to be converted;

[0082] The column data under the label is read from the table data to be converted to obtain the test case content of the test item.

[0083] Wherein, the work table determination unit is specifically used for:

[0084] Traverse each line of the test case content;

[0085] Determine the index of the current row, if the target column of the current row has a value, create a test step object, and add the test step object to the test case to be packaged;

[0086] Otherwise, the next row is determined based on the index, and the step of creating the test step object is returned until the traversal of the test case content is completed to obtain the test case to be packaged.

[0087] Wherein, the condition determination unit is specifically used for:

[0088] Calling the create precondition block method of the class of the API interface, creating an instance object of the test step precondition based on the test case content, and assigning it to the precondition variable as the precondition of the test step;

[0089] The create post-condition block method of the class of the API interface is called, and based on the test case content, an instance object of the test step post-condition is created and assigned to a post-condition variable as the post-condition of the test step.

[0090] Optionally, the device further comprises:

[0091] The use case maintenance module is used to obtain function maintenance information after converting the table data to be converted into test cases based on the API interface of the hardware-in-the-loop test HIL model, and maintain the test cases based on the function maintenance information.

[0092] Furthermore, the use case maintenance module is specifically used for:

[0093] When the function maintenance information is function change type information, a target test case related to the function change is determined, and the target test case is maintained.

[0094] Furthermore, the use case maintenance module is specifically used for:

[0095] When the function maintenance information is adding function type information, a new test case is generated.

[0096] Optionally, the device also includes: a use case execution module.

[0097] The use case execution module is specifically used to execute the test case to obtain the execution result after converting the table data to be converted into the test case based on the API interface of the hardware-in-the-loop test HIL model; and adjust the test case based on the execution result.

[0098] 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.

[0099] Embodiment 3

[0100] Figure 3 A schematic diagram of the structure of an electronic device 30 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.

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

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

[0103] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 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 31 executes the various methods and processes described above, such as a test case generation method.

[0104] 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 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the test case generation method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the test case generation method in any other appropriate manner (e.g., by means of firmware).

[0105] 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.

[0106] 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.

[0107] 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.

[0108] 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).

[0109] 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.

[0110] 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.

[0111] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the test case generation method of any embodiment of the present invention is implemented.

[0112] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0113] 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.

[0114] 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: include: Get the table data to be converted based on the data chart template; Importing the hardware-in-the-loop test model and description file of the target end, and activating variables based on the table data to be converted; Based on the API interface of the hardware-in-the-loop test HIL model, the table data to be converted is converted into a test case.

2. The method according to claim 1, characterized in that The data chart template includes: use case information items, test prerequisite items, test operation steps items, test result items and test post-condition items.

3. The method according to claim 1, characterized in that The API interface based on the hardware-in-the-loop test HIL model converts the table data to be converted into a test case, including: Reading the test case content included in the table data to be converted; Fill the test case content into the structure reserved by the HIL model API interface to obtain the test case to be packaged; Create preconditions and postconditions for test steps based on the test case content; The test case to be packaged, the precondition and the postcondition are packaged to obtain a test case.

4. The method according to claim 3, characterized in that The step of reading the test case content included in the table data to be converted includes: Determine the labels in the table data to be converted; Based on the label, determining the test items included in the table data to be converted; The column data under the label is read from the table data to be converted to obtain the test case content of the test item.

5. The method according to claim 3, characterized in that: Filling the test case content into the structure reserved by the HIL model API interface to obtain the test case to be packaged includes: Traverse each line of the test case content; Determine the index of the current row, if the target column of the current row has a value, create a test step object, and add the test step object to the test case to be packaged; Otherwise, the next row is determined based on the index, and the step of creating the test step object is returned until the traversal of the test case content is completed to obtain the test case to be packaged.

6. The method according to claim 3, characterized in that The step of creating the preconditions and postconditions of the test steps according to the test case content includes: Calling the create precondition block method of the class of the API interface, creating an instance object of the test step precondition based on the test case content, and assigning it to the precondition variable as the precondition of the test step; The create post-condition block method of the class of the API interface is called, and based on the test case content, an instance object of the test step post-condition is created and assigned to a post-condition variable as the post-condition of the test step.

7. The method according to claim 1, characterized in that After the API interface based on the hardware-in-the-loop test HIL model converts the table data to be converted into a test case, the method further includes: Acquire function maintenance information, and maintain test cases based on the function maintenance information.

8. The method according to claim 7, characterized in that The maintaining of the test case based on the function maintenance information includes: When the function maintenance information is function change type information, a target test case related to the function change is determined, and the target test case is maintained.

9. The method according to claim 7, characterized in that: The maintaining of the test case based on the function maintenance information includes: When the function maintenance information is adding function type information, a new test case is generated.

10. The method according to claim 1, characterized in that After the API interface based on the hardware-in-the-loop test HIL model converts the table data to be converted into a test case, the method further includes: Execute the test case and obtain the execution result; The test case is adjusted based on the execution result.

11. A test case generating device, characterized in that: include: A data acquisition module, used to acquire table data to be converted written based on a data chart template; A variable activation module, used for importing the hardware-in-the-loop test model and description file of the target end, and activating the variables based on the table data to be converted; The use case conversion module is used to convert the table data to be converted into a test case based on the API interface of the hardware-in-the-loop test HIL model.

12. The device according to claim 11, characterized in that The use case conversion module includes: A content reading unit, used for reading the test case content included in the table data to be converted; A worksheet determination unit, used to fill the test case content into the structure reserved by the HIL model API interface to obtain the test case to be packaged; A condition determination unit, used to create preconditions and postconditions of test steps according to the test case content; The use case determination unit is used to package the test case to be packaged, the precondition and the postcondition to obtain a test case.

13. 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 10.

14. 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 10 when executed.

15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the test case generating method according to any one of claims 1 to 10.