Interface automatic testing method and device for vehicle control unit

A vehicle controller and interface technology, applied in the field of testing, can solve problems such as time-consuming, and achieve the effect of improving quality and shortening test cycles

Active Publication Date: 2017-03-08
BEIJING ELECTRIC VEHICLE
3 Cites 15 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0004] The embodiment of the present invention provides an automatic testing method and device for the interface of the vehicle controller, which sol...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Method used

Embodiment four of the present invention, by obtaining database container file and generating test case and test output file, set up the corresponding matching relation of the software interface definition file and database container file of acquisition, according to test case, test output file and corresponding matching relation Build a test platform, use the test platform to run the program to be tested associated with the interface to be tested in the project project to be tested for a reference input information, and generate test results for the program to be tested, which can be optimized on the basis of the traditional interface test platform. The manual link is optimized to be automatically generated, and the test environment is automatically built to shorten the test cycle, while ensuring the accuracy of CAN message analysis and packaging, and improving the quality of the vehicle controller software.
Embodiment one of the present invention, by obtaining database container file and generating test case and test output file, set up the corresponding matching relation of the software interface definition file and database container file of acquisition, according to test case, test output file and corresponding matching relation Build a test platform, use the test platform to run the program to be tested associated with the interface to be tested in the project project to be tested for a reference input information, and generate test results for the program to be tested, which can be optimized on the basis of the traditional interface test platform. The manual link is optimized to be automatically generated, and the test environment is automatically built to shorten the test cycle, while ensuring the accuracy of CAN message analysis and packaging, and improving the quality of the vehicle controller software....
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Abstract

The invention provides an interface automatic testing method and device for a vehicle control unit. The method comprises the following steps of acquiring a database container file, and generating a test case and a test output file according to the database container file; acquiring a software interface define file, and establishing a corresponding matching relation between the software interface define file and the database container file; and acquiring a program to be tested associated with an interface to be tested in a project to be tested, building a test platform according to the test case, the test output file and the corresponding matching relation, for reference input information, using the test platform to run the program to be tested, and generating a test result for the program to be tested. The embodiment of the invention is optimized based on a traditional interface test platform, a manual link is optimized into automatic generation, a test environment is automatically built, thereby shortening the test period and ensuring the accuracy of CAN (Controller Area Network) message parsing and packing, and improving the quality of vehicle control unit software.

Application Domain

Technology Topic

Test platformEngine control unit +6

Image

  • Interface automatic testing method and device for vehicle control unit
  • Interface automatic testing method and device for vehicle control unit
  • Interface automatic testing method and device for vehicle control unit

Examples

  • Experimental program(4)

Example Embodiment

[0076] Example 1
[0077] like figure 2 As shown, the interface automatic testing method of the vehicle controller provided by the first embodiment of the present invention includes:
[0078] Step 201: Obtain a database container file, and generate a test case and a test output file according to the database container file.
[0079] The invention is based on WinForm, after acquiring the database container file, the CAN message parsing algorithm is used to generate the test case, and the test output file is generated according to the database container file. Before generating the test case, it is necessary to process the database container file to generate the CAN message attribute configuration table. The CAN message attribute configuration table mainly includes the ID, signal length, termination bit, variable precision, and offset of the CAN message. , the maximum and minimum values ​​in the physical sense, the situation of sending and receiving, and the number of messages contained in the CAN ID. The test cases include: N physical values ​​of each variable contained in the CAN message of the database container file within the value range; and a binary array in which all variables are combined for the binary values ​​corresponding to the N physical values.
[0080] After the database container file is processed to generate the CAN message attribute configuration table, based on the CAN message attribute configuration table, the CAN message parsing algorithm is used to generate the test case. The database container file is obtained by importing it.
[0081] After the test case and the test output file are generated, step 202 is performed.
[0082] Step 202: Obtain a software interface definition file, and establish a corresponding matching relationship between the software interface definition file and the database container file.
[0083] After generating the test case and test output file, obtain the software interface definition file. It should be noted that the content stored in the software interface definition file is the same as the content stored in the database container file, but the names are different. It is necessary to establish a software interface definition file and database. The corresponding matching relationship of the container file, so that the database container file can be combined with the object-oriented programming language to realize the interaction with the user through WinForm.
[0084] Step 203: Obtain the program to be tested associated with the interface to be tested in the project to be tested, build a test platform according to the test case, the test output file and the corresponding matching relationship, use the test platform to run the program to be tested against a reference input information, and generate test program results.
[0085] After obtaining the test case, the test output file and the corresponding matching relationship between the software interface definition file and the database container file, a test platform is built according to the test case, the test output file and the corresponding matching relationship. After acquiring the program to be tested associated with the interface to be tested in the project to be tested, the program to be tested is run on the test platform with respect to a reference input information, and a test result for the program to be tested is generated. The reference input information here can be a binary array or N physical values ​​of a variable. When the reference input information is a binary array, it is determined that a write operation is currently required, and when the reference input information is N physical values ​​of a variable, it is determined that a read operation is currently required.
[0086] Among them, the database container file, the software interface definition file and the project to be tested are all obtained by importing, receiving the name of the interface to be tested input by the user, and then obtaining the project to be tested associated with the interface to be tested in the project to be tested. program.
[0087] In the first embodiment of the present invention, by acquiring a database container file and generating a test case and a test output file, a corresponding matching relationship between the acquired software interface definition file and the database container file is established, and a test platform is built according to the test case, the test output file and the corresponding matching relationship , according to a reference input information, use the test platform to run the program to be tested associated with the interface to be tested in the project to be tested, and generate test results for the program to be tested, which can be optimized on the basis of the traditional interface test platform, and the manual link is optimized. In order to automatically generate and automatically build a test environment, shorten the test cycle, ensure the accuracy of CAN message analysis and packaging, and improve the quality of the vehicle controller software.

Example Embodiment

[0088] Embodiment 2
[0089] like image 3 As shown, the interface automatic testing method of the vehicle controller provided by the second embodiment of the present invention includes:
[0090] Step 301: Obtain a database container file.
[0091] Step 302: Compile and convert the database container file to generate a CAN message attribute configuration table, and generate a test output file and a test case according to the CAN message attribute configuration table.
[0092] Compile and convert the database container file to generate a CAN message attribute configuration table, wherein the CAN message attribute configuration table includes: N physical values ​​of each variable, variable precision, offset, termination bit and signal length, where each variable is The number is M. Then generate the test output file according to the CAN message attribute configuration table.
[0093] Obtain N physical values ​​of all variables included in the CAN message in the CAN message attribute configuration table within the value range as test cases, and the test cases at this time are in the form of variable physical values. The N physical values ​​here may be the maximum physical value, the intermediate physical value and the minimum physical value of each variable within the value interval.
[0094] Among them, the test case also includes the form of binary array. When generating the test case in the form of binary array, the specific process is as follows:
[0095] For each variable, calculate the ratio of the N physical values ​​to the corresponding variable precision to obtain N first reference values; for each variable, calculate the binary value corresponding to the difference between the N first reference values ​​and the corresponding offset ; For each variable, the obtained N binary values ​​are shifted to the right by the corresponding preset length respectively to obtain N second reference values; combinations between reference values ​​to get N M binary combinations, according to N M binary combinations generate 8 rows of N M Binary arrays in column form as test cases.
[0096]Specifically, for each variable in the CAN message attribute configuration table, it is necessary to calculate the ratio of N physical values ​​of the current variable to the corresponding variable precision to obtain N first reference values. Among them, for the same variable, the variable precision is a certain value. The N physical values ​​here are obtained within the value interval, and are preferably the maximum physical value, the minimum physical value and the middle physical value of the current variable within the value interval. For the maximum physical value, minimum physical value and intermediate physical value of the current variable, calculate the ratio of the maximum physical value to the variable precision, the ratio of the minimum physical value to the variable precision, and the ratio of the intermediate physical value to the variable precision, and get three first Reference.
[0097] For the same variable, the offset is a definite physical value. For the three first reference values ​​of the current variable, the difference between each reference value and the corresponding offset is calculated respectively, and the corresponding binary value is taken for the obtained difference to obtain three binary values.
[0098] After acquiring the binary value, for each variable, the three binary values ​​of the current variable are respectively shifted to the right by a corresponding preset length to obtain three second reference values. For the same variable, the preset length is a certain binary value. For the three binary values ​​of the current variable, the second reference value after the binary value is shifted to the right by a preset length is calculated respectively.
[0099] It should be noted that the preset length of each variable is related to the termination bit and the signal length. In the process of offsetting the binary value of the variable:
[0100] For each variable, calculate the difference between the stop bit and the signal length to obtain the corresponding start bit;
[0101] For each variable, the N binary values ​​are respectively shifted to the right by the corresponding start bits to obtain N second reference values.
[0102] After three second reference values ​​are obtained for each variable, the three second reference values ​​corresponding to the M variables need to be combined between the M second reference values ​​to obtain 3 M binary combinations, according to 3 M binary combinations generate 8 rows of 3 M Binary arrays in column form as test cases.
[0103] Wherein, when combining the N second reference values ​​corresponding to the M variables respectively among the M second reference values, it is necessary to obtain a second reference value for each variable, and according to the obtained M second reference values values ​​are combined. can get N M binary combinations from which 8 rows of N are generated M Binary array in column form, the test case at this time is 8 rows N M Binary array in column form.
[0104] Step 303: Obtain a software interface definition file, and establish a corresponding matching relationship between the software interface definition file and the database container file.
[0105] After obtaining the test case, it is necessary to obtain the software interface definition file, wherein the software interface definition file stores a second information sub-file with the same content as the first information sub-file in the database container file but with a different name; after establishing the software interface definition file When the corresponding matching relationship with the database container file: search for the second information sub-file with the same content as the first information sub-file according to the annotation of the first information sub-file; establish the correspondence between the first information sub-file and the corresponding second information sub-file relation.
[0106] The number of the first information sub-files in the database container file is multiple, and the number of the second information sub-files stored in the software interface definition file is also multiple. The content in the first information sub-file and the second information sub-file is the same, but the form of the content is different from the name of the file, and it is necessary to establish the corresponding relationship between the first information sub-file and the second information sub-file according to the relevant annotations, and then can A corresponding matching relationship between the software interface definition file and the database container file is formed.
[0107] Step 304 , build a test platform according to the test case, the test output file and the corresponding matching relationship.
[0108] Step 305: Obtain the program to be tested associated with the interface to be tested in the project project to be tested.
[0109] Step 306: Determine whether a read operation or a write operation needs to be performed in the current state. If a write operation needs to be performed in the current state, step 307 and step 308 are performed, and if a read operation needs to be performed in the current state, steps 309 and 310 are performed.
[0110] Step 307: Using the binary array as the reference input information, after running the program to be tested, obtain N reference physical values ​​after running for the first variable.
[0111] Step 308: Match the N reference physical values ​​with the N physical values ​​corresponding to the first variable in the test case, and generate a test result for the program to be tested according to the matching result.
[0112] When performing a write operation, the binary array needs to be used as reference input information, so that the program to be tested is run against the binary array to obtain N reference physical values ​​corresponding to the first variable. Then, the obtained N reference physical values ​​are matched with the N physical values ​​corresponding to the first variable. If the two match, it proves that the program to be tested is normal, that is, the interface to be tested is in a normal state. If the two do not match, then Indicates that the interface under test is in an abnormal state. The process of running the program to be tested against the binary array and obtaining N reference physical values ​​of the first variable can be understood as: obtaining N binary values ​​of the current variable, and determining the corresponding decimal values ​​for the N binary values ​​of the current variable, respectively, Then calculate the sum of the decimal value and the corresponding offset, and multiply the obtained sum value by the corresponding variable precision to obtain N physical values ​​corresponding to the current variable.
[0113] Step 309: Using the N physical values ​​of the second variable as reference input information, after running the program to be tested, obtain a reference binary value for the second variable.
[0114] Step 310: Match the reference binary value with the binary value corresponding to the second variable in the binary array of the test case, and generate a test result for the program to be tested according to the matching result.
[0115] During the read operation, N physical values ​​of the second variable are required as reference input information, so that the program to be tested is run against the N physical values ​​of the second variable, and N reference binary values ​​of the second variable are obtained, and then in the binary N binary values ​​corresponding to the second variable are obtained from the array, and the two are matched. If the two match, it proves that the interface to be tested is in a normal state, and if the two do not match, it indicates that the interface to be tested is in an abnormal state.
[0116] In the second embodiment of the present invention, by acquiring a database container file and generating a test case and a test output file, a corresponding matching relationship between the acquired software interface definition file and the database container file is established, and a test platform is built according to the test case, the test output file and the corresponding matching relationship , according to a reference input information, use the test platform to run the program to be tested associated with the interface to be tested in the project to be tested, and generate test results for the program to be tested, which can be optimized on the basis of the traditional interface test platform, and the manual link is optimized. In order to automatically generate and automatically build a test environment, shorten the test cycle, ensure the accuracy of CAN message analysis and packaging, and improve the quality of the vehicle controller software.

Example Embodiment

[0117] Embodiment 3
[0118] like Figure 4 As shown, the interface automatic testing method of the vehicle controller provided by the third embodiment of the present invention includes:
[0119] Step 401, import the database container file.
[0120] Step 402: Generate a CAN message attribute configuration table according to the database container file.
[0121] Step 403 , using the CAN message parsing algorithm to generate a test case according to the CAN message attribute configuration table.
[0122] Step 404: Generate a test output file according to the attribute configuration of the CAN message.
[0123] Step 405: Obtain the first information sub-file in the database container file.
[0124] Step 406 , import the software interface definition file.
[0125] Step 407 , import the project project to be tested.
[0126] Step 408: Acquire the second information sub-file in the software interface definition file, and establish a corresponding matching relationship between the first information sub-file and the second information sub-file.
[0127] The software interface definition file stores a second information sub-file with the same content as the first information sub-file in the database container file but with a different name.
[0128] Step 409: Generate a test project according to the test case, the test output file, the corresponding matching relationship between the first information sub-file and the second information sub-file, and the project to be tested.
[0129] Step 410: Run the test project to output the test result. Then end the process.
[0130] In the third embodiment of the present invention, by acquiring database container files and generating test cases and test output files, a corresponding matching relationship between the acquired software interface definition files and database container files is established, and a test platform is built according to the test cases, test output files and corresponding matching relationships. , according to a reference input information, use the test platform to run the program to be tested associated with the interface to be tested in the project to be tested, and generate test results for the program to be tested, which can be optimized on the basis of the traditional interface test platform, and the manual link is optimized. In order to automatically generate and automatically build a test environment, shorten the test cycle, ensure the accuracy of CAN message analysis and packaging, and improve the quality of the vehicle controller software.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Similar technology patents

Durability test device for wiring harness of automobile chassis

InactiveCN107202699AShorten the test cycleReduce the difficulty of test operationVehicle testingAutomotive engineeringRolling chassis
Owner:广电计量检测(武汉)有限公司 +1

NAS test system, method and computer-readable storage medium

InactiveCN109471784AReduced test accuracyShorten the test cycleHardware monitoringComputer hardwareTest script
Owner:ZHENGZHOU YUNHAI INFORMATION TECH CO LTD

Classification and recommendation of technical efficacy words

  • Quality improvement
  • Shorten the test cycle

Monodisperse core/shell and other complex structured nanocrystals and methods of preparing the same

ActiveUS20050129947A1Narrow size distributionQuality improvementMaterial nanotechnologyFrom normal temperature solutionsChemistrySemiconductor nanostructures
Owner:THE BOARD OF TRUSTEES OF THE UNIV OF ARKANSAS
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products