CN111258290A - Automatic test method and system for vehicle control unit - Google Patents
Automatic test method and system for vehicle control unit Download PDFInfo
- Publication number
- CN111258290A CN111258290A CN201811459531.1A CN201811459531A CN111258290A CN 111258290 A CN111258290 A CN 111258290A CN 201811459531 A CN201811459531 A CN 201811459531A CN 111258290 A CN111258290 A CN 111258290A
- Authority
- CN
- China
- Prior art keywords
- test
- case
- attribute
- automatic
- automatic test
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010998 test method Methods 0.000 title claims description 22
- 238000012360 testing method Methods 0.000 claims abstract description 488
- 238000000034 method Methods 0.000 claims description 26
- 230000004931 aggregating effect Effects 0.000 claims description 3
- 230000008569 process Effects 0.000 description 16
- 238000012423 maintenance Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000011161 development Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000011156 evaluation Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 241000976924 Inca Species 0.000 description 2
- 238000012356 Product development Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000005215 recombination Methods 0.000 description 2
- 230000006798 recombination Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000004134 energy conservation Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012797 qualification Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012422 test repetition Methods 0.000 description 1
- 238000012956 testing procedure Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0208—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
- G05B23/0213—Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24065—Real time diagnostics
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention relates to the field of vehicle testing, and provides a vehicle control unit automatic testing method and a vehicle control unit automatic testing system, wherein the vehicle control unit automatic testing method comprises the steps of obtaining an automatic testing request; querying an attribute case association table based on the automatic test request to determine a target case attribute module corresponding to the automatic test request, wherein the attribute case association table comprises a plurality of case attribute modules, and each case attribute module points to different test cases; and calling the pointed target test case based on the determined target case attribute module, and executing the automatic test. Therefore, the automatic test is realized to replace manual test, a professional test engineer is not required to understand professional and unintelligible test case codes, only a table look-up request aiming at the case attribute module is required to be sent, the test operation is finished with high automation degree, the application range of the automatic test is improved, and the test cost is also reduced.
Description
Technical Field
The invention relates to the technical field of vehicle testing, in particular to an automatic testing method and system for a vehicle control unit.
Background
With the gradual rise of environmental protection consciousness of people, the new energy automobiles including pure electric vehicles and hybrid electric vehicles aim to reduce emission, and are considered to be one of the effective paths of current energy conservation and emission reduction. The Vehicle Control Unit (VCU) judges the driving intention of a driver by acquiring signals of an accelerator pedal, a gear, a brake pedal and the like of the electric vehicle, monitors vehicle state (vehicle speed, temperature and the like) information, makes judgment processing, sends a running state control instruction of the vehicle to a power system or a power battery system, and controls the working mode of a vehicle-mounted electric power system. The vehicle control unit is a core component of the electric vehicle and plays an important role in safe, stable and reliable operation of the electric vehicle.
At present, the system test of the whole electric vehicle controller usually depends on manual test, and a tester needs to manually input system variables of the whole electric vehicle controller aiming at each test case, so that the requirement of the system on the input variables in the test process is met; and then, the tester carries out manual reading judgment on the visual output result, thereby completing the test of a system function.
However, the inventor of the present application finds in practicing the present application that the prior art solutions based on manual testing have the following disadvantages: firstly, the manual test period is long; the whole testing process needs manual action operation, variable modification and result comparison, so that excessive time is wasted in manual modification of variables and other manual operation processes, the testing period is too long, and a full-function system needs to spend several days for testing. Moreover, the test error rate is high, the whole test needs manual intervention to be completed, and the conditions of test condition omission, test result checking error and the like may occur in manual operation. Secondly, extracting a test case file according to the requirement provided by the system, and covering all input conditions of the system to complete multi-condition, multi-working-condition and multi-task system test, wherein the test case is currently compiled by manual description and is in a non-machine recognizable text format, so that in the test process, a tester is required to decode the case content, then manual operation is performed according to the decoding content, and the test process is further completed; therefore, users need to know the content and format of the use case to complete the automated testing, so that the application of the testing scheme is limited.
Disclosure of Invention
In view of the above, the present invention is directed to provide an automatic test method for a vehicle control unit, so as to solve at least the problems in the prior art that the manual test is complex in operation, prone to missing items and high in error rate, and the test application is limited due to the need of a professional test engineer to interpret the contents of the test case and perform the test operation during the test.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
an automatic test method for a vehicle control unit comprises the following steps: acquiring an automatic test request; querying an attribute case association table based on the automatic test request to determine a target case attribute module corresponding to the automatic test request, wherein the attribute case association table comprises a plurality of case attribute modules, and each case attribute module points to different test cases; and calling the pointed target test case based on the determined target case attribute module, and executing the automatic test.
Further, the obtaining the automated test request includes: reading test request information set by a user from the test case association table, wherein the test request information comprises selection information aiming at a case attribute module; and generating the corresponding automatic test request based on the test request information.
Further, the selection information further includes calling frequency information, where the calling the targeted test case pointed by the module based on the determined property of the targeted test case, and executing the automated test includes: and executing the automatic test corresponding to the calling time information on the determined target test case.
Further, the selection information further includes a test start value, a test end value, and a test step value, where the calling the targeted test case based on the determined property of the targeted test case, and executing the automated test includes: analyzing and splitting the selected case attribute module according to the test starting value and the test ending value; generating a continuous test sequence according to the split case attribute module and the test step value; based on the continuous test sequence, a continuous automated test is performed.
Further, before querying the attribute use case association table based on the automated test request, the method further includes creating the attribute use case association table, where creating the attribute use case association table includes: obtaining a plurality of test cases; respectively reading the test case attribute information of the plurality of test cases, and aggregating the read test case attribute information to generate a case attribute module pointing to the read test case; and creating the attribute use case association table according to the generated use case attribute module.
Further, the reading the test case attribute information of the plurality of test cases respectively includes: converting the test cases into corresponding standard case input text formats; and reading test case attribute information from the plurality of test cases in the standard case input text format.
Further, the reading of the test case attribute information from the plurality of test cases in the standard case input text format includes: and reading the test case attribute information based on a python generator so as to automatically identify the data format of the read test case attribute information.
Further, the creating the attribute use case association table according to the use case attribute module includes: and storing the test case attribute information of each column in the attribute case association table according to a dictionary format.
Furthermore, the attribute use case association table further includes expected test data corresponding to each use case attribute module, wherein after the target test case pointed by the determined target use case attribute module call is called and the automated test is executed, the method further includes: when automatic test data are generated, comparing the automatic test data with expected test data corresponding to the target case attribute module to obtain an automatic test result; and storing the automatic test result to the attribute case association table for the user to look up.
Compared with the prior art, the automatic test method for the vehicle control unit has the following advantages:
the automatic test method of the vehicle control unit disclosed by the invention has the advantages that the automatic test request for inquiring the attribute case association table is responded, the target case attribute module requested in the table is found out, and the test case is called based on the direction relation between the case attribute module in the table and the test case, so that the automatic test operation is executed. Therefore, a professional test engineer does not need to understand the test case codes which are difficult to understand, the pointed test case can be called through the case attribute module only by sending a table look-up request aiming at the case attribute module, the test operation is finished at a high degree of automation, the application range of the automatic test is expanded, and the test cost is reduced.
Another objective of the present invention is to provide an automatic test system for a vehicle control unit, so as to solve at least the problems of complicated operation, easy missing items, and high error rate of manual testing in the prior art, and limited testing application caused by the need of a professional test engineer to interpret the contents of test cases and perform testing operations during testing.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the utility model provides a vehicle control unit automated testing system, vehicle control unit automated testing system includes: the request acquisition unit is used for acquiring an automatic test request; the system comprises an association table query unit, a test case attribute module determination unit and a test case attribute module comparison unit, wherein the association table query unit is used for querying an attribute case association table based on the automatic test request so as to determine a target case attribute module corresponding to the automatic test request, the attribute case association table comprises a plurality of case attribute modules, and each case attribute module points to different test cases; and the automatic test unit is used for calling the pointed test case based on the determined target case attribute module and executing the automatic test.
Compared with the prior art, the automatic test system of the vehicle controller and the automatic test method of the vehicle controller have the same advantages, and are not repeated herein.
Additional features and advantages of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart of an automated testing method for a vehicle control unit according to an embodiment of the invention;
fig. 2 is a flowchart illustrating a specific implementation of S11 in the automatic test method for a vehicle control unit shown in fig. 1;
fig. 3 is a flow diagram illustrating automatic creation of an attribute case association table in the automatic test method for the vehicle control unit according to the embodiment of the present invention;
FIG. 4 is an example of an attribute use case association table according to an embodiment of the present invention;
FIG. 5 is a flowchart of an automated testing method for a hybrid vehicle controller according to another embodiment of the present invention;
fig. 6 is a schematic diagram of a system architecture of an automated testing method for a vehicle control unit according to an embodiment of the invention;
fig. 7 is an example of the working principle of the automatic testing method for the vehicle control unit according to the embodiment of the present invention;
fig. 8 is a flowchart illustrating a process of reading a maintenance document in the automatic test method for a vehicle control unit according to an embodiment of the invention;
fig. 9 is a flowchart example of implementing an automatic test and reading an actual measurement result in the automatic test method for the vehicle control unit according to the embodiment of the present invention;
FIG. 10 is an example of a test report output by the method for automated testing of a hybrid vehicle controller according to an embodiment of the invention;
fig. 11 is a block diagram of an automated testing system of a vehicle control unit according to an embodiment of the present invention.
Description of reference numerals:
801 request acquisition unit 802 association table lookup unit
803 automated test unit
80 automatic test system of vehicle control unit
Detailed Description
In addition, the embodiments of the present invention and the features of the embodiments may be combined with each other without conflict.
In addition, the case attribute module mentioned in the embodiment of the present invention refers to a set of attribute information corresponding to the same test case, and the test case attribute information may be various descriptive information representing the test case, and may include, for example, a test case number, a test step, a delay time, and a call setting value.
The present invention will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
As shown in fig. 1, an automated testing method for a vehicle control unit according to an embodiment of the present invention includes:
and S11, acquiring an automatic test request.
Regarding the execution subject of the method of the embodiment of the present invention, on one hand, it may be realized by a device or an instrument dedicated to executing the automated test of the vehicle control unit; on the other hand, it may also be an automated test unit or an automated test module configured on a general-purpose terminal or device for implementing the automated test method of the embodiment of the present invention, for example, a corresponding code for testing may be configured on the automated test unit or the automated test module. By way of example, it may be implemented based on code, units, or modules applied to hardware in a loop test system (HIL).
The automatic test request acquisition mode can be realized based on the operation of a user on the automatic test equipment; it should be noted that, in the embodiment of the present invention, the person who requests to execute the automated test is not required to be a professional person who needs to understand the programming language of the test case, and the person may be a person who can realize the automated test operation without completely knowing the professional programming language of the test case. Wherein the test request is specific to one or more specific test cases to request the automatic test to be executed on the test cases.
S12, inquiring the attribute case association table based on the automatic test request to determine a target case attribute module corresponding to the automatic test request, wherein the attribute case association table comprises a plurality of case attribute modules, and each case attribute module points to different test cases.
The attribute case association table in the embodiment only needs to point and associate the attribute module and the test case, so that the test case is called, and therefore the attribute case association table can be suitable for various types of test cases.
And S13, calling the pointed target test case based on the determined target case attribute module, and executing the automated test.
In this embodiment, through the pre-configured attribute case association table, the directional association is performed between the case attribute module and the test case, so that the corresponding case attribute module can be found by responding to the automatic test request for the table look-up type request, and further, the call of the targeted test case is realized, and the automatic test process of the test case is effectively realized. Therefore, the current complicated manual operation testing process is upgraded into automatic testing (such as automatic testing based on a software program), so that the manual intervention in the testing process is avoided, the accuracy and subjectivity of the testing process are improved, the testing result is more feasible, and the requirement is finally realized in a full coverage manner.
It should be noted that, as described above, the use case attribute module refers to a set of attribute information corresponding to the same test case, and all the expressed contents are contents that are easily understood by the user; therefore, the automatic test request related to the table lookup can be made by the user based on the comprehension of the descriptive information, so that the user executing the automatic test task does not even need to understand the meaning of the test case, the user can call the specific test case only by operating the attribute case association table, even does not need a professional test engineer to access the operation, the application range of the automatic test is expanded, and the test cost is reduced.
In some embodiments, test conditions (for example, an and relationship or an or relationship) combination can be performed on the pointed target test case, so that a plurality of groups of test cases with different test conditions can be derived, and test case recombination is automatically realized, so that the test case requiring the test condition combination is automatically tested, test requirements of some personalized test scenes are met, and test experience of a user is improved.
Preferably, the user may also issue the automatic test request by operating on the same table, for example, setting test request information in the table, and then when performing the automatic test, obtaining the automatic test request by reading the table. An example of a specific execution flow of S11 as shown in fig. 2 includes:
and S111, reading test request information set by a user from the test case association table, wherein the test request information comprises selection information aiming at the case attribute module.
And S112, generating the corresponding automatic test request based on the test request information.
More specifically, it may also be that the test request information is set at a predefined location of the test case association table, so that the test request information at the predefined location can be read when the automated test operation starts, thereby generating the automated test request.
In some preferred embodiments, the selection information further includes call times information, thereby enabling determination of the number of times of calling to execute the test case according to the call times information, and enabling execution of the automated test corresponding to the call times information on the determined target test case when the automated test is executed. When the calling frequency information is more than 1 time, the cyclic automatic test can be executed on the determined target test case by inputting the request once without repeating complicated multiple inputs, so that the test experience of the user is improved.
In some embodiments, only part of steps in the test case can be tested, and the whole test case does not need to be called and executed, so that the test efficiency is improved. Specifically, the test start value, the test end value, and the test step value may be set in the selection information, so that when the automated test is executed, the selected case attribute module may be resolved and split according to the test start value and the test end value, then a continuous test sequence may be generated according to the split case attribute module and the test step value, and the continuous automated test may be executed based on the continuous test sequence. As an example, when the input test number is set as a, the start value is 50, the end value is 100, and the step size is 10, a 50-100 continuous test sequence corresponding to 5 steps can be automatically obtained, so as to complete the continuous automatic test of the selected step interval under the use case, and multiple inputs are not required, thereby avoiding the deviation caused by multiple input settings of the user.
Regarding the construction method of the attribute use case association table in the embodiment of the present invention, on one hand, the relationship between the use case attribute module and the corresponding test use case may be artificially constructed, so as to implement the construction of the use case attribute module; on the other hand, it may also be implemented by an automatic creation mode, such as the flow of automatically creating the attribute use case association table shown in fig. 3, specifically including:
and S31, acquiring a plurality of test cases.
The obtained multiple test cases may be all test cases that may be involved in future tests.
S32, respectively reading the test case attribute information of a plurality of test cases, and aggregating the read test case attribute information to generate a case attribute module pointing to the read test case.
And S33, creating an attribute use case association table according to the generated use case attribute module.
In some embodiments, it may be necessary to ensure that the test case attribute information is from the same data format to ensure the reliability of the aggregated use case attribute modules. Therefore, when the test case is input, the test case should meet a uniform text format, for example, all the test cases may be in an excel text format; preferably, when the case attribute information is read, the plurality of test cases may be converted into a corresponding standard case input text format (for example, an excel text format), and the test case attribute information is read from the plurality of test cases in the standard case input text format.
In some embodiments, the test case attribute information may be read based on a python generator to automatically identify a data format of the test case attribute information, such as a null value, a non-null value, a special character string, and the like, thereby implementing fast reading of data and occupying a small memory. In addition, the work flow of the python generator to read information is not only applicable to the table creation phase, but also applicable to the phase of executing the test in response to the request, and the effect of fast reading of data can be achieved.
As shown in fig. 4, in an example of the attribute use case association table according to an embodiment of the present invention, data in each column is stored in a dictionary (dictionary) format, for example, the data may be stored with a column position as key and a value in each column as value.
In some preferred embodiments, it is desirable to obtain test results directly during automated testing, rather than just test data. As shown in fig. 5, an automated testing method for a vehicle control unit according to an embodiment of the present invention includes:
and S51, acquiring an automatic test request.
S52, inquiring the attribute case association table based on the automatic test request to determine a target case attribute module corresponding to the automatic test request, wherein the attribute case association table comprises a plurality of case attribute modules, and each case attribute module points to different test cases.
And S53, calling the pointed target test case based on the determined target case attribute module, and executing the automated test.
For details and effects of the embodiments of S51-S53, reference may be made to the above description of the related embodiments, and therefore, the details are not repeated herein. Further, in order to intuitively obtain the test result, it may be realized by performing the following operations.
And S54, when the automatic test data are generated, comparing the automatic test data with expected test data corresponding to the target case attribute module to obtain an automatic test result, wherein the attribute case association table comprises the expected test data corresponding to each case attribute module.
And S55, storing the automatic test result to the attribute case association table for real-time reference by the user.
In this embodiment, the automatic test result may be directly stored in the attribute case association table, so that the user can intuitively refer to the test result of the test case. Therefore, the embodiment of the invention can realize that the result can be generated in real time and can be consulted by the user in real time after the test result of one test case is finished, and the user does not need to consult the test case after all the test cases are finished, so that the user can conveniently know the test condition in time, the user is allowed to quickly take measures, and the automatic test experience of the whole vehicle controller is improved.
In the embodiment, the standard format test case input text is provided, so that the requirements of different types of test cases can be met. The test case file can be automatically read, the corresponding parameter names and values in the test text are stored in a data dictionary format, the test process circularly calls a universal test script unit, an automatic test operator who completes the case can complete the automatic test only by maintaining the test case file without knowing a programming language and compiling the test script, and the high automation of the system test can be completed. In addition, many effects can be achieved by implementing the embodiment of the present invention, for example: firstly, the testing period can be shortened to the greatest extent, so that the optimization of time and labor cost is realized, the product development cost is saved, and the product development period is shortened. Secondly, the test result can be observed and judged in real time, signals with short duration in the process are captured and read, and post-processing analysis of data is avoided; and thirdly, an operator does not need to know the programming development language, only needs to know the test requirement and input the test document, the test process can be completed, and the combined operation of different work types can be realized.
As shown in fig. 6, the architecture of the automatic test system of the vehicle control unit according to an embodiment of the present invention may be a test environment based on the original HIL and INCA calibration software, a test software platform is added, and a python programming language calculation method is adopted to program the test process, so as to achieve the VCU test automation. Specifically, it may include three test units: the test data reading unit, the test unit and the data result storage unit are simple to maintain, and can configure the test repetition times of the use case in the test use case configuration file to realize the repeatability test; the configuration file can also carry out selective configuration on the test case, and can carry out test configuration forbidding if the test is not needed, so that the point inspection test is realized. The test unit adopts an interface function, duplicate removal operation is not needed, and the worry that a certain variable is repeatedly input in a test case is avoided.
As shown in fig. 7, an example of the working principle of the automatic test system of the vehicle control unit according to the embodiment of the present invention may be that a test identifier is added to a test document, so that test cases can be screened and executed. The method mainly comprises the definition of an input file of Excel and the development of automatic testing software.
The following examples of the method of the embodiment of the present invention applied to a machine-readable storage medium of an integrated automation test software program code specifically include the following aspects:
on one hand, the Excel-based input file definition can be realized by providing a standard format test case input text, the input part of the automatic test case is an xls or xlsx text file, the standard text covers the requirements of different test requirements, an operator can intuitively define the input and output part of the test requirements and maintain tasks, the readability is strong, the embodiment can automatically identify the keyword part of the test text, so that the corresponding function is called, and the expected operation is completed. Illustratively, the specific standard template may be a table as shown with reference to fig. 4. Firstly, before testing, the test case document needs to be maintained, including: number, test description, number of tests, whether to test, test steps, delay time, set values, and expected values. The test step and the expected value are the parts mainly needing maintenance, and init and step (set value and expected value) need to be maintained in the test step. Engineers need to input the test documents according to requirements, and the test conditions and the test results are ensured to be correct.
On the other hand, the development of the automated testing software may be to read a maintenance document (as input), automatically read an actual measurement result, automatically analyze a testing procedure, automatically evaluate a testing result, and automatically generate a testing report.
The automatic test method of the vehicle control unit comprises the following steps:
1) reading maintenance documents
The test software can automatically identify batch test case files, for example, the test script file is x, xls, different testers can put respective test cases into a designated folder, and the software can automatically complete execution of all test cases, so that the testers are prevented from independently testing. The item is characterized in that the input data of the maintenance document is read by software, the software can read the number, the test description, the test step, the time, the set Value and the expected Value, each column is stored in a dictionary (dictionary) format, the column position is used as a key, the Value of each column is used as Value, the data is read in a python generator (yield) mode, and the software can automatically identify the data format (null Value, non-null Value and special format character string). The software can automatically recognize the keywords in the dictionary, thereby executing different flow operations.
In the test flow shown in fig. 8, all test cases share one universal test script unit, which avoids that each test case needs to write its own test script, and is simpler to maintain. Meanwhile, the software provides an open function interface, and an operator can compile own private functions, so that the embedding of different test requirements is facilitated, and the upgrading of the software is also facilitated. In the testing process, the software analyzes the test variable name and the test variable value from the data dictionary to carry out data input and result comparison. And the testing step is used for testing and judging results.
2) Automatically testing and reading the measured result
As shown in fig. 9, the automated testing software can automatically read the hard-line and entire can message data in the HIL model and can also read the internal calibration data of the model in the INCA,
preferably, the combined test can be automatically generated on the test conditions, so that a tester only needs to write a group of conditions with true results and expected results into the test text, thereby automatically realizing the recombination generation of a plurality of groups of test cases and deriving a plurality of groups of test cases with different test conditions; for example, a test case True value condition needs to satisfy the relation (and relation) at the same time (test variable 1 ═ True and test variable 2 ═ True and test variable 3 ═ True and test variable 4 ═ True and … test variable N ═ True) N conditions are satisfied at the same time, the tester only needs to input this set of True values conditions (test variable 1 ═ True and test variable 2 ═ True and test variable 3 ═ True and test variable 4 ═ True and test variable … …) and results (test result ═ True) in the test configuration file, the test software can be automatically arranged and combined into multiple groups of test cases, including all conditions satisfied, one condition not satisfied, two conditions not satisfied … … N conditions not satisfied, and N | total! +1 (factorial of N +1) test cases; similarly, a test case truth condition needs to satisfy or be in a relationship (or relationship) (test variable 1 is True or test variable 2 is True or test variable 3 is True or test variable 4 is True or … … test variable N is True) N conditions at the same time, wherein when any one condition is satisfied, the test result is True, the tester only needs to input the set of truth conditions (test variable 1 is True or test variable 2 is True or test variable 3 is True or test variable 4 is True or test variable … … test variable N is True) and the result (test result is True) in the test configuration file, the test software can automatically arrange and combine the test cases into multiple groups, wherein all the conditions are not satisfied, one condition is satisfied, two conditions are … … N conditions satisfy the test case, and N is a total test case! +1 (factorial of N +1) test cases. And (and, or) mixed relation test cases can also be completed.
3) Automatic analytical test procedure
According to the input starting value, the end value, the step value and the test time, for example, an input variable value variable _ A is set, the starting value is 0, the end value is 100, and the step length is 10.
4) Automatic real-time evaluation test result and automatic generation of test report
In this embodiment, the test result can be generated in real time, the test case which has been tested can be checked in real time, and the result does not need to be checked after the whole test file is completely executed.
Automatically evaluating the test results: the automatic test software compares the expected result calculated according to each set of test input with the read test result, if the expected result is consistent with the expected value or range, the test is qualified, otherwise the test fails.
Automatically generating a test report: the automatic test software will form an array of all the input test evaluations for each calibration quantity and then return the evaluation results to the maintenance documentation to form a test report, which is also done automatically, and the form of the completed test report is shown in fig. 10. The automatic test software can realize the qualification rate statistics of all test results and automatically mark unqualified cases.
By the embodiment of the invention, high-degree automatic test effect can be realized, the cost is low, the test flow is perfected, the test time and the labor cost are saved, and a tester does not need to have a programming basis and only needs to maintain the test text part. In addition, the upgrading from the manual test to the automatic test of the VCU is completed, the defects of SIL and HIL tests are supplemented, the writing mode of test cases is simplified, and the whole process from the test execution to the report generation can be realized by maintaining a table.
As shown in fig. 11, an automated testing system 80 for a vehicle control unit according to an embodiment of the present invention includes: a request acquiring unit 801 configured to acquire an automation test request; an association table query unit 802, configured to query an attribute case association table based on the automatic test request to determine a target case attribute module corresponding to the automatic test request, where the attribute case association table includes a plurality of case attribute modules, and each case attribute module points to a different test case; and the automated testing unit 803 is configured to invoke the pointed target test case based on the determined target case attribute module, and execute an automated test.
For more details of the system according to the embodiment of the present invention, reference may be made to the above description of the method according to the embodiment of the present invention, and the same or corresponding technical effects as those of the method according to the embodiment of the present invention may be obtained, so that no further description is provided herein.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (10)
1. The automatic test method of the vehicle control unit is characterized by comprising the following steps:
acquiring an automatic test request;
querying an attribute case association table based on the automatic test request to determine a target case attribute module corresponding to the automatic test request, wherein the attribute case association table comprises a plurality of case attribute modules, and each case attribute module points to different test cases;
and calling the pointed target test case based on the determined target case attribute module, and executing the automatic test.
2. The automatic test method for the vehicle control unit according to claim 1, wherein the obtaining of the automatic test request comprises:
reading test request information set by a user from the test case association table, wherein the test request information comprises selection information aiming at a case attribute module;
and generating the corresponding automatic test request based on the test request information.
3. The automatic test method for vehicle control units according to claim 2, wherein the selection information further includes call times information, and wherein the calling the targeted test case based on the determined target case attribute module and executing the automatic test includes:
and executing the automatic test corresponding to the calling time information on the determined target test case.
4. The automatic test method for vehicle control units according to claim 2, wherein the selection information further includes a test start value, a test end value and a test step value, and wherein the calling the pointed target test case based on the determined target case attribute module and executing the automatic test includes:
analyzing and splitting the selected case attribute module according to the test starting value and the test ending value;
generating a continuous test sequence according to the split case attribute module and the test step value;
based on the continuous test sequence, a continuous automated test is performed.
5. The automatic test method for a vehicle control unit according to claim 1, further comprising creating the attribute use case association table before querying the attribute use case association table based on the automatic test request, wherein the creating the attribute use case association table comprises:
obtaining a plurality of test cases;
respectively reading the test case attribute information of the plurality of test cases, and aggregating the read test case attribute information to generate a case attribute module pointing to the read test case;
and creating the attribute use case association table according to the generated use case attribute module.
6. The automatic test method for the vehicle control unit according to claim 5, wherein the reading the test case attribute information of the plurality of test cases respectively comprises:
converting the test cases into corresponding standard case input text formats;
and reading test case attribute information from the plurality of test cases in the standard case input text format.
7. The automatic test method for the vehicle control unit according to claim 6, wherein the reading of the test case attribute information from the plurality of test cases in the standard case input text format comprises:
and reading the test case attribute information based on a python generator so as to automatically identify the data format of the read test case attribute information.
8. The automatic test method for the vehicle control unit according to claim 5, wherein the creating the attribute use case association table according to the use case attribute module includes:
and storing the test case attribute information of each column in the attribute case association table according to a dictionary format.
9. The automatic test method for the vehicle control unit according to claim 1, wherein the attribute use case association table further includes expected test data corresponding to each use case attribute module, and after calling the pointed target test case based on the determined target use case attribute module and executing the automatic test, the method further includes:
when automatic test data are generated, comparing the automatic test data with expected test data corresponding to the target case attribute module to obtain an automatic test result;
and storing the automatic test result to the attribute case association table for the user to look up.
10. The automatic test system of the vehicle control unit is characterized by comprising the following components:
the request acquisition unit is used for acquiring an automatic test request;
the system comprises an association table query unit, a test case attribute module determination unit and a test case attribute module comparison unit, wherein the association table query unit is used for querying an attribute case association table based on the automatic test request so as to determine a target case attribute module corresponding to the automatic test request, the attribute case association table comprises a plurality of case attribute modules, and each case attribute module points to different test cases;
and the automatic test unit is used for calling the pointed target test case based on the determined target case attribute module and executing the automatic test.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811459531.1A CN111258290A (en) | 2018-11-30 | 2018-11-30 | Automatic test method and system for vehicle control unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811459531.1A CN111258290A (en) | 2018-11-30 | 2018-11-30 | Automatic test method and system for vehicle control unit |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111258290A true CN111258290A (en) | 2020-06-09 |
Family
ID=70944796
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811459531.1A Pending CN111258290A (en) | 2018-11-30 | 2018-11-30 | Automatic test method and system for vehicle control unit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111258290A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111796578A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Vehicle controller testing method, device and system and storage medium |
CN112068530A (en) * | 2020-09-01 | 2020-12-11 | 华人运通(江苏)技术有限公司 | ECU (electronic control Unit) automatic testing method, system, storage medium and device |
CN112526966A (en) * | 2020-11-20 | 2021-03-19 | 广西玉柴机器股份有限公司 | Automatic testing method and system for controller HIL |
CN112559326A (en) * | 2020-12-03 | 2021-03-26 | 北京车和家信息技术有限公司 | Testing method and device for fusion calibration, vehicle-mounted system and vehicle |
CN113064823A (en) * | 2021-03-30 | 2021-07-02 | 奇瑞汽车股份有限公司 | Method and device for testing functions of automobile parts and computer storage medium |
CN113297068A (en) * | 2021-04-20 | 2021-08-24 | 惠州市德赛西威汽车电子股份有限公司 | Tessy-based method for processing input and output into fixed template in batch and storage medium thereof |
CN114265763A (en) * | 2021-11-30 | 2022-04-01 | 江铃汽车股份有限公司 | HIL automatic test report curve support enumeration display method |
CN114780425A (en) * | 2022-04-30 | 2022-07-22 | 重庆长安新能源汽车科技有限公司 | Method for designing hardware-in-loop automatic test case of vehicle control unit |
CN115658550A (en) * | 2022-12-09 | 2023-01-31 | 合肥高维数据技术有限公司 | Automatic testing method and system for improving large-scale sample testing efficiency |
TWI811607B (en) * | 2020-12-31 | 2023-08-11 | 新唐科技股份有限公司 | Microcontroller, testing method for microcontroller and system including microcontroller |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064403A (en) * | 2012-12-19 | 2013-04-24 | 潍柴动力股份有限公司 | Method and system of electronic control unit (ECU) hardware-in-loop simulation automated testing |
CN108628748A (en) * | 2018-05-09 | 2018-10-09 | 平安普惠企业管理有限公司 | Automatic test management method and automatic test manage system |
-
2018
- 2018-11-30 CN CN201811459531.1A patent/CN111258290A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064403A (en) * | 2012-12-19 | 2013-04-24 | 潍柴动力股份有限公司 | Method and system of electronic control unit (ECU) hardware-in-loop simulation automated testing |
CN108628748A (en) * | 2018-05-09 | 2018-10-09 | 平安普惠企业管理有限公司 | Automatic test management method and automatic test manage system |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111796578A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Vehicle controller testing method, device and system and storage medium |
CN112068530A (en) * | 2020-09-01 | 2020-12-11 | 华人运通(江苏)技术有限公司 | ECU (electronic control Unit) automatic testing method, system, storage medium and device |
CN112526966A (en) * | 2020-11-20 | 2021-03-19 | 广西玉柴机器股份有限公司 | Automatic testing method and system for controller HIL |
CN112526966B (en) * | 2020-11-20 | 2024-04-05 | 广西玉柴机器股份有限公司 | Automatic test method and system for HIL (high-performance liquid chromatography) of controller |
CN112559326A (en) * | 2020-12-03 | 2021-03-26 | 北京车和家信息技术有限公司 | Testing method and device for fusion calibration, vehicle-mounted system and vehicle |
TWI811607B (en) * | 2020-12-31 | 2023-08-11 | 新唐科技股份有限公司 | Microcontroller, testing method for microcontroller and system including microcontroller |
CN113064823A (en) * | 2021-03-30 | 2021-07-02 | 奇瑞汽车股份有限公司 | Method and device for testing functions of automobile parts and computer storage medium |
CN113064823B (en) * | 2021-03-30 | 2024-04-09 | 奇瑞汽车股份有限公司 | Method and device for testing functions of parts of automobile and computer storage medium |
CN113297068A (en) * | 2021-04-20 | 2021-08-24 | 惠州市德赛西威汽车电子股份有限公司 | Tessy-based method for processing input and output into fixed template in batch and storage medium thereof |
CN114265763A (en) * | 2021-11-30 | 2022-04-01 | 江铃汽车股份有限公司 | HIL automatic test report curve support enumeration display method |
CN114780425A (en) * | 2022-04-30 | 2022-07-22 | 重庆长安新能源汽车科技有限公司 | Method for designing hardware-in-loop automatic test case of vehicle control unit |
CN114780425B (en) * | 2022-04-30 | 2024-06-04 | 深蓝汽车科技有限公司 | Method for designing hardware-in-loop automatic test case of whole vehicle controller |
CN115658550B (en) * | 2022-12-09 | 2023-04-07 | 合肥高维数据技术有限公司 | Automatic testing method and system for improving large-scale sample testing efficiency |
CN115658550A (en) * | 2022-12-09 | 2023-01-31 | 合肥高维数据技术有限公司 | Automatic testing method and system for improving large-scale sample testing efficiency |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111258290A (en) | Automatic test method and system for vehicle control unit | |
CN110334021B (en) | Interface test case generation method, device, equipment and storage medium | |
CN103064403B (en) | A kind of ECU hardware-in-loop simulation automated testing method and system | |
CN106330618A (en) | Gateway routing automatic test system and test method based on CAN/LIN/MOST hybrid buses | |
CN108776278B (en) | Topological-associated configuration type relay protection test system and method | |
CN111459616B (en) | Test method, device, equipment and storage medium | |
CN111737154A (en) | Vehicle networking automatic test method and device based on UFT | |
CN107885186B (en) | Automatic testing method and system for man-machine interaction function of automobile air conditioner controller | |
CN113325830A (en) | Remote diagnosis method for automobile diagnosis instrument | |
CN111176995A (en) | Test method and test system based on big data test case | |
CN114895649A (en) | Electric automobile thermal management system testing device, method and system and electronic equipment | |
CN112255548B (en) | Battery management system test method and system thereof | |
EP3608786B1 (en) | Systems and methods of requirements chaining and applications thereof | |
CN110334385B (en) | Test method, device and equipment for central controller of comprehensive energy system | |
CN109508204B (en) | Front-end code quality detection method and device | |
CN115987821A (en) | Gateway routing test method and device | |
CN108733028A (en) | A kind of test system and method for control logic | |
CN115185258A (en) | HIL simulation test system and method suitable for vehicle control unit | |
CN108873735B (en) | Power distribution main station system component simulation test device and method | |
CN112612666A (en) | Test control method and device, computer equipment and readable storage medium | |
CN112214403B (en) | Automatic test method, device and system based on protection device model file | |
CN114448851B (en) | Automatic data testing method and system | |
CN118090232A (en) | Vehicle testing method, device, equipment and storage medium | |
CN114090454B (en) | Interface automation test method, device, equipment and storage medium | |
CN113093688B (en) | Input and output testing method and system for new energy vehicle control unit |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200609 |
|
RJ01 | Rejection of invention patent application after publication |