A Kanzi-based HMI automated testing method, system, and storage medium

By adopting the Kanzi-based HMI automated testing method, the problem of low testing efficiency in the HMI layer is solved, enabling independent testing and rapid problem localization of the HMI layer, improving testing efficiency and supporting cross-platform self-testing.

CN117609030BActive Publication Date: 2026-11-17FORYOU GENERAL ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311564319.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2026-11-17
Estimated Expiration
2043-11-21

AI Technical Summary

Technical Problem

Existing HMI functional testing cannot effectively test the HMI layer, resulting in low testing efficiency. It requires manual execution of simple and repetitive operations, which is time-consuming and labor-intensive, and it is difficult to create reusable test scripts.

Method used

This paper presents an HMI automated testing method based on Kanzi, which parses self-test commands through self-test scripts, executes and obtains test attribute data, compares the expected results to output self-test results, and integrates test reports.

Benefits of technology

It enables independent testing and verification of the HMI layer, improves testing efficiency, allows for self-testing and rapid problem location during development, supports cross-platform testing, reduces manual operations, and improves the reusability of test scripts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117609030B_ABST
    Figure CN117609030B_ABST
Patent Text Reader

Abstract

This invention relates to the field of HMI functional testing technology, and provides an automated HMI testing method, system, and storage medium based on Kanzi. The method involves adding instructions to set data source values ​​and attribute values ​​to self-test commands. By acquiring the self-test command corresponding to each autotest node, encapsulating it into a corresponding Task, and then executing it sequentially in the main thread of the Kanzi application, the method obtains the attribute values ​​of the nodes in the next frame after execution as test attribute data. Finally, the test attribute data is compared with the expected results to output the self-test results. This allows for testing and verification of the Kanzi HMI implementation layer on the target machine, achieving independent verification of the functional completeness and correctness of the Kanzi HMI program. It can be used not only for self-testing during development but also to help quickly pinpoint the source of problems during the troubleshooting phase.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of HMI functional testing technology, and in particular to an automated HMI testing method, system, and storage medium based on Kanzi. Background Technology

[0002] Kanzi is a new and widely used embedded HMI development tool in the automotive industry, with numerous instrument cluster HMI projects utilizing it. In traditional instrument cluster HMI development, HMI functional testing often involves developers and testers sending simulated CAN signals via a test bench to perform self-testing and verification of the HMI's functionality. This testing method has the following drawbacks: 1. It is impossible to test the HMI layer implementation. When a problem is found during testing, it still takes time to locate the specific cause of the problem, whether it is in the MCU layer, the middleware layer, or the HMI implementation layer.

[0003] 2. Simple and repetitive testing operations need to be performed manually, and the test content cannot be formed into reusable test scripts, resulting in low efficiency.

[0004] 3. Performing simulations of complex HMI interactions requires a significant amount of time to write complex test scripts, which is both time-consuming and labor-intensive. Summary of the Invention

[0005] This invention provides an automated HMI testing method, system, and storage medium based on Kanzi, which solves the technical problems of existing HMI functional testing being unable to test the HMI layer implementation and having low testing efficiency.

[0006] To address the above technical problems, this invention provides an HMI automated testing method based on Kanzi, comprising the following steps: S1. Obtain and parse the self-test script to get the self-test command; S2. Execute the self-test command in the Kanzi application and obtain the test attribute data; S3. Compare the test attribute data with the expected results and output the self-test results; S4. Integrate all the self-test results to obtain a test report.

[0007] In a further embodiment, in step S1: The self-test commands include instructions for setting data source values ​​and instructions for setting attribute values; The self-test command includes at least one autotest node, and an autotest node is a set of test commands executed simultaneously; the child node datavalue of the autotest node corresponds to the value of the data source or node attribute set in the set of test commands; the child node result_check of the autotest node refers to the expected attribute value result after the set of test commands is executed, i.e., the expected result.

[0008] In a further embodiment, step S2 includes the following steps: S21. Obtain the self-test command corresponding to each autotest node and encapsulate it to obtain the corresponding Task; S22. Execute each Task sequentially in the main thread of the Kanzi application, and obtain the attribute values ​​of the nodes in the next frame after execution as test attribute data.

[0009] In a further implementation, step S3 specifically involves: obtaining the expected result from the self-test script, comparing it with the test attribute data, and outputting a self-test result indicating that the test has passed if the comparison is consistent, otherwise outputting a self-test result indicating that the test has failed.

[0010] In a further implementation, in step S4: the test report is output in the format of a text file; the test report includes the total number of test cases, the number of passed test cases, the number of failed test cases, and details of the number of failed test cases.

[0011] The present invention also provides a Kanzi-based HMI automated testing system for executing the above-mentioned Kanzi-based HMI automated testing method: comprising a script parsing module, a command execution module, a result checking module, and a result output module connected in sequence; The script parsing module is used to parse the self-test script content and generate the self-test commands required by the command execution module. The command execution module is used to execute the self-test command in the Kanzi application; The result checking module is used to compare the test attribute data with the expected results and output the self-test results; The result output module is used to integrate all the self-test results to obtain and output a test report.

[0012] In a further implementation, the self-test command includes instructions for setting data source values ​​and instructions for setting attribute values; The self-test command includes at least one autotest node, and an autotest node is a set of test commands executed simultaneously; the child node datavalue of the autotest node corresponds to the value of the data source or node attribute set in the set of test commands; the child node result_check of the autotest node refers to the expected attribute value result after the set of test commands is executed, i.e., the expected result.

[0013] The present invention also provides a storage medium storing a computer program thereon, the computer program being loaded by the aforementioned Kanzi-based HMI automated testing system to implement the aforementioned Kanzi-based HMI automated testing method. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0014] The beneficial effects of this invention are as follows: The self-test commands include instructions for setting data source values ​​and attribute values. By obtaining the self-test command corresponding to each autotest node, it is encapsulated into a corresponding Task, which is then executed sequentially in the main thread of the Kanzi application. The attribute values ​​of the nodes in the next frame after execution are obtained as test attribute data. Finally, the test attribute data is compared with the expected results to output the self-test results. This allows for independent verification of the Kanzi HMI implementation layer on the target machine, achieving independent verification of the functional completeness and correctness of the Kanzi HMI program. This can be used not only for self-testing during development but also to quickly pinpoint the source of problems during the troubleshooting phase.

[0015] Meanwhile, due to the cross-platform nature of the Kanzi plugin, developers can also perform Kanzi HMI function self-testing on the Windows platform, and verify HMI function even without a target machine.

[0016] Self-test script reuse allows for regression testing using pre-defined scripts and plugins after each Kanzi project modification. This improves testing efficiency and enables the timely detection of malfunctions caused by modifications, facilitating rapid fault location. Attached Figure Description

[0017] Figure 1 This is a flowchart of an HMI automated testing method based on Kanzi provided in an embodiment of the present invention; Figure 2This is a system framework diagram of an HMI automated testing system based on Kanzi provided in an embodiment of the present invention; The module consists of: script parsing module 1, command execution module 2, result checking module 3, and result output module 4. Detailed Implementation

[0018] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. The embodiments are given for illustrative purposes only and should not be construed as limiting the present invention. The accompanying drawings are for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.

[0019] Example 1 This invention provides an HMI automated testing method based on Kanzi, such as... Figure 1 As shown, in this embodiment, steps S1 to S4 are included: S1. Obtain and parse the self-test script from the ROM to get the self-test command; In this embodiment, the self-test command includes instructions for setting data source values ​​and instructions for setting attribute values; The self-test script must be written according to the rules defined by the automated testing plugin. Each automated testing process begins by reading the self-test script. Generally, for self-test scripts with defined content, the self-test results will be the same each time the automated test is executed.

[0020] The self-test script is an XML file. An example of a self-test script is shown below: <autotestroot> <autotest datasource_kzb_url="kzb: / / Cluster / Data Sources / my_datasource" default_delay="100" root_node_path_or_alias=" / RootPage / rootNode"> <datavalue value_source="datasource" data_type="float" datasource_path="Cluster.Speed" value="120.0" / > <datavalue value_source="property" data_type="int" property_path="Dataroot" value="1" property_name="RangeConcept.Value" / > <result_check name="displaySpeedCheck" data_type="float" property_path="ResultNode / Data"property_name="Cluster.DisplaySpeed" value="124.0" / > < / autotest> <autotest … …> … … … … < / autotestroot> The self-test command includes at least one autotest node, and an autotest node is a set of test commands executed simultaneously; the child node datavalue of the autotest node corresponds to the value of the data source or node attribute set in the set of test commands; the child node result_check of the autotest node refers to the expected attribute value result after the set of test commands is executed, i.e., the expected result.

[0021] S2. Execute the self-test command in the Kanzi application and obtain test attribute data, including steps S21-S22: S21. Obtain the self-test command corresponding to each autotest node and encapsulate it to obtain the corresponding Task; S22. Execute each Task sequentially in the main thread of the Kanzi application, and obtain the attribute values ​​of the nodes in the next frame after execution as test attribute data.

[0022] S3. Compare the test attribute data with the expected results and output the self-test results. Specifically, obtain the expected results from the self-test script and compare them with the test attribute data. If the comparison is consistent, output the self-test result that the test has passed; otherwise, output the self-test result that the test has failed.

[0023] S4. Integrate all the self-test results to obtain a test report.

[0024] In this embodiment, the test report is output in text file format; the test report includes the total number of test cases, the number of passed test cases, the number of failed test cases, and details of the number of failed test cases, and the output content format is as follows: Total XX cases, XX cases pass, XX cases fail. Failed cases: 1. XX case 2. XX case …… The beneficial effects of the embodiments of the present invention are as follows: The self-test commands include instructions for setting data source values ​​and attribute values. By obtaining the self-test command corresponding to each autotest node, it is encapsulated into a corresponding Task, which is then executed sequentially in the main thread of the Kanzi application. The attribute values ​​of the nodes in the next frame after execution are obtained as test attribute data. Finally, the test attribute data is compared with the expected results to output the self-test results. This allows for independent verification of the Kanzi HMI implementation layer on the target machine, achieving independent verification of the functional completeness and correctness of the Kanzi HMI program. This can be used not only for self-testing during development but also to quickly pinpoint the source of problems during the troubleshooting phase.

[0025] Meanwhile, due to the cross-platform nature of the Kanzi plugin, developers can also perform Kanzi HMI function self-testing on the Windows platform, and verify HMI function even without a target machine.

[0026] Self-test script reuse allows for regression testing using pre-defined scripts and plugins after each Kanzi project modification. This improves testing efficiency and enables the timely detection of malfunctions caused by modifications, facilitating rapid fault location.

[0027] Example 2 This invention also provides a Kanzi-based HMI automated testing system for executing a Kanzi-based HMI automated testing method as described in Embodiment 1 above. (See also...) Figure 2It includes a script parsing module 1, a command execution module 2, a result checking module 3, and a result output module 4, which are connected in sequence. The script parsing module 1 is used to parse the self-test script content and generate the self-test commands required by the command execution module 2. The command execution module 2 is used to execute the self-test command in the Kanzi application. During this execution phase, the HMI interface will change accordingly due to the execution of the self-test command. Developers and testers can observe whether the changes in the HMI interface meet the test expectations. They can also preset the expected test result value in the self-test script. The expected result in the self-test script is to test a certain attribute value of a certain node.

[0028] The result checking module 3 is used to compare the test attribute data with the expected results and output the self-test results; In this embodiment, after the self-test command corresponding to each autotest node containing a self-test result checking instruction is executed, the self-test result will be checked and output. When the self-test script does not contain a self-test result checking instruction, the self-test result checking module and the self-test result output module will not be executed.

[0029] The result output module 4 is used to integrate all the self-test results to obtain a test report and output it.

[0030] In a further implementation, the self-test command includes instructions for setting data source values ​​and instructions for setting attribute values; The self-test command includes at least one autotest node, and an autotest node is a set of test commands executed simultaneously; the child node datavalue of the autotest node corresponds to the value of the data source or node attribute set in the set of test commands; the child node result_check of the autotest node refers to the expected attribute value result after the set of test commands is executed, i.e., the expected result.

[0031] Example 3 The present invention also provides a storage medium storing a computer program, which is used to be loaded by a Kanzi-based HMI automated testing system provided in Embodiment 2 above, to implement a Kanzi-based HMI automated testing method in Embodiment 1 above. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0032] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A Kanzi-based automated HMI testing method, characterized in that, Including the following steps: S1. Obtain and parse the self-test script to get the self-test command; S2. Execute the self-test command in the Kanzi application and obtain the test attribute data; S3. Compare the test attribute data with the expected results and output the self-test results; S4. Integrate all the self-test results to obtain a test report; In step S1: The self-test commands include instructions for setting data source values ​​and instructions for setting attribute values; The self-test command includes at least one autotest node, and an autotest node is a set of test commands executed simultaneously; the child node datavalue of the autotest node corresponds to the value of the data source or node attribute set in the set of test commands; the child node result_check of the autotest node refers to the expected attribute value result after the set of test commands is executed, i.e., the expected result. Step S2 includes the following steps: S21. Obtain the self-test command corresponding to each autotest node and encapsulate it to obtain the corresponding Task; S22. Execute each Task sequentially in the main thread of the Kanzi application, and obtain the attribute values ​​of the nodes in the next frame after execution as test attribute data.

2. The HMI automated testing method based on Kanzi as described in claim 1, characterized in that, Step S3 specifically involves: obtaining the expected result from the self-test script, comparing it with the test attribute data, and outputting a self-test result indicating that the test has passed if the comparison is consistent, otherwise outputting a self-test result indicating that the test has failed.

3. The HMI automated testing method based on Kanzi as described in claim 2, characterized in that, In step S4: the test report is output in text file format; the test report includes the total number of test cases, the number of passed test cases, the number of failed test cases, and details of the number of failed test cases.

4. A Kanzi-based HMI automated testing system, used to execute the Kanzi-based HMI automated testing method as described in any one of claims 1 to 3, characterized in that: It includes a script parsing module, a command execution module, a result checking module, and a result output module, which are connected in sequence. The script parsing module is used to parse the self-test script content and generate the self-test commands required by the command execution module. The command execution module is used to execute the self-test command in the Kanzi application; The result checking module is used to compare the test attribute data with the expected results and output the self-test results; The result output module is used to integrate all the self-test results to obtain and output a test report; The self-test commands include instructions for setting data source values ​​and instructions for setting attribute values; The self-test command includes at least one autotest node, and an autotest node is a set of test commands executed simultaneously; the child node datavalue of the autotest node corresponds to the value of the data source or node attribute set in the set of test commands; the child node result_check of the autotest node refers to the expected attribute value result after the set of test commands is executed, i.e., the expected result.

5. A storage medium having a computer program stored thereon, characterized in that: The computer program is loaded by the Kanzi-based HMI automated testing system as described in claim 4 to implement the Kanzi-based HMI automated testing method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Automatic driving simulation system

    CN116360286A

  • Automatic testing method and device, equipment and storage medium

    CN117076297A