CN117609030A - Kanzi-based HMI (human machine interface) automatic test method, kanzi-based HMI automatic test system and storage medium - Google Patents
Kanzi-based HMI (human machine interface) automatic test method, kanzi-based HMI automatic test system and storage medium Download PDFInfo
- Publication number
- CN117609030A CN117609030A CN202311564319.2A CN202311564319A CN117609030A CN 117609030 A CN117609030 A CN 117609030A CN 202311564319 A CN202311564319 A CN 202311564319A CN 117609030 A CN117609030 A CN 117609030A
- Authority
- CN
- China
- Prior art keywords
- test
- self
- kanzi
- hmi
- result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 209
- 238000010998 test method Methods 0.000 title claims abstract description 15
- 238000000034 method Methods 0.000 claims abstract description 13
- 238000013515 script Methods 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 5
- 238000004806 packaging method and process Methods 0.000 claims description 5
- 238000011161 development Methods 0.000 abstract description 10
- 238000012795 verification Methods 0.000 abstract description 7
- 230000006870 function Effects 0.000 description 9
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000011990 functional testing Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
The invention relates to the technical field of HMI function test, and provides an HMI automatic test method, an HMI automatic test system and a storage medium based on Kanzi. And further, testing and verifying are carried out on the target machine aiming at the Kanzi HMI realization layer, so that independent verification of the functional integrity and the correctness in the Kanzi HMI program is realized. The method not only can be used for development and self-test in the development process, but also can help to quickly locate the attribution of the problem in the problem solving stage.
Description
Technical Field
The invention relates to the technical field of HMI function test, in particular to an HMI automatic test method, an HMI automatic test system and a storage medium based on Kanzi.
Background
Kanzi is an emerging embedded HMI development tool widely applied to the automobile industry, and a large number of instrument HMI projects are developed by adopting the tool. In the conventional instrument HMI development process, HMI function test is often performed by a developer and a tester transmitting an analog CAN signal through a rack to perform self-test and test verification of HMI functions. This test mode has the following drawbacks:
1. the test cannot be performed on the HMI layer, and when the test verifies that the problem is found, time still needs to be spent for positioning the specific problem, and the reason for the problem is whether the MCU layer, the middleware layer or the HMI layer is implemented.
2. The test operation is needed to be manually executed and simply repeated, the test contents cannot form a reusable test script, and the efficiency is low.
3. Performing simulation of complex HMI interactive verification requires a lot of time to write complex test scripts, which is time-consuming and labor-consuming.
Disclosure of Invention
The invention provides an HMI (human machine interface) automatic test method, an HMI automatic test system and a storage medium based on Kanzi, which solve the technical problems that the existing HMI functional test cannot be conducted aiming at the realization of an HMI layer and the test efficiency is low.
In order to solve the technical problems, the invention provides an HMI (human machine interface) automatic test method based on Kanzi, which comprises the following steps:
s1, acquiring and analyzing a self-test script to obtain a self-test command;
s2, executing the self-test command in Kanzi application, and acquiring test attribute data;
s3, comparing the test attribute data with an expected result, and outputting a self-test result;
and S4, integrating all the self-test results to obtain a test report.
In a further embodiment, in said step S1:
the self-test instruction comprises an instruction for setting a data source value and an instruction for setting an attribute value;
the self-test instruction comprises at least one section of automatic node, and the section of automatic node is a group of test commands which are executed simultaneously; the child node datavalue of the auto node corresponds to the value of the attribute of the set data source or node in a group of test commands; the child node result_check of the auto node refers to the result of the expected attribute value after the execution of a set of test commands is completed, i.e., the expected result.
In a further embodiment, the step S2 includes the steps of:
s21, acquiring a self-test instruction corresponding to each automatic node, and packaging to obtain a corresponding Task;
s22, executing each Task in the main thread of the Kanzi application in sequence, and acquiring the attribute value of the node in the next frame after execution as test attribute data.
In a further embodiment, the step S3 specifically includes: and acquiring an expected result from the self-test script, comparing the expected result with the test attribute data, outputting a self-test result passing the test if the comparison is consistent, and otherwise outputting a self-test result not passing the test.
In a further embodiment, in said step S4: outputting the test report in a text file format; the test report includes the total number of test cases, the number of test cases passed, the number of test cases failed, and details of the number of test cases failed.
The invention also provides an HMI automatic test system based on Kanzi, which is used for executing the HMI automatic test method based on Kanzi: the system comprises a script analysis module, a command execution module, a result checking module and a result output module which are connected in sequence;
the script analysis module is used for analyzing the content of the self-test script and generating a self-test instruction required by the self-test command execution module;
the command execution module is used for executing the self-test command in Kanzi application;
the result checking module is used for comparing the test attribute data with an expected result and outputting a self-test result;
and the result output module is used for integrating all the self-test results to obtain a test report and outputting the test report.
In a further embodiment, the self-test instruction includes an instruction to set a data source value, an instruction to set an attribute value;
the self-test instruction comprises at least one section of automatic node, and the section of automatic node is a group of test commands which are executed simultaneously; the child node datavalue of the auto node corresponds to the value of the attribute of the set data source or node in a group of test commands; the child node result_check of the auto node refers to the result of the expected attribute value after the execution of a set of test commands is completed, i.e., the expected result.
The invention also provides a storage medium, on which a computer program is stored, the computer program being used for being loaded by the above-mentioned Kanzi-based HMI automatic test system to realize the above-mentioned Kanzi-based HMI automatic test method. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The beneficial effects of the invention are as follows:
adding an instruction for setting a data source value and an instruction for setting an attribute value into the self-test instruction, packaging to obtain a corresponding Task by acquiring the self-test instruction corresponding to each automatic node, sequentially executing the tasks in a main thread of Kanzi application, acquiring the attribute value of the node in the next frame after execution as test attribute data, and finally comparing the test attribute data with an expected result to output a self-test result. And further, testing and verifying are carried out on the target machine aiming at the Kanzi HMI realization layer, so that independent verification of the functional integrity and the correctness in the Kanzi HMI program is realized. The method not only can be used for development and self-test in the development process, but also can help to quickly locate the attribution of the problem in the problem solving stage.
Meanwhile, due to the cross-platform characteristic of the Kanzi plug-in, the development can also carry out Kanzi HMI function self-test on a Windows platform, and HMI function verification can be carried out even if a target machine is not available.
The self-test script is multiplexed, and the self-test script which is defined before can be used for carrying out regression test in cooperation with the self-test plug-in after each Kanzi engineering modification. On one hand, the test efficiency is improved through the multiplexing of the self-test script; on the other hand, the phenomenon that the original function is abnormal due to modification can be found in time, and the rapid positioning of faults is realized.
Drawings
FIG. 1 is a workflow diagram of a Kanzi-based HMI automated test method provided by an embodiment of the present invention;
FIG. 2 is a system frame diagram of a Kanzi-based HMI automated test system provided by an embodiment of the present invention;
wherein: the script analysis module 1, the command execution module 2, the result checking module 3 and the result output module 4.
Detailed Description
The following examples are given for the purpose of illustration only and are not to be construed as limiting the invention, including the drawings for reference and description only, and are not to be construed as limiting the scope of the invention as many variations thereof are possible without departing from the spirit and scope of the invention.
Example 1
As shown in FIG. 1, the HMI automatic test method based on Kanzi provided by the embodiment of the invention comprises the following steps S1 to S4:
s1, acquiring and analyzing a self-test script from a ROM to obtain a self-test command;
in this embodiment, the self-test instruction includes an instruction for setting a data source value and an instruction for setting an attribute value;
the self-test script is written according to rules formulated by the automatic test plug-in, and each automatic test flow is started by reading the self-test script. Typically, for a content-determined self-test script, the self-test results of each execution of an automated test are the same.
The self-test script is an xml format file, and examples of the self-test script are as follows:
<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……>
……
</autotest>
……
</autotestroot>
the self-test instruction comprises at least one section of automatic node, and the section of automatic node is a group of test commands which are executed simultaneously; the child node datavalue of the auto node corresponds to the value of the attribute of the set data source or node in a group of test commands; the child node result_check of the auto node refers to the result of the expected attribute value after the execution of a set of test commands is completed, i.e., the expected result.
S2, executing the self-test command in Kanzi application and acquiring test attribute data, wherein the method comprises the following steps of S21-S22:
s21, acquiring a self-test instruction corresponding to each automatic node, and packaging to obtain a corresponding Task;
s22, executing each Task in the main thread of the Kanzi application in sequence, and acquiring the attribute value of the node in the next frame after execution as test attribute data.
S3, comparing the test attribute data with an expected result, and outputting a self-test result, wherein the self-test result specifically comprises the following steps: and acquiring an expected result from the self-test script, comparing the expected result with the test attribute data, outputting a self-test result passing the test if the comparison is consistent, and otherwise outputting a self-test result not passing the test.
And S4, integrating all the self-test results to obtain a test report.
In this embodiment, the test report is output in a 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 embodiment of the invention has the following beneficial effects:
adding an instruction for setting a data source value and an instruction for setting an attribute value into the self-test instruction, packaging to obtain a corresponding Task by acquiring the self-test instruction corresponding to each automatic node, sequentially executing the tasks in a main thread of Kanzi application, acquiring the attribute value of the node in the next frame after execution as test attribute data, and finally comparing the test attribute data with an expected result to output a self-test result. And further, testing and verifying are carried out on the target machine aiming at the Kanzi HMI realization layer, so that independent verification of the functional integrity and the correctness in the Kanzi HMI program is realized. The method not only can be used for development and self-test in the development process, but also can help to quickly locate the attribution of the problem in the problem solving stage.
Meanwhile, due to the cross-platform characteristic of the Kanzi plug-in, the development can also carry out Kanzi HMI function self-test on a Windows platform, and HMI function verification can be carried out even if a target machine is not available.
The self-test script is multiplexed, and the self-test script which is defined before can be used for carrying out regression test in cooperation with the self-test plug-in after each Kanzi engineering modification. On one hand, the test efficiency is improved through the multiplexing of the self-test script; on the other hand, the phenomenon that the original function is abnormal due to modification can be found in time, and the rapid positioning of faults is realized.
Example 2
The invention also provides an HMI automatic test system based on Kanzi, which is used for executing the HMI automatic test method based on Kanzi in the embodiment 1, and referring to FIG. 2, the HMI automatic test system comprises a script analysis 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 analysis module 1 is used for analyzing the content of the self-test script and generating a self-test instruction required by the self-test command execution module;
the command execution module 2 is configured to execute the self-test command in a Kanzi application; in the execution process of the stage, the HMI interface can correspondingly change due to the execution of the self-test command, and a developer and a tester can observe whether the change condition of the HMI interface accords with the test expectation or not, and can preset an expected result value of the test in the self-test script, wherein the expected result in the self-test script is a certain attribute value of a certain node.
The result checking module 3 is used for comparing the test attribute data with an expected result and outputting a self-test result;
in this embodiment, each self-test instruction corresponding to the auto-test node including the self-test result checking instruction performs the self-test result checking and the self-test result checking after the execution of the self-test instruction is completed. When the self-test script does not contain the instruction for checking the self-test result, the self-test result checking module and the self-test result outputting module cannot execute.
And the result output module 4 is used for integrating all the self-test results to obtain a test report and outputting the test report.
In a further embodiment, the self-test instruction includes an instruction to set a data source value, an instruction to set an attribute value;
the self-test instruction comprises at least one section of automatic node, and the section of automatic node is a group of test commands which are executed simultaneously; the child node datavalue of the auto node corresponds to the value of the attribute of the set data source or node in a group of test commands; the child node result_check of the auto node refers to the result of the expected attribute value after the execution of a set of test commands is completed, i.e., the expected result.
Example 3
The present invention also provides a storage medium having stored thereon a computer program for loading by a Kanzi-based HMI automation test system provided in the above embodiment 2 to implement a Kanzi-based HMI automation test method in the above embodiment 1. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The above examples are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above examples, and any other changes, modifications, substitutions, combinations, and simplifications that do not depart from the spirit and principle of the present invention should be made in the equivalent manner, and the embodiments are included in the protection scope of the present invention.
Claims (8)
1. An HMI automation test method based on Kanzi, which is characterized by comprising the following steps:
s1, acquiring and analyzing a self-test script to obtain a self-test command;
s2, executing the self-test command in Kanzi application, and acquiring test attribute data;
s3, comparing the test attribute data with an expected result, and outputting a self-test result;
and S4, integrating all the self-test results to obtain a test report.
2. The method for automatic testing of HMI based on Kanzi according to claim 1, wherein in said step S1:
the self-test instruction comprises an instruction for setting a data source value and an instruction for setting an attribute value;
the self-test instruction comprises at least one section of automatic node, and the section of automatic node is a group of test commands which are executed simultaneously; the child node datavalue of the auto node corresponds to the value of the attribute of the set data source or node in a group of test commands; the child node result_check of the auto node refers to the result of the expected attribute value after the execution of a set of test commands is completed, i.e., the expected result.
3. The method for automatically testing HMI based on Kanzi according to claim 2, wherein said step S2 comprises the steps of:
s21, acquiring a self-test instruction corresponding to each automatic node, and packaging to obtain a corresponding Task;
s22, executing each Task in the main thread of the Kanzi application in sequence, and acquiring the attribute value of the node in the next frame after execution as test attribute data.
4. The method for automatically testing HMI according to claim 2, wherein step S3 is specifically: and acquiring an expected result from the self-test script, comparing the expected result with the test attribute data, outputting a self-test result passing the test if the comparison is consistent, and otherwise outputting a self-test result not passing the test.
5. The method for Kanzi based HMI automation test as recited in claim 4, wherein in step S4: outputting the test report in a text file format; the test report includes the total number of test cases, the number of test cases passed, the number of test cases failed, and details of the number of test cases failed.
6. An HMI automation test system based on Kanzi for executing an HMI automation test method based on Kanzi according to any of claims 1 to 5, characterized by: the system comprises a script analysis module, a command execution module, a result checking module and a result output module which are connected in sequence;
the script analysis module is used for analyzing the content of the self-test script and generating a self-test instruction required by the self-test command execution module;
the command execution module is used for executing the self-test command in Kanzi application;
the result checking module is used for comparing the test attribute data with an expected result and outputting a self-test result;
and the result output module is used for integrating all the self-test results to obtain a test report and outputting the test report.
7. An HMI automated test system as recited in claim 6, wherein: the self-test instruction comprises an instruction for setting a data source value and an instruction for setting an attribute value;
the self-test instruction comprises at least one section of automatic node, and the section of automatic node is a group of test commands which are executed simultaneously; the child node datavalue of the auto node corresponds to the value of the attribute of the set data source or node in a group of test commands; the child node result_check of the auto node refers to the result of the expected attribute value after the execution of a set of test commands is completed, i.e., the expected result.
8. A storage medium having a computer program stored thereon, characterized by: the computer program is configured to be loaded by a Kanzi-based HMI automation test system as claimed in any one of claims 6 to 7, to implement a Kanzi-based HMI automation test method as claimed in any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311564319.2A CN117609030A (en) | 2023-11-21 | 2023-11-21 | Kanzi-based HMI (human machine interface) automatic test method, kanzi-based HMI automatic test system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311564319.2A CN117609030A (en) | 2023-11-21 | 2023-11-21 | Kanzi-based HMI (human machine interface) automatic test method, kanzi-based HMI automatic test system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117609030A true CN117609030A (en) | 2024-02-27 |
Family
ID=89945632
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311564319.2A Pending CN117609030A (en) | 2023-11-21 | 2023-11-21 | Kanzi-based HMI (human machine interface) automatic test method, kanzi-based HMI automatic test system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117609030A (en) |
-
2023
- 2023-11-21 CN CN202311564319.2A patent/CN117609030A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6948152B2 (en) | Data structures for use with environment based data driven automated test engine for GUI applications | |
US6961873B2 (en) | Environment based data driven automated test engine for GUI applications | |
US7526498B2 (en) | Method for generating data structures for automatically testing GUI applications | |
US6986125B2 (en) | Method and apparatus for testing and evaluating a software component using an abstraction matrix | |
CN101339534B (en) | Software test apparatus and test method | |
US9465718B2 (en) | Filter generation for load testing managed environments | |
US6941546B2 (en) | Method and apparatus for testing a software component using an abstraction matrix | |
US7493522B2 (en) | Model independent input reduction | |
US20080307264A1 (en) | Parameterized test driven development | |
US7895575B2 (en) | Apparatus and method for generating test driver | |
CN111506509A (en) | Automatic testing method, device, equipment and storage medium for automobile software unit | |
CN113742215B (en) | Method and system for automatically configuring and calling test tool to perform test analysis | |
CN111680463A (en) | File checking method and device | |
CN111552475A (en) | Method and system for compiling Workload test file for aging test of semiconductor memory | |
US11977478B2 (en) | Compositional verification of embedded software systems | |
CN117609030A (en) | Kanzi-based HMI (human machine interface) automatic test method, kanzi-based HMI automatic test system and storage medium | |
CN114661615A (en) | FPGA software testing method and device | |
CN115348200A (en) | CAN communication function test method and test system | |
CN115328771A (en) | Fault testing method, device, equipment and medium of testing tool | |
JP6072547B2 (en) | Application test system | |
CN111427731B (en) | Automatic split code stream and verification code stream testing method and system | |
CN109800155B (en) | Method and device for testing QTE interlocking application software based on Probe | |
CN113297093A (en) | Testing method and device for bank software | |
CN109446091B (en) | Business entity object testing method and device | |
CN117762802A (en) | Automatic test method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |