Python-based HMI software automatic testing method and system, storage medium and equipment

Through the Python -based HMI software automation testing method, the Python script controls recording and video equipment and send test cases, combined with image recognition and manual judgment subsystems, solving the problem of low efficiency and error error of the existing HMI software acceptance tasks, and achieved efficient efficiency. , Accurate test results output.

CN119357052APending Publication Date: 2025-01-24CHERY AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411447100.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The existing HMI software acceptance tasks rely on manual execution, which are inefficient, time-consuming, error-prone, and the results are affected by the skills and experience of the testers, and the coverage is limited.

Method used

The Python-based HMI software automated testing method is used to control the audio and video equipment through Python scripts, read the cell signals in the test case table, send them to the vehicle machine for testing, and obtain audio and video data, image data and log files. Input test cases and image data into the image recognition subsystem to verify the image data; input test cases and audio and video data into the manual judgment subsystem to verify the audio and video data. Integrate the two verification results and output a comprehensive test result report.

Benefits of technology

The test efficiency is improved, the objectivity and accuracy of the test results are ensured, the impact of the subjective judgment of the testers has been reduced, and the test scenes can be covered more completely.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357052A_ABST
    Figure CN119357052A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of automatic testing, and provides a Python-based HMI software automatic testing method and system, a storage medium and equipment, and the method comprises the steps: starting audio and video recording equipment; reading and sending cell signals corresponding to the test case in sequence, and obtaining and storing audio and video recording data, image data and a log file generated according to the cell signals; the test case and the image data are input into an image recognition subsystem, and the image recognition subsystem carries out verification and outputs a first verification result; the test case, the audio and video recording data and the log file are input into a manual judgment subsystem, and the manual judgment subsystem carries out verification and outputs a second verification result; and integrating the verification result I and the verification result II, and outputting a comprehensive test result report. According to the invention, objectivity and accuracy of a test result are ensured, all test scenes are covered relatively completely, and test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of automated testing, and in particular relates to a Python-based HMI software automated testing method, system, storage medium and device. Background Art

[0002] Modern computer technology, represented by network and communication information technology, is profoundly affecting people's social foundation and living form. With the rapid development of smart cockpits, HMI design pages are becoming more and more cool and diverse, and the amount of software acceptance tasks for design implementation has also increased dramatically. At present, most of the software acceptance tasks for HMI design implementation are manually performed by professional designers, who use CAN tools to manually send signals, judge the results with the naked eye, manually fill in test results, take photos, and capture logs, etc.

[0003] This method is inefficient and time-consuming, and there are thousands of test cases. Manual execution is prone to fatigue, especially when executing small differences in details. In addition, manual testing relies on the skills and experience of testers. Designers may make mistakes, such as missing some test cases, making errors when executing test steps, or making incorrect annotations on test results. At the same time, the results of manual testing may be affected by the subjective judgment of designers of different modules, and there may be different understandings and interpretations, resulting in inconsistent test conclusions for the same test method. In addition, the coverage of manual testing is limited by the designer's time and mobilized resources. As software systems become more and more complex, it is difficult to cover all possible situations and boundary conditions with a limited set of test cases. In order to solve these problems, a more efficient, accurate and reliable testing method is urgently needed. Summary of the invention

[0004] In view of the above technical problems, the present invention proposes a Python-based HMI software automated testing method, system, storage medium and device.

[0005] A Python-based HMI software automated testing method of the present invention comprises:

[0006] Use Python script to control and start recording and video equipment;

[0007] The Python script sequentially reads each cell signal corresponding to each test case in the test case table, and each cell signal is sent to the vehicle computer installed with the HMI software via the CAN tool, and the vehicle computer is driven to perform the test, and the audio and video data, image data and log file generated according to each cell signal during the test are obtained and saved;

[0008] The Python script inputs the test case and the image data into the image recognition subsystem, the image recognition subsystem verifies all the image data according to the test case and outputs a verification result 1, and feeds the verification result 1 back to the Python script;

[0009] The Python script inputs the test case, the audio and video data and the log file into the manual judgment subsystem, and the manual judgment subsystem verifies all the audio and video data and the log file according to the test case and outputs a second verification result, and feeds the second verification result back to the Python script;

[0010] The Python script integrates the verification result one and the verification result two to output a comprehensive test result report.

[0011] Further,

[0012] The Python script sends the test case and the image data to the image recognition subsystem, the image recognition subsystem verifies all the image data according to the test case and outputs a verification result 1, and feeds the verification result 1 back to the Python script, including:

[0013] The image recognition subsystem compares all the image data with the effect diagram corresponding to the image data according to the test case to obtain similarity, and outputs verification result 1 based on the comparison result of the similarity with a predetermined threshold.

[0014] Further,

[0015] The outputting of verification result 1 based on the size comparison result of the similarity and the predetermined threshold value includes:

[0016] If the similarity is greater than or equal to the predetermined threshold, the verification is passed, and the image data is deleted from the image recognition subsystem, and the cell corresponding to the test case is filled with a first predetermined color and a first predetermined text;

[0017] If the similarity is less than the predetermined threshold, the verification fails. At this time, the cell corresponding to the test case is filled with a second predetermined color and a second predetermined text, and the image data that fails the verification and the rendering corresponding to the image data are uploaded to the Bug Closing subsystem, and the image data is deleted from the image recognition subsystem.

[0018] Further,

[0019] The Python script inputs the test case, the audio and video data and the log file into the manual judgment subsystem, and the manual judgment subsystem verifies all the audio and video data and the log file according to the test case and outputs the second verification result, and feeds the second verification result back to the Python script, including:

[0020] According to the test case, all the video recording data are manually compared with the interaction design corresponding to the audio recording data to obtain a manual comparison result, and a second verification result is output based on the manual comparison result.

[0021] Further,

[0022] The second verification result output based on the manual comparison result includes:

[0023] If the manual comparison result is verified, the cell corresponding to the test case is filled with a first predetermined color and a first predetermined text, and the audio and video data and the log file are deleted from the manual judgment subsystem;

[0024] If the manual comparison result is that the verification fails, the cell corresponding to the test case will be filled with a second predetermined color and a second predetermined text, the audio and video data, log file and the interaction design corresponding to the audio and video data that failed the verification will be uploaded to the Bug Closing Subsystem, and the audio and video data and the log file will be deleted from the manual judgment subsystem.

[0025] The present invention also provides a Python-based HMI software automated testing system, the system comprising:

[0026] Python script, image recognition subsystem, and manual judgment subsystem;

[0027] The Python script,

[0028] Used to control the recording and video equipment using Python scripts;

[0029] It is also used to read each cell signal corresponding to each test case in the test case table in turn, and each cell signal is sent to the vehicle computer installed with the HMI software via the CAN tool, drive the vehicle computer to perform the test, and obtain and save the audio and video data, image data and log file generated according to each cell signal during the test;

[0030] It is also used to input the test case and the image data into the image recognition subsystem, and obtain the verification result 1 fed back by the image recognition subsystem;

[0031] It is also used to input the test case, the audio and video data and the log file into the manual judgment subsystem to obtain the second verification result fed back by the manual judgment subsystem;

[0032] It is also used to integrate the verification result 1 and the verification result 2 to output a comprehensive test result report;

[0033] The image recognition subsystem is used to receive the test case and the image data input by the Python script, verify all the image data according to the test case and output a verification result 1, and feed back the verification result 1 to the Python script;

[0034] The manual judgment subsystem is used to receive the test case, the audio and video data and the log file input by the Python script, verify all the audio and video data and the log file according to the test case and output the second verification result, and feed back the second verification result to the Python script.

[0035] The image recognition subsystem is used to receive the test data distributed by the Python script, perform the test and output the test results;

[0036] The manual judgment subsystem is used to receive the test data distributed by the Python script, perform the test and output the test results.

[0037] Further,

[0038] It also includes: a bug closing subsystem, which is used to receive data that has not passed the verification in the image recognition subsystem and the manual judgment subsystem.

[0039] The present invention also provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed on a computer, the computer executes the aforementioned Python-based HMI software automated testing method.

[0040] The present invention also provides an electronic device, comprising a processor, wherein the processor is coupled to a memory; the processor is used to read and execute a computer program stored in the memory to implement the aforementioned Python-based HMI software automated testing method.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] Testing is performed according to the system's predefined test rules, ensuring the objectivity and accuracy of the test results and avoiding the influence of testers' subjective judgment on the test results. All test scenarios are fully covered, improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0044] Figure 1 It is a flow chart of the HMI software automation testing method based on Python of the present invention;

[0045] Figure 2 It is a schematic diagram of the structure of the HMI software automation test system based on Python of the present invention;

[0046] Figure 3 It is a schematic diagram of the electronic device structure of the present invention.

[0047] Description of reference numerals:

[0048] 201-Python script, 202-image recognition subsystem, 203-manual judgment subsystem, 301-processor, 302-memory. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 are within the scope of protection of the present invention.

[0050] Figure 1 : is a flowchart of a Python-based automated testing method provided by an embodiment of the present invention. In one embodiment, the method specifically includes the following steps:

[0051] Before executing the Python-based automated testing method, it is necessary to first connect the recording and video equipment, vehicle computer, CAN tool and PC via a data cable in a wired or wireless manner, debug the shooting angle of the recording and video equipment, perform geometric calibration and color calibration on the recording and video equipment, and debug the working status of the recording and video equipment, vehicle computer and CAN tool to meet the conditions for executing the Python-based HMI software automated testing method.

[0052] S101: Using Python script to control and start the recording and video recording equipment.

[0053] The Python-based automated testing method is executed through the Python script. After the Python script is run, the Python-based automated testing system is started.

[0054] The Python script issues a control command to turn on the recording and recording device. If the recording and recording device fails to be turned on, a failure signal is issued. The Python script obtains the failure signal, prompts the tester in the form of a pop-up window, and stops running the Python script. If the recording and recording device is turned on successfully, a success signal is issued. The Python script obtains the success signal and executes step S202.

[0055] S102: The Python script reads each cell signal corresponding to each test case in the test case table in turn, and each cell signal is sent to the vehicle computer installed with the HMI software via the CAN tool, and the vehicle computer is driven to perform the test, and the audio and video data, image data and log files generated according to each cell signal during the test are obtained and saved.

[0056] During the test, the audio and video equipment records the large screen of the vehicle control center to generate audio and video data; the large screen of the vehicle control center automatically takes screenshots to generate image data; in addition, a log file is generated. The above audio and video data, image data and log file are obtained, and the audio and video data, image data and log file are saved to a folder at a specified location in the cloud. For audio and video data, the saved file name defaults to the time period of the recording, and the time is specific to seconds; for image data and log files, the saved file name defaults to the time when the file is saved, and the time is specific to seconds.

[0057] S103: The Python script inputs the test case and image data into the image recognition subsystem. The image recognition subsystem verifies all the image data according to the test case and outputs a verification result 1, and feeds back the verification result 1 to the Python script.

[0058] After the Python script inputs the image data into the image recognition subsystem, the image recognition subsystem compares all the image data with the renderings corresponding to the image data according to the test case to obtain the similarity:

[0059] If the similarity is greater than or equal to the predetermined threshold, the verification is passed, and the image data is deleted from the image recognition subsystem, and the cell corresponding to the test case is filled with a first predetermined color and a first predetermined text;

[0060] If the similarity is less than the predetermined threshold, the verification fails. At this time, the cell corresponding to the test case is filled with the second predetermined color and the second predetermined text, and the image data that failed the verification and the rendering corresponding to the image data are uploaded to the Bug Closing Subsystem, a Bug data is generated, the Bug data is customized and named, and the image data is deleted from the image recognition subsystem.

[0061] Preferably, the predetermined threshold is 98%, the first predetermined color is green, the first predetermined text is "pass", the second predetermined color is red, and the second predetermined text is "fail".

[0062] The verification result 1 includes a specific value of the similarity and a verification result, and the verification result includes verification passed and verification failed.

[0063] S104: The Python script inputs the test case, audio and video data and log file into the manual judgment subsystem. The manual judgment subsystem verifies all audio and video data and log files according to the test case and outputs the second verification result, and feeds the second verification result back to the Python script.

[0064] After the Python script inputs the audio and video data and log files into the manual judgment subsystem, it generates a piece of data to be manually judged, customizes the name of the data to be manually judged, and manually compares all the video data with the interaction design corresponding to the audio and video data according to the test case to obtain the manual comparison result:

[0065] If the manual comparison result is verified, the cell corresponding to the test case is filled with the first predetermined color and the first predetermined text, and the audio and video data and the log file are deleted from the manual judgment subsystem;

[0066] If the result of the manual comparison is that the verification failed, the cell corresponding to the test case will be filled with the second predetermined color and the second predetermined text, the audio and video data that failed the verification, the log file, and the interaction design corresponding to the audio and video data will be uploaded to the Bug Closing Subsystem, a Bug data will be generated, the Bug data will be custom named, and the audio and video data and log file will be deleted from the manual judgment subsystem.

[0067] Preferably, the first predetermined color is green, the first predetermined text is "pass", the second predetermined color is red, and the second predetermined text is "fail".

[0068] Verification result 2 includes verification results, and the verification results include verification passed and verification failed.

[0069] S105: The Python script integrates verification result 1 and verification result 2, and outputs a comprehensive test result report.

[0070] The Python script integrates the verification result 1 output by the image recognition subsystem and the verification result 2 output by the manual judgment subsystem to output a comprehensive test result report.

[0071] In another embodiment, the execution order of steps S203 and S204 can be adjusted, that is, S204 is executed first, and then S203.

[0072] The embodiment of the present invention also provides a Python-based HMI software automated testing system, such as Figure 2 As shown, specifically including:

[0073] Python Script 201 for:

[0074] Use Python script to control the recording and video equipment.

[0075] It is also used to read each cell signal corresponding to each test case in the test case table in turn, and each cell signal is sent to the vehicle computer installed with the HMI software via the CAN tool, driving the vehicle computer to perform the test, and obtaining and saving the audio and video data, image data and log files generated according to each cell signal during the test.

[0076] It is also used to input the test case and image data into the image recognition subsystem and obtain the verification result one fed back by the image recognition subsystem.

[0077] It is also used to input test cases, audio and video data and log files into the manual judgment subsystem to obtain the verification result 2 fed back by the manual judgment subsystem.

[0078] It is also used to integrate verification result 1 and verification result 2 to output a comprehensive test result report.

[0079] The image recognition subsystem 202 is used to receive the test case and image data input by the Python script, verify all the image data according to the test case and output the verification result 1, and feed back the verification result 1 to the Python script.

[0080] The manual judgment subsystem 203 is used to receive the test cases, audio and video data and log files input by the Python script, verify all the audio and video data and log files according to the test cases and output the second verification result, and feed back the second verification result to the Python script.

[0081] The Python-based automated testing system also includes a bug closing subsystem for receiving data that has failed verification in the image recognition subsystem and the manual judgment subsystem.

[0082] An embodiment of the present invention further provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed on a computer, the computer executes the Python-based HMI software automated testing method as described in the above method embodiment.

[0083] like Figure 3 As shown, an embodiment of the present invention further provides an electronic device, including: a processor 301, the processor 301 is coupled to a memory 302, and the processor 301 is used to read and execute a computer program stored in the memory 302 to implement the Python-based HMI software automated testing method as described in the above method embodiment.

[0084] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A Python-based HMI software automated testing method, characterized in that: include: Use Python script to control and start recording and video equipment; The Python script sequentially reads each cell signal corresponding to each test case in the test case table, and each cell signal is sent to the vehicle computer installed with the HMI software via the CAN tool, and the vehicle computer is driven to perform the test, and the audio and video data, image data and log file generated according to each cell signal during the test are obtained and saved; The Python script inputs the test case and the image data into the image recognition subsystem, the image recognition subsystem verifies all the image data according to the test case and outputs a verification result 1, and feeds the verification result 1 back to the Python script; The Python script inputs the test case, the audio and video data and the log file into the manual judgment subsystem, and the manual judgment subsystem verifies all the audio and video data and the log file according to the test case and outputs a second verification result, and feeds the second verification result back to the Python script; The Python script integrates the verification result one and the verification result two to output a comprehensive test result report.

2. The method according to claim 1, characterized in that: The Python script sends the test case and the image data to the image recognition subsystem, the image recognition subsystem verifies all the image data according to the test case and outputs a verification result 1, and feeds the verification result 1 back to the Python script, including: The image recognition subsystem compares all the image data with the effect diagram corresponding to the image data according to the test case to obtain similarity, and outputs verification result 1 based on the comparison result of the similarity with a predetermined threshold.

3. The method according to claim 2, characterized in that The outputting of verification result 1 based on the size comparison result of the similarity and the predetermined threshold value includes: If the similarity is greater than or equal to the predetermined threshold, the verification is passed, and the image data is deleted from the image recognition subsystem, and the cell corresponding to the test case is filled with a first predetermined color and a first predetermined text; If the similarity is less than the predetermined threshold, the verification fails. At this time, the cell corresponding to the test case is filled with a second predetermined color and a second predetermined text, and the image data that fails the verification and the rendering corresponding to the image data are uploaded to the Bug Closing subsystem, and the image data is deleted from the image recognition subsystem.

4. The method according to claim 1, characterized in that: The Python script inputs the test case, audio and video data and log files into the manual judgment subsystem, and the manual judgment subsystem verifies all audio and video data and log files according to the test case and outputs the second verification result, and feeds the second verification result back to the Python script, including: According to the test case, all the video recording data are manually compared with the interaction design corresponding to the audio recording data to obtain a manual comparison result, and a second verification result is output based on the manual comparison result.

5. The method according to claim 4, characterized in that The second verification result output based on the manual comparison result includes: If the manual comparison result is verified, the cell corresponding to the test case is filled with a first predetermined color and a first predetermined text, and the audio and video data and the log file are deleted from the manual judgment subsystem; If the manual comparison result is that the verification fails, the cell corresponding to the test case will be filled with a second predetermined color and a second predetermined text, and the audio and video data, log file and the interaction design corresponding to the audio and video data that failed the verification will be uploaded to the Bug Closing Subsystem, and the audio and video data and the log file will be deleted from the manual judgment subsystem.

6. A Python-based HMI software automated testing system, characterized in that: include: Python script, image recognition subsystem, and manual judgment subsystem; The Python script, Used to control the recording and video equipment using Python scripts; It is also used to read each cell signal corresponding to each test case in the test case table in turn, and each cell signal is sent to the vehicle computer installed with the HMI software via the CAN tool, so as to drive the vehicle computer to perform the test, and obtain and save the audio and video data, image data and log file generated according to each cell signal during the test; It is also used to input the test case and the image data into the image recognition subsystem, and obtain the verification result 1 fed back by the image recognition subsystem; It is also used to input the test case, the audio and video data and the log file into the manual judgment subsystem to obtain the second verification result fed back by the manual judgment subsystem; It is also used to integrate the verification result 1 and the verification result 2 to output a comprehensive test result report; The image recognition subsystem is used to receive the test case and the image data input by the Python script, verify all the image data according to the test case and output a verification result 1, and feed back the verification result 1 to the Python script; The manual judgment subsystem is used to receive the test case, the audio and video data and the log file input by the Python script, verify all the audio and video data and the log file according to the test case and output the second verification result, and feed back the second verification result to the Python script.

7. The system according to claim 6, characterized in that Also includes: The bug closing subsystem is used to receive data that fails verification in the image recognition subsystem and the manual judgment subsystem.

8. A computer-readable storage medium, characterized in that: A program or instruction is stored, and when the program or instruction is run on a computer, the computer is enabled to execute the Python-based HMI software automation testing method according to any one of claims 1 to 5.

9. An electronic device, characterized in that: comprising a processor coupled to a memory; The processor is used to read and execute the computer program stored in the memory to implement the Python-based HMI software automation testing method according to any one of claims 1 to 5.