CN115982043A - Vehicle interface testing method, device, equipment and storage medium - Google Patents

Vehicle interface testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115982043A
CN115982043A CN202310004844.2A CN202310004844A CN115982043A CN 115982043 A CN115982043 A CN 115982043A CN 202310004844 A CN202310004844 A CN 202310004844A CN 115982043 A CN115982043 A CN 115982043A
Authority
CN
China
Prior art keywords
test
test case
module
vehicle interface
tested
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
Application number
CN202310004844.2A
Other languages
Chinese (zh)
Inventor
李世莎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202310004844.2A priority Critical patent/CN115982043A/en
Publication of CN115982043A publication Critical patent/CN115982043A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application provides a vehicle interface test method, a device, equipment and a storage medium, wherein a vehicle interface to be tested is connected with a test tool, and a test code is compiled according to the vehicle interface to be tested, so that a test case is generated and the test case is executed; then packaging the test tool, and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool; and finally, writing back the test result of the test case and generating a test report. The method and the device can be used for integrally testing the data distribution service interface of the automobile body controller by integrating various existing discrete testing means and modes. Meanwhile, the specified protocol is transmitted to the lower computer for processing through the testing upper computer in a command mode, the data distribution service nodes are simulated for communication, and data distribution service messages are received and transmitted, so that the problem of slow development of the existing data distribution service interface testing technology can be solved.

Description

Vehicle interface testing method, device, equipment and storage medium
Technical Field
The application relates to the technical field of vehicle software testing, in particular to a vehicle interface testing method, device, equipment and storage medium.
Background
A VIU (Vehicle Identification Unit, VIU for short) is a type of controller that integrates a Vehicle body function, a Vehicle three-electric function, an air conditioning control function, and an electronic suspension function. The VIU controller provides service capability based on a service development concept, so that other domains can share the service capability. The system comprises power domain services, electronic suspension services, key services, antitheft services, skylight services, seat services, tire pressure services, inner lamp services, outer lamp services, air conditioner services, turn lamp services, access services, window services, wiper washing services, rearview mirror services, power management services and the like in application, wherein the services are deployed on VIUs at corresponding positions according to the principle of being nearby. Data Distribution Service (DDS) specifications are uniformly adopted among all VIU domain controllers to realize information interconnection, but research on software interface testing methods related to the DDS specifications is relatively slow, and an embarrassing situation that no testing tool is available is faced when software interface testing is carried out on the DDS.
Disclosure of Invention
In view of the above drawbacks of the prior art, the present application provides a vehicle interface testing method, apparatus, device and storage medium, so as to solve the technical problem of slow development of the existing DDS interface testing technology.
The application provides a vehicle interface testing arrangement, including: the test tool is respectively connected with the vehicle interface to be tested and the test upper computer; wherein, the test host computer including:
the test module is used for compiling a test code according to the vehicle interface to be tested after the vehicle interface to be tested is connected with the test tool, generating a test case and executing the test case;
the debugger control module is used for packaging the test tool and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool;
and the test report module is used for writing back the test result of the test case and generating a test report.
In an embodiment of the present application, the test module includes:
the compiling sub-module is used for compiling the test code according to the vehicle interface to be tested after the vehicle interface to be tested is connected with the test tool to generate a test case;
the test case template submodule is used for maintaining the test case;
the test script submodule is used for generating a test case script according to the test case so as to enable the test case to be normally executed;
the tested object management submodule is used for managing the test case;
the code pile insertion management submodule is used for inserting piles into the managed test cases;
and the test execution control sub-module is used for executing the instrumented test case, stopping or finishing execution in the execution process, and resuming execution after stopping or finishing execution.
In an embodiment of the application, the test upper computer further includes a communication module, and the communication module is used for performing communication control when the test case is generated and executed; wherein, the communication module includes: the operation control submodule, the display control submodule, the screening control submodule, the transceiving control submodule, the storage control submodule and the lead-in and lead-out control submodule;
the operation control sub-module comprises a plurality of interface operation buttons and is used for starting communication protocol message transmission, ending communication protocol message transmission and replaying communication protocol messages when the test case is generated and executed;
the display control submodule is used for switching display interfaces;
the screening control sub-module is used for screening communication protocol messages when generating and executing the test cases;
the receiving and sending control sub-module is used for setting the sending mode and the sending period of the communication protocol message;
the storage control submodule is used for storing the sent communication protocol message and the received communication protocol message;
the import and export control submodule is used for importing or exporting the sent communication protocol message and the received communication protocol message.
In an embodiment of the present application, the communication protocol packet transmitted in the communication module includes at least one of the following: a controller domain network message, a local area internet message, an ethernet message.
In an embodiment of the application, the test upper computer further comprises a configuration module and a log module; the configuration module and the log module are both connected with the debugger control module;
the configuration module is used for setting configuration files, configuring log grades and configuring log rotation;
and the log module is used for generating a full log according to the configuration file, the log level and the log rotation in the process of executing the test case.
In an embodiment of the present application, the vehicle interface under test includes at least one of: the system comprises a data distribution service interface of the new energy vehicle to be tested and a data distribution service interface of the fuel vehicle to be tested.
The application also provides a vehicle interface testing method, which comprises the following steps:
connecting a vehicle interface to be tested with a test tool, compiling a test code according to the vehicle interface to be tested, generating a test case and executing the test case;
packaging the test tool, and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool;
and writing back the test result of the test case and generating a test report.
In an embodiment of the present application, the writing back the test result of the test case and the generating of the test report includes:
acquiring a test case table which is imported in advance, and writing back an execution result and a failure reason of each step of each test case in the test case table to the corresponding test case;
and adding a table page in the test case table, summarizing the test results of all test cases, and inserting the summarized test results into the newly added table page to generate a test report.
The present application further provides a vehicle interface testing device, the device comprising:
one or more processors;
a storage device to store one or more programs that, when executed by the one or more processors, cause the apparatus to implement a vehicle interface testing method as in any one of the above.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform a vehicle interface testing method as in any one of the above.
As described above, the present application provides a vehicle interface testing method, apparatus, device and storage medium, which have the following beneficial effects:
according to the method and the device, a vehicle interface to be tested is connected with a test tool, and a test code is compiled according to the vehicle interface to be tested, so that a test case is generated and the test case is executed; then packaging the test tool, and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool; and finally, writing back the test result of the test case and generating a test report. Therefore, the DDS interface integrated test method and the DDS interface integrated test system can be used for integrally testing the DDS interface of the vehicle body controller by integrating various existing discrete test means and modes. Meanwhile, the specified protocol is transmitted to the lower computer for processing through the testing upper computer in a command mode, the DDS nodes are simulated for communication, and DDS messages are received and sent, so that the problem of slow development of the existing DDS interface testing technology can be solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a schematic diagram of an exemplary system architecture to which aspects of one or more embodiments of the present application may be applied;
fig. 2 is a schematic hardware structure diagram of a vehicle interface testing apparatus according to an embodiment of the present application;
fig. 3 is a schematic hardware structure diagram of a test module according to an embodiment of the present disclosure;
fig. 4 is a schematic hardware structure diagram of a test case template submodule provided in an embodiment of the present application;
fig. 5 is a schematic hardware structure diagram of a test script sub-module according to an embodiment of the present application;
fig. 6 is a schematic hardware structure diagram of a test execution control sub-module according to an embodiment of the present application;
fig. 7 is a schematic hardware structure diagram of a debugger control module according to an embodiment of the present application;
fig. 8 is a schematic hardware structure diagram of a communication module according to an embodiment of the present application;
fig. 9 is a schematic hardware structure diagram of a configuration module according to an embodiment of the present application;
fig. 10 is a schematic hardware structure diagram of a log module according to an embodiment of the present application;
FIG. 11 is a schematic flow chart illustrating a vehicle interface testing method according to an embodiment of the present application;
FIG. 12 is a diagram of a hardware configuration of a vehicle interface testing device suitable for implementing one or more embodiments of the present application.
Detailed Description
Other advantages and effects of the present application will become apparent to those skilled in the art from the disclosure herein, wherein the embodiments of the present application will be described in detail with reference to the accompanying drawings and preferred embodiments. The present application is capable of other and different embodiments and its several details are capable of modifications and/or changes in various respects, all without departing from the spirit of the present application. It should be understood that the preferred embodiments are for purposes of illustration only and are not intended to limit the scope of the present disclosure.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present application, and the drawings only show the components related to the present application and are not drawn according to the number, shape and size of the components in actual implementation, the type, quantity and proportion of each component in actual implementation may be changed freely, and the layout of the components may be more complicated.
"and/or" in the present application, describing an association relationship of associated objects, means that there may be three relationships, for example, a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The plural in the present application means two or more.
In the description of the present application, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance, nor order.
In addition, in the embodiments of the present application, the word "exemplary" is used to mean serving as an example, instance, or illustration. Any embodiment or implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or implementations. Rather, the term using examples is intended to present concepts in a concrete fashion.
In the following description, numerous details are set forth to provide a more thorough explanation of the embodiments of the present application, however, it will be apparent to one skilled in the art that the embodiments of the present application may be practiced without these specific details, and in other embodiments, well-known structures and devices are shown in block diagram form rather than in detail in order to avoid obscuring the embodiments of the present application.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which technical solutions in one or more embodiments of the present application may be applied. As shown in fig. 1, system architecture 100 may include terminal device 110, network 120, and server 130. The terminal device 110 may include various electronic devices such as a smart phone, a tablet computer, a notebook computer, and a desktop computer. The server 130 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services. Network 120 may be any type of communications medium capable of providing a communications link between terminal device 110 and server 130, such as a wired communications link or a wireless communications link.
The system architecture in the embodiments of the present application may have any number of terminal devices, networks, and servers, according to implementation needs. For example, the server 130 may be a server group composed of a plurality of server devices. In addition, the technical solution provided in the embodiment of the present application may be applied to the terminal device 110, or may be applied to the server 130, or may be implemented by both the terminal device 110 and the server 130, which is not particularly limited in this application.
In an embodiment of the present application, the terminal device 110 or the server 130 of the present application may generate a test case and execute the test case by connecting the vehicle interface to be tested with the test tool and compiling the test code according to the vehicle interface to be tested; then packaging the test tool, and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool; and finally, writing back the test result of the test case and generating a test report. By using the terminal device 110 or the server 130 to execute the vehicle interface testing method, the DDS interface of the vehicle body controller can be integrally tested by integrating various existing discrete testing means and manners. Meanwhile, the specified protocol is transmitted to the lower computer for processing through the testing upper computer in a command mode, the DDS nodes are simulated for communication, and DDS messages are received and sent, so that the problem of slow development of the existing DDS interface testing technology can be solved.
The above section describes the content of an exemplary system architecture to which the technical solution of the present application is applied, and the following continues to describe the vehicle interface testing apparatus of the present application.
Fig. 2 shows a schematic hardware structure diagram of a vehicle interface testing device according to an embodiment of the present application. Specifically, in an exemplary embodiment, as shown in fig. 2, the present embodiment provides a vehicle interface testing apparatus, which includes: the test tool is connected with the vehicle interface to be tested and the test upper computer respectively. By way of example, the vehicle interface under test in the present embodiment includes but is not limited to: the system comprises a data distribution service interface of the new energy vehicle to be tested and a data distribution service interface of the fuel vehicle to be tested. Wherein, the test host computer including: the device comprises a test module, a debugger control module and a test report module.
The test module is used for compiling a test code according to the vehicle interface to be tested after the vehicle interface to be tested is connected with the test tool, generating a test case and executing the test case. As an example, the test module in this embodiment is mainly responsible for important core test work items such as maintenance of test cases, test code compilation, test case execution, and the like. The system mainly comprises sub-modules of a test case template, a test script, a tested object management, a code instrumentation management, a compiling, a test execution control and the like. Specifically, in this embodiment, the test module includes: the system comprises a compiling sub-module, a test case template sub-module, a test script sub-module, a tested object management sub-module, a code instrumentation management sub-module, a test execution control sub-module, a debugger control module and a test report module. The compiling submodule is used for compiling the test code according to the vehicle interface to be tested after the vehicle interface to be tested is connected with the test tool, and generating the test case. And the test case template submodule is used for maintaining the test case. The test script submodule is used for generating a test case script according to the test case so as to enable the test case to be normally executed. And the tested object management submodule is used for managing the test case. And the code instrumentation management submodule is used for performing instrumentation on the managed test cases. The test execution control submodule is used for executing the instrumented test case, stopping or finishing execution in the execution process, and resuming execution after stopping or finishing execution. The specific description of each submodule is as follows: and the test case template submodule is used for maintaining the test case. The test script submodule is responsible for maintaining the test script. Test scripts fall into two categories: one type is a test case script automatically generated according to a test case template; the other is a handwritten test script. And the test case can be used for automatically generating a test script for the background calling of the upper computer so as to finish the normal execution of the test case. The tested object management submodule is responsible for managing the tested object, namely managing the tested source code, the ARXML and the list of the interface to be tested. The code instrumentation management submodule is responsible for performing instrumentation operation on the object to be tested, namely performing instrumentation operation on the source code to be tested and the like. The compiling submodule is responsible for compiling and constructing the tested source code, provides a testing tool Trace32 to call the Lattach Debug to Debug the code, effectively and reliably positions the compiling problem, solves the problem of compiling error and calls the code. The test execution control submodule is responsible for carrying out automatic execution operation management on the test case. The test execution can be paused and resumed midway on the graphical interactive interface, and the current test execution can also be stopped (ended). In this embodiment, ARXML is a general configuration/database file that plays a key role in data transmission and storage.
The debugger control module is used for packaging the test tool and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool. As an example, in this embodiment, the debugger control module may be configured to encapsulate an API (Application Program Interface, API for short) related to the Trace32 testing tool, and support the call of the test case operation module. The debugger control module can perform single-step debugging and result checking in the test case execution process, and is convenient for testers to perform gradual analysis and quickly locate problems.
And the test report module is used for writing back the test result of the test case and generating a test report. As an example, in this embodiment, the test report module includes two parts, namely, performing a write-back operation on a test result in a test case and generating a test summary report, and the specific content relates to the following: backfilling test results: and importing the test cases excel on a test upper computer, automatically executing the test cases, and backfilling the execution result and failure reason of each step of each test case to the corresponding test case step line after the test cases are executed. Generating a summary test report: and summarizing the final execution results of all test cases, inserting a new sheet page into the excel, and summarizing to form a test report.
Therefore, the DDS interface of the vehicle body controller can be integrally tested by integrating various existing discrete testing means and modes. Meanwhile, the embodiment transmits the specified protocol to the lower computer for processing by a command through the testing upper computer, simulates the DDS node for communication, and receives and transmits DDS messages, thereby overcoming the problem of slow development of the existing DDS interface testing technology.
In an exemplary embodiment, the test upper computer further comprises a communication module, and the communication module is used for performing communication control when the test case is generated and executed; wherein, the communication module includes: the system comprises an operation control submodule, a display control submodule, a screening control submodule, a transceiving control submodule, a storage control submodule and an import and export control submodule. The operation control sub-module comprises a plurality of interface operation buttons and is used for starting communication protocol message transmission, ending the communication protocol message transmission and playing back the communication protocol message when the test case is generated and executed. And the display control submodule is used for switching display interfaces. The screening control submodule is used for screening the communication protocol message when generating and executing the test case. The receiving and sending control sub-module is used for setting the sending mode and the sending period of the communication protocol message. The storage control sub-module is used for storing the sent communication protocol message and the received communication protocol message. The import and export control submodule is used for importing or exporting the sent communication protocol message and the received communication protocol message. In this embodiment, the communication protocol packet transmitted in the communication module includes at least one of the following: a controller domain network message, a local area internet message, an ethernet message.
Specifically, in this embodiment, the communication module is a module for performing communication management and communication control, and includes operation control, display control, filtering control, transceiving control, storage control, and import/export control on CAN (Controller Area Network, CAN for short), LIN (Local Interconnect Network, LIN for short) and ETH (Ethernet, ETH for short) messages. The following is a brief explanation of the various control functions: the operation control sub-module comprises interface operation buttons of Start, stop and Replay and is used for starting, ending and replaying each communication protocol to transmit messages. The display control sub-module is used for carrying out the scale switching operation on the interface; the screening control submodule is responsible for message screening operation of various protocols; the receiving and sending control submodule is used for setting a message sending mode and sending cycle frequency; the storage control submodule is used for storing the sent and received messages; and the import and export control submodule is used for importing or exporting the received and sent historical messages.
In an exemplary embodiment, the test upper computer further comprises a configuration module and a log module; the configuration module and the log module are both connected with the debugger control module. The configuration module is used for setting configuration files, configuring log grades and configuring log rotation. And the log module is used for generating a full log according to the configuration file, the log level and the log rotation in the process of executing the test case.
Specifically, in this embodiment, the configuration module may be a general-purpose module that performs a configuration file operation. The module support functions are as follows: the method comprises the following steps of supporting configuration reading, supporting configuration setting, supporting configuration file name customization, supporting configuration file path customization, supporting configuration file division functional areas, supporting log level configuration and supporting log rotation configuration. The logging module may be a general purpose module that performs log file operations, providing APIs for different levels of logging. The log module also provides configurable options, provides a default saving path and a default file name format, and a user can reset the default saving path and the default file name format according to actual conditions.
In another exemplary embodiment of the present application, the embodiment further provides a vehicle interface testing apparatus, including: testing an upper computer and a testing tool Trace32; the test tool Trace32 is respectively connected with the vehicle interface to be tested and the test upper computer. Wherein, the test host computer mainly contains following module: the device comprises a test module, a debugger control module, a communication module, a configuration module, a log module and a test report module. The test upper computer supports two use modes: the system comprises a man-machine interaction interface mode and a command line operation mode, and a user can select one from lines to call according to the use requirement. Various interfaces of Trace32 are called through the python API of Trace32 for the purpose of indirectly controlling Lattach. The Latotebah is connected to the computer terminal through a Universal Serial Bus (USB), and is connected to the board terminal to be tested through a flat cable. The vehicle interface to be tested is a DDS service interface of the VIU domain controller.
Fig. 3 is a schematic diagram of a hardware structure of a test module, and the test module is mainly responsible for important core test workitems such as maintenance of test cases, test code compilation, test case execution and the like, and is a core of the whole upper computer. The system mainly comprises a test case template, a test script, a tested object management module, a code instrumentation management module, a compiling module and a test execution control sub-module.
FIG. 4 is a schematic diagram of a hardware structure of a test case template submodule, where the test case template submodule is used for maintaining a test case. The following is a detailed description of the test case sub-template: the test case is maintained by adopting an excel template and is generated by an automatic tool: (1) Analyzing the arxml format file into excel format data through a python program, wherein a data column comprises a complete function name, an interface function type, an interface function data type, a function position and an upstream or downstream transmission position; the list field fills in the description: <1> type of interface function: write/read/call, etc.; <2> data type of interface function: all enumerations need to be listed; <3> where the function is located: including the located. C file and the located Runable. (2) And analyzing the interface list in the excel through a python program, generating an interface automation test case and storing the interface automation test case in the excel.
Fig. 5 is a schematic diagram of a hardware structure of a test script sub-module, and the test script sub-module is responsible for maintaining a test script. Test scripts fall into two categories: one type is a test case script automatically generated according to a test case template; the other is a handwritten test script. And the test case can be used for automatically generating a test script for the background calling of the upper computer so as to finish the normal execution of the test case. The specific process of generating the test script by the test case is as follows: and opening the excel file of the test case through the upper computer for reading, wherein the read content is used for interface display on one hand and splicing the test case on the other hand. A Function Map page in Excel records relevant API and parameter information of a debugger, and supports a user to carry out secondary packaging on the API and combine a plurality of basic APIs for use. And after reading, the test script submodule records in a memory according to a specified data structure, and then selects a debugger related API required to be executed in the program through the association of the contents of the test case page and the test script page in the excel. And executing the test and recording the result while analyzing the test cases line by line, and finally writing the test result back to the corresponding cell in the test case file by the module.
The tested object management submodule is responsible for managing the tested object, namely the tested source code, the ARXML and the list of the interface to be tested. Due to different test items, the source code to be tested may be a source code or an instrumentation source code that needs to be instrumented. And the test upper computer imports the tested object and displays the tested object in a system interface in a tree diagram structure. The source code, ARXML and the list display of the interface to be tested can look up the data of each file in a directory structure mode.
And the code instrumentation management submodule is responsible for performing instrumentation operation on the tested object, namely the tested source code. The instrumentation mode is divided into two types, the first instrumentation needs to insert test codes into source codes and then compile and debug the test codes, and the module supports self-instrumentation test codes to the source codes; the second type of pile insertion is that the upper computer is tested and data is observed in a debugger injection mode. And selecting different pile inserting modes according to the test requirements.
The compiling submodule is responsible for compiling and constructing the tested source code, calling the Lattich Debug to Debug the code through the TRACE32, effectively and reliably positioning the compiling problem, solving the problem of compiling error and debugging the code.
Fig. 6 is a schematic diagram of a hardware structure of a test execution control sub-module, where the test execution control sub-module is responsible for performing automated execution operation management on a test case. The test execution can be paused and resumed midway on the graphical interactive interface, and the current test execution can also be stopped (ended). The control operation button includes: A. starting; B. pause | continue; C. and (5) stopping. From the beginning to the end of normal execution, the popup prompts execution is finished, and a test result and a test report address are given to facilitate subsequent checking. Pausing and stopping both operations mid-way does not produce a final test report.
Fig. 7 is a schematic diagram of a hardware structure of a debugger control module, where the debugger control module is used for encapsulating Trace32 related APIs and supporting the invocation of the test case operation module. The module encapsulates all Trace32 APIs required by the integration test, when the test case operation module analyzes the execution case line by line, the API associated with the Function Map in the test case step can be identified, and the indirect calling of the Trace32 APIs in the upper computer program is realized through the matching of the module. The debugger control module can perform single-step debugging and result checking in the test case execution process, and is convenient for testers to perform gradual analysis and quickly locate problems.
Fig. 8 is a schematic diagram of a hardware configuration of a communication module, which performs communication management and communication control. The method comprises operation control, display control, screening control, transceiving control, storage control and import and export control of CAN, LIN and ETH messages.
The operation control sub-module comprises interface operation buttons of Start, stop and Replay and is used for starting, ending and replaying each communication protocol to carry out message transmission.
Display control submodule for and carrying out scale switching operation on the interface. The binary display is presented in terms of display and transmission, and the list of switching combinations is shown in table 1 below.
TABLE 1 shows a list of switching combinations of control submodules
Serial number Display device Sending
1 HEX HEX
2 HEX Character string
3 Character string HEX
4 Character string Character string
The screening control sub-module is responsible for message screening operation of various protocols. The message screening options differ slightly according to the various protocols. The message screening items of the screening control submodule are shown in the following table 2.
Table 2 message screening items of screening control submodules
Figure BDA0004035914060000121
The receiving and sending control submodule is used for setting a message sending mode and sending cycle frequency. The message sending mode is divided into manual sending and automatic sending. The automatic transmission is a timing transmission, and the timing transmission frequency, content, and the like need to be set, and the message setting of the transmission and reception control sub-module is shown in table 3 below.
TABLE 3 message setup for Transmit-receive control submodule
Figure BDA0004035914060000122
Figure BDA0004035914060000131
The storage control sub-module is used for storing the local storage of the sending and receiving messages. And the import and export control submodule is used for importing or exporting the receiving and sending history message.
Fig. 9 is a schematic diagram of a hardware structure of a configuration module, which is a general module for performing configuration file operations. The module support functions are as follows: 1. supporting configuration reading; 2. supporting configuration settings; 3. supporting the self-definition of the configuration file name; 4. supporting the path customization of the configuration file; 5. supporting the configuration file to divide a functional area; 6. supporting log level configuration; 7. log rotation configuration is supported. Configuration read instruction: the test upper computer in the embodiment supports data reading of each configuration item, and specifically, the upper computer background provides an API (application programming interface) for reading each parameter, and the API is provided for front-end calling. Description of configuration settings: the test upper computer in the embodiment supports various configurations and can be manually set, and the system is more flexible and extensible so as to meet the test requirements of different test items. Self-defined description of the name of the configuration file: the test upper computer in the embodiment supports custom operation on saved log file names, and is convenient for testers to use and manage logs. Self-defining description of a configuration file path: the test upper computer in the embodiment supports the user-defined operation of various configuration file paths, and a tester can conveniently maintain the configuration files. Description of the configuration file division functional area: the test upper computer in the embodiment supports the division of the configuration file into functional areas, namely, different functions set respective configuration parameter attributes, so that the service independence of the configuration file is achieved, and the standardization and the manageability are better achieved. Wherein, the configuration file content comprises: (1) a measured object; (2) test cases; (3) testing scripts; (4) code fragments; (5) pile inserting; (6) compiling; (7) testing control; (8) test reports; and (9) logging. Description of log level configuration: the test upper computer in the embodiment supports log level configuration operation. The journal level provides ALL, DEBUG, INFO, WARN, ERROR 5 level settings. The priority levels are ALL, DEBUG, INFO, WARN and ERROR from low to high. The lower the level, the more detailed the output log information, the higher or equal the level set, the less logs will be printed by the program. Specifically, the log levels in the present embodiment are shown in table 4 below.
Table 4 journal grade table
Figure BDA0004035914060000132
Figure BDA0004035914060000141
The log level is described as follows: ALL: all logs are recorded. DEBUG: print event run information, which is most useful to debug applications. Printing some events where data violates constraints and calling less sophisticated APIs (even if the call returns a success), the DEBUG level log should be less used in the production environment, leaving only a meaningful portion. 3, INFO: a message that the printing program starts or exits; deleting and updating DML type operations, paying attention to the operation of query type, not suggesting log recording, and needing auditing information. 4, WARN: indicating a potential ERROR condition, the time recorded at this level may become an ERROR. ERROR: and printing abnormal logs, such as network failure, database connection failure, or return errors of relatively mature API call results, and the like.
Log rotation configuration description: the test upper computer in the embodiment configures log rotation according to time and log size. The default configuration would rotate the log at 24 points per day and when the file size exceeds 10 MB. Ten log files are reserved under the default condition, and the number of history reserved files can be adjusted according to the actual condition of the project.
Fig. 10 is a schematic diagram of a hardware structure of a log module, which is a general-purpose module for performing log file operations and provides APIs for different levels of logging. The log module also provides configurable options, a default saving path and a default file name format, and a user can reset the default saving path and the default file name format according to actual conditions. Specifically, the full log needs to contain detailed log information and error information of various operations such as configuration, debugging, test execution, communication, and the like. The various log records are illustrated below: the configuration log needs to contain various configuration item operation records; the debugging log needs to contain debug record log during code debugging; the test execution log needs to contain the content, steps, test results and error information of each test case execution; the communication log needs to contain the record information for message transmission and reception through the communication protocols Ethernet, CAN, LIN. The test report module comprises two parts of write-back operation of test results in the test case excel and generation of a test summary report, and the specific content relates to the following: backfilling test results: and importing the test cases excel into the system on the test upper computer, automatically executing the test cases, and backfilling the execution result and failure reason of each step of each test case to the corresponding test case step line after the test cases are executed. Generating a summary test report: and summarizing the final execution results of all the test cases, and inserting a new sheet page into the excel to form a summarized test report.
In summary, the present application provides a vehicle interface testing apparatus, which includes a testing tool and a testing upper computer, wherein the testing tool is respectively connected to a vehicle interface to be tested and the testing upper computer; wherein, the test host computer including: the test module is used for compiling a test code according to the vehicle interface to be tested after the vehicle interface to be tested is connected with the test tool, generating a test case and executing the test case; the debugger control module is used for packaging the test tool and performing single-step debugging and test result checking in the process of executing the test case by using the packaged test tool; and the test report module is used for writing back the test result of the test case and generating a test report. Therefore, the device can integrate the DDS interface of the vehicle body controller by integrating various existing discrete testing means and modes. Meanwhile, the device transmits the specified protocol to the lower computer for processing by commands through the test upper computer, simulates DDS nodes for communication, and receives and transmits DDS messages, thereby overcoming the problem of slow development of the existing DDS interface test technology.
Fig. 11 shows a schematic flowchart of a vehicle interface testing method provided in an embodiment of the present application. Specifically, in an exemplary embodiment, as shown in fig. 11, the present embodiment provides a vehicle interface testing method, including the steps of:
s1110, connecting the vehicle interface to be tested with a test tool, compiling a test code according to the vehicle interface to be tested, generating a test case and executing the test case; by way of example, the vehicle interface under test in the present embodiment includes but is not limited to: the system comprises a data distribution service interface of the new energy vehicle to be tested and a data distribution service interface of the fuel vehicle to be tested. Specifically, step S1110 in this embodiment may be completed by the test module in some embodiments described above.
S1120, packaging the test tool, and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool. Specifically, step S1120 in this embodiment may be completed by the debugger control module in some embodiments described above.
S1130, the test result of the test case is written back, and a test report is generated. Specifically, step S1130 in this embodiment may be completed by the test report module in some embodiments described above. As an example, the process of writing back the test result of the test case and generating the test report in this embodiment includes: acquiring a test case table which is imported in advance, and writing back an execution result and a failure reason of each step of each test case in the test case table to the corresponding test case; and adding a table page in the test case table, summarizing the test results of all test cases, and inserting the summarized test results into the newly added table page to generate a test report.
It should be noted that the vehicle interface testing method provided in this embodiment and the vehicle interface testing apparatus provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module in the vehicle interface testing apparatus performs operation has been described in detail in the foregoing embodiment, so the vehicle interface testing method is not described in detail in this embodiment. In practical applications, the vehicle interface testing apparatus provided in the foregoing embodiment may distribute the functions through different functional modules as needed, that is, divide the internal structure of the apparatus into different functional modules to complete all or part of the functions described in the vehicle interface testing method, which is not limited herein.
In summary, the present application provides a vehicle interface testing method, which includes connecting a vehicle interface to be tested with a testing tool, and compiling a test code according to the vehicle interface to be tested to generate a test case and execute the test case; then packaging the test tool, and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool; and finally, writing back the test result of the test case and generating a test report. Therefore, the DDS interface of the vehicle body controller can be integrally tested by integrating various existing discrete testing means and modes. Meanwhile, the method transmits the specified protocol to the lower computer for processing by a command through the test upper computer, simulates DDS nodes for communication, and receives and transmits DDS messages, thereby overcoming the problem of slow development of the existing DDS interface test technology.
Embodiments of the present application further provide a vehicle interface testing device, including: one or more processors; a storage device for storing one or more programs that, when executed by the one or more processors, cause the vehicle interface testing apparatus to implement the vehicle interface testing method provided in the various embodiments described above.
FIG. 12 shows a schematic block diagram of a computer device suitable for implementing the vehicle interface testing apparatus of the embodiments of the present application. It should be noted that the computer system 1000 of the vehicle interface testing apparatus shown in fig. 12 is only an example, and should not bring any limitation to the function and the use range of the embodiment of the present application.
As shown in fig. 12, the computer system 1000 includes a Central Processing Unit (CPU) 1001 that can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1002 or a program loaded from a storage portion 1008 into a Random Access Memory (RAM) 1003. In the RAM1003, various programs and data necessary for system operation are also stored. The CPU 1001, ROM 1002, and RAM1003 are connected to each other by a bus 1004. An Input/Output (I/O) interface 1005 is also connected to the bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output section 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 1008 including a hard disk and the like; and a communication section 1009 including a Network interface card such as a Local Area Network (LAN) card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The driver 1010 is also connected to the I/O interface 1005 as necessary. A removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1010 as necessary, so that a computer program read out therefrom is mounted into the storage section 1008 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication part 1009 and/or installed from the removable medium 1011. When the computer program is executed by a Central Processing Unit (CPU) 1001, various functions defined in the apparatus of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may comprise a propagated data signal with a computer-readable computer program embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Yet another aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the vehicle interface testing method as described above. The computer readable storage medium may be included in the vehicle interface testing apparatus described in the above embodiments, or may be separately present without being assembled into the vehicle interface testing apparatus.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read by a processor of the computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to execute the vehicle interface testing method provided in the above embodiments.
The above-described embodiments are merely illustrative of the principles and utilities of the present application and are not intended to limit the application. Any person skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present application. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical concepts disclosed in the present application shall be covered by the claims of the present application.

Claims (10)

1.A vehicle interface testing device, comprising: the test tool is respectively connected with the vehicle interface to be tested and the test upper computer; wherein, the test host computer including:
the test module is used for compiling a test code according to the vehicle interface to be tested after the vehicle interface to be tested is connected with the test tool, generating a test case and executing the test case;
the debugger control module is used for packaging the test tool and performing single-step debugging and test result checking in the process of executing the test case by using the packaged test tool;
and the test report module is used for writing back the test result of the test case and generating a test report.
2. The vehicle interface testing device of claim 1, wherein said testing module comprises:
the compiling submodule is used for compiling the test code according to the vehicle interface to be tested after the vehicle interface to be tested is connected with the test tool, and generating a test case;
the test case template submodule is used for maintaining the test case;
the test script submodule is used for generating a test case script according to the test case so as to enable the test case to be normally executed;
the tested object management submodule is used for managing the test case;
the code instrumentation management submodule is used for performing instrumentation on the managed test cases;
and the test execution control sub-module is used for executing the instrumented test case, stopping or finishing execution in the execution process, and resuming execution after stopping or finishing execution.
3. The vehicle interface testing device according to claim 1, wherein the testing host computer further comprises a communication module, and the communication module is used for performing communication control when the test case is generated and executed; wherein, the communication module includes: the operation control submodule, the display control submodule, the screening control submodule, the transceiving control submodule, the storage control submodule and the lead-in and lead-out control submodule;
the operation control sub-module comprises a plurality of interface operation buttons and is used for starting communication protocol message transmission, ending the communication protocol message transmission and playing back the communication protocol message when the test case is generated and executed;
the display control submodule is used for switching display interfaces;
the screening control submodule is used for screening a communication protocol message when generating and executing the test case;
the receiving and sending control sub-module is used for setting the sending mode and the sending period of the communication protocol message;
the storage control submodule is used for storing the sent communication protocol message and the received communication protocol message;
the import and export control submodule is used for importing or exporting the sent communication protocol message and the received communication protocol message.
4. The vehicle interface testing arrangement of claim 3, wherein the communication protocol messages transmitted in the communication module include at least one of: a controller domain network message, a local area internet message, an ethernet message.
5. The vehicle interface testing device of claim 1, wherein the testing host computer further comprises a configuration module and a log module; the configuration module and the log module are both connected with the debugger control module;
the configuration module is used for setting configuration files, configuring log grades and configuring log rotation;
and the log module is used for generating a full log according to the configuration file, the log level and the log rotation in the process of executing the test case.
6. The vehicle interface testing device of claim 1, wherein the vehicle interface under test comprises at least one of: the system comprises a data distribution service interface of the new energy vehicle to be tested and a data distribution service interface of the fuel vehicle to be tested.
7. A vehicle interface testing method, characterized in that the method comprises the steps of:
connecting a vehicle interface to be tested with a test tool, compiling a test code according to the vehicle interface to be tested, generating a test case and executing the test case;
packaging the test tool, and performing single step debugging and test result checking in the process of executing the test case by using the packaged test tool;
and writing back the test result of the test case and generating a test report.
8. The vehicle interface testing method according to claim 7, wherein the writing back of the test result of the test case and the generating of the test report comprises:
acquiring a test case table which is imported in advance, and writing back an execution result and a failure reason of each step of each test case in the test case table to the corresponding test case;
and adding a table page in the test case table, summarizing the test results of all test cases, and inserting the summarized test results into the newly added table page to generate a test report.
9. A vehicle interface testing apparatus, characterized in that the apparatus comprises:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the apparatus to carry out the vehicle interface testing method of claim 7 or 8.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to carry out the vehicle interface testing method according to claim 7 or 8.
CN202310004844.2A 2023-01-03 2023-01-03 Vehicle interface testing method, device, equipment and storage medium Pending CN115982043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310004844.2A CN115982043A (en) 2023-01-03 2023-01-03 Vehicle interface testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310004844.2A CN115982043A (en) 2023-01-03 2023-01-03 Vehicle interface testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115982043A true CN115982043A (en) 2023-04-18

Family

ID=85959354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310004844.2A Pending CN115982043A (en) 2023-01-03 2023-01-03 Vehicle interface testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115982043A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116185880A (en) * 2023-04-27 2023-05-30 北京翼辉信息技术有限公司 Automatic test method, device, equipment and medium for embedded system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116185880A (en) * 2023-04-27 2023-05-30 北京翼辉信息技术有限公司 Automatic test method, device, equipment and medium for embedded system

Similar Documents

Publication Publication Date Title
CN109039824B (en) Automatic test system and method for wireless remote communication protocol of vehicle-mounted terminal
CN106940428B (en) Chip verification method, device and system
CN101241467B (en) Automatized white box test system and method facing to WEB application
CN109302522A (en) Test method, device and computer system and medium
CN104932480A (en) Automobile diagnostic system design method and apparatus
CN110362490B (en) Automatic testing method and system for integrating iOS and Android mobile applications
CN111399828B (en) Model-driven logic device modeling method and terminal
CN107370637B (en) Vehicle-mounted ECU communication function automatic test system and method
CN109933521A (en) Automated testing method, device, computer equipment and storage medium based on BDD
CN105786695A (en) Data test method and system
CN111428431A (en) Method and system for supporting automatic test and recording of EDA (electronic design automation) software
CN112306861A (en) Unittest and Jenkins tool-based interface automatic testing system and method
CN109932588B (en) Avionics equipment verification test engine
CN115982043A (en) Vehicle interface testing method, device, equipment and storage medium
CN112631919A (en) Comparison test method and device, computer equipment and storage medium
CN114385480A (en) Hardware-in-loop test system for automatic verification of FOTA function of vehicle
CN105404574A (en) Method and apparatus for testing consistency of smart card and mobile terminal
CN112860559B (en) Upgrade test system and method
CN114328250A (en) Automatic self-checking method, medium and device for software system
CN111427582A (en) Management method, device and equipment of RT L code and computer readable storage medium
CN115114147A (en) Test system based on structured description language
CN113127099B (en) Server configuration method, device, equipment and storage medium
CN114385493A (en) Performance test method and device, electronic equipment and storage medium
CN104678292A (en) Test method and device for CPLD (Complex Programmable Logic Device)
CN113535575A (en) Benchmark testing method and device for basic environment of software and hardware product

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