CN111983998A - Automatic diagnosis test case generation system and method - Google Patents

Automatic diagnosis test case generation system and method Download PDF

Info

Publication number
CN111983998A
CN111983998A CN202010924363.XA CN202010924363A CN111983998A CN 111983998 A CN111983998 A CN 111983998A CN 202010924363 A CN202010924363 A CN 202010924363A CN 111983998 A CN111983998 A CN 111983998A
Authority
CN
China
Prior art keywords
test
diagnostic
diagnosis
fault
library
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.)
Granted
Application number
CN202010924363.XA
Other languages
Chinese (zh)
Other versions
CN111983998B (en
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.)
China Express Jiangsu Technology Co Ltd
Human Horizons Jiangsu Technology Co Ltd
Original Assignee
China Express Jiangsu Technology 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 China Express Jiangsu Technology Co Ltd filed Critical China Express Jiangsu Technology Co Ltd
Priority to CN202010924363.XA priority Critical patent/CN111983998B/en
Publication of CN111983998A publication Critical patent/CN111983998A/en
Application granted granted Critical
Publication of CN111983998B publication Critical patent/CN111983998B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0218Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults
    • G05B23/0221Preprocessing measurements, e.g. data collection rate adjustment; Standardization of measurements; Time series or signal analysis, e.g. frequency analysis or wavelets; Trustworthiness of measurements; Indexes therefor; Measurements using easily measured parameters to estimate parameters difficult to measure; Virtual sensor creation; De-noising; Sensor fusion; Unconventional preprocessing inherently present in specific fault detection methods like PCA-based methods

Abstract

The invention provides an automatic test method, which relates to the technical field of automobile diagnosis and test and comprises the following steps: the framework construction unit is used for constructing an automatic test framework and compiling a diagnosis test library according to the automatic test framework and test requirements; the parameter extraction unit is used for respectively extracting a group of first test parameters of each diagnosis item from the test requirements, and each group of first test parameters is associated with a plurality of diagnosis test libraries; and the case generating unit is respectively connected with the frame constructing unit and the parameter extracting unit and used for compiling an automatic test script according to the automatic test frame and respectively calling the diagnostic test libraries related to the first test parameters of each group by adopting the automatic test script to generate the diagnostic test cases of the diagnostic items. The method has the advantages that a structured and decoupled test method is adopted, so that the maintenance cost of the automatic test script is effectively reduced, and the test efficiency and the expandability of the automatic test are improved; the test case has high reusability, coverage and expandability.

Description

Automatic diagnosis test case generation system and method
Technical Field
The invention relates to the technical field of automobile diagnosis and test, in particular to a system and a method for generating an automatic diagnosis and test case.
Background
With the increasing requirements of people on aspects of automobile dynamic property, economy, safety, comfort, environmental protection and the like, automobile technology develops towards electronization and intellectualization increasingly. The fault diagnosis technology of modern automobiles is continuously developed, and various switches, sensors, actuators and controllers are required to realize online fault detection and fault identification, and store corresponding fault codes or inform drivers of fault information in time. In order to ensure that the diagnostic function of the final product-level controller is consistent with the early requirement, the diagnostic function of the controller needs to be comprehensively tested in the development process of the controller. The traditional test method mainly carries out fault simulation test in a manual mode, the test process is complicated, the test repeatability and the test coverage are poor, and the test script is difficult to maintain.
Disclosure of Invention
To solve the problems in the prior art, an automated diagnostic test case generation system is provided, which specifically includes:
the framework construction unit is used for constructing an automatic test framework and compiling a diagnosis test library according to the automatic test framework and test requirements;
a parameter extraction unit, configured to extract a set of first test parameters of each diagnostic item from the test requirement, where each set of first test parameters is associated with a plurality of diagnostic test libraries;
and the case generating unit is respectively connected with the framework constructing unit and the parameter extracting unit and used for compiling an automatic test script according to the automatic test framework and respectively calling the diagnostic test library associated with each group of the first test parameters by adopting the automatic test script to generate the diagnostic test case of each diagnostic item.
Preferably, the automated testing framework comprises the following components in sequence according to the testing execution sequence:
a pretreatment library module for setting a test environment;
the fault and diagnosis result judgment library module is used for setting fault conditions and judging fault diagnosis;
the diagnosis processing library module is used for setting and judging the action to be executed under the fault condition;
the fault recovery and diagnosis result judgment library module is used for setting fault recovery conditions and judging recovery results;
and the post-processing library module is used for recovering the test environment.
Preferably, the system further comprises a preprocessing unit connected to the frame construction unit, the preprocessing unit comprising:
the first storage module is used for building and storing a plurality of universal function libraries according to test requirements, and each universal function library is associated with a plurality of diagnosis items;
the second storage module is connected with the first storage module and used for extracting and storing second test parameters, corresponding to the universal function library, of each diagnosis item from the test requirements;
and the framework construction unit writes the fault and diagnosis result judgment library module of each diagnosis item and the diagnosis test library corresponding to the fault recovery and diagnosis result judgment library module respectively according to the universal function library and the corresponding second test parameters.
Preferably, the automated testing framework further comprises an interface parameter library module, which is used for extracting all signal interfaces of the pre-processing library module, the fault and diagnosis result determination library module, the diagnosis processing library module, the fault recovery and diagnosis result determination library module and the post-processing library module, and defining the mapping relationship among the signal interfaces.
Preferably, the first test parameter includes an equipment operation mode corresponding to each diagnostic item, a fault code, and a fault level to be reported when the fault code occurs in the equipment operation mode.
Preferably, in the automated testing framework, the diagnostic testing library corresponding to the preprocessing library module includes:
a first sub-module for determining whether the testing environment is in an unobstructed state;
and the second submodule is used for setting the equipment operation mode in the first test parameter.
Preferably, in the automated testing framework, the diagnostic testing library corresponding to the failure and diagnosis result determination library module includes:
a third sub-module, configured to set a fault detection enabling condition, a trigger condition of the fault code in the first test parameter, and a setting condition of the fault code;
and the fourth submodule is connected with the third submodule and used for judging whether the fault code is put out when the fault detection enabling condition, the triggering condition and the putting-out condition are met simultaneously.
Preferably, in the automated testing framework, the diagnostic testing library corresponding to the diagnostic processing library module includes:
a fifth sub-module, configured to set an action to be executed under each of the failure levels in the first test parameter;
and the sixth submodule is connected with the fifth submodule and used for judging whether the actual execution action is consistent with the corresponding action to be executed under the fault level.
Preferably, in the automated testing framework, the diagnostic testing library corresponding to the fault recovery and diagnostic result determination library module includes:
a seventh sub-module for setting recovery conditions of the fault code in the first test parameter;
and the eighth submodule is connected with the seventh submodule and used for judging whether the fault is set to be recovered or not when the recovery condition is met.
Preferably, in the automated testing framework, the diagnostic testing library corresponding to the post-processing library module includes a ninth sub-module, which is used to recover the testing environment to be in a fault-free state.
Preferably, the system further comprises a sequence generating unit, connected to the case generating unit, and configured to add the diagnostic test case of each diagnostic item into a diagnostic test sequence, and sequentially execute each diagnostic test case in the diagnostic test sequence to complete an automated diagnostic test.
Preferably, the system further comprises a report generating unit connected to the sequence generating unit for generating an automated diagnostic test report after the automated diagnostic test is completed.
The method for generating the automatic diagnosis test case comprises the following steps:
s1, constructing an automatic test framework, and compiling a diagnosis test library according to the automatic test framework and the test requirements;
step S2, a group of first test parameters of each diagnosis item is respectively extracted from the test requirements, and each group of first test parameters is associated with a plurality of diagnosis test libraries;
and step S3, compiling an automatic test script according to the automatic test framework, and calling the diagnosis test library associated with each group of the first test parameters respectively by using the automatic test script to generate a diagnosis test case of each diagnosis item.
Preferably, in step S1, the automated testing framework includes, in order of test execution:
a pretreatment library module for setting a test environment;
the fault and diagnosis result judgment library module is used for setting fault conditions and judging fault diagnosis;
the diagnosis processing library module is used for setting and judging the action to be executed under the fault condition;
the fault recovery and diagnosis result judgment library module is used for setting fault recovery conditions and judging recovery results;
and the post-processing library module is used for recovering the test environment.
Preferably, before executing step S1, the method further includes a process of preprocessing the test requirement, specifically including:
a1, building and storing a plurality of universal function libraries according to test requirements, wherein each universal function library is associated with a plurality of diagnosis items;
step A2, extracting and storing second test parameters corresponding to the universal function library of each diagnostic item from the test requirements respectively;
in step S1, the failure and diagnosis result determination library module of each diagnosis item and the diagnosis test library corresponding to the failure recovery and diagnosis result determination library module are written according to the general function library and the corresponding second test parameters.
Preferably, the automated testing framework further comprises an interface parameter library module, which is used for extracting all signal interfaces of the pre-processing library module, the fault and diagnosis result determination library module, the diagnosis processing library module, the fault recovery and diagnosis result determination library module and the post-processing library module, and defining the mapping relationship among the signal interfaces.
Preferably, after the step S3 is executed, a diagnosis execution process is further included, which specifically includes:
and adding the diagnostic test case of each diagnostic item into a diagnostic test sequence, and sequentially executing each diagnostic test case in the diagnostic test sequence to finish the automatic diagnostic test.
Preferably, after the diagnostic execution process is executed, the method further includes:
generating an automated diagnostic test report after the automated diagnostic test is completed.
The technical scheme has the following advantages or beneficial effects:
1) by adopting a structured and decoupled test framework, the maintenance cost of the automatic test script is effectively reduced, and the test efficiency and expandability of the automatic test are improved;
2) the test case has high reusability, coverage and expandability.
Drawings
FIG. 1 is a schematic diagram of an automated diagnostic test case generation system according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a diagnostic test library corresponding to the preprocessing library module in the embodiment of the present application;
fig. 3 is a schematic structural diagram of a diagnostic test library corresponding to the failure and diagnostic result determination library module in the embodiment of the present application;
FIG. 4 is a schematic structural diagram of a diagnostic test library corresponding to the diagnostic processing library module in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a diagnostic test library corresponding to the failure recovery and diagnostic result determination library module in the embodiment of the present application;
FIG. 6 is a schematic structural diagram of a diagnostic test library corresponding to the post-processing library module in the embodiment of the present application;
fig. 7 is a schematic structural diagram of an interface parameter library module in an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a parameter extraction unit according to an embodiment of the present application;
FIG. 9 is a schematic illustration of a list of diagnostic tests in an embodiment of the present application;
FIG. 10 is a flowchart illustrating a method for automated diagnostic test case generation, according to an embodiment of the present disclosure;
fig. 11 is a flowchart illustrating a process of preprocessing a test requirement according to an embodiment of the present application.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. The present invention is not limited to the embodiment, and other embodiments may be included in the scope of the present invention as long as the gist of the present invention is satisfied.
The subject matter of the present application is to reduce the maintenance cost of an automated test script when performing an automated test, and the specific technical means provided below are all examples for implementing the subject matter of the present application, and it can be understood that, in the case of no conflict, the embodiments and technical features in the embodiments can be combined with each other. Also, the scope of protection of the present application should not be limited by the examples used to illustrate the feasibility of the present application.
In a preferred embodiment of the present application, based on the above problems in the prior art, an automated diagnostic test case generation system is provided, as shown in fig. 1, specifically including:
the framework building unit 1 is used for building an automatic test framework and compiling a diagnosis test library according to the automatic test framework and test requirements;
a parameter extraction unit 2, for extracting a group of first test parameters of each diagnostic item from the test requirements, wherein each group of first test parameters is associated with a plurality of diagnostic test libraries;
and the case generating unit 3 is respectively connected with the framework constructing unit 1 and the parameter extracting unit 2 and used for compiling an automatic test script according to the automatic test framework and respectively calling the diagnostic test libraries related to the first test parameters of each group by adopting the automatic test script to generate the diagnostic test cases of the diagnostic items.
In a preferred embodiment, the test requirement is a basic basis for the automated test, and taking the vehicle controller as an example of a diagnostic test object, before performing the automated test on the vehicle controller, the test requirement of the vehicle controller needs to be obtained first, where the test requirement includes each diagnostic item that the vehicle controller needs to test, and a specific description of a test condition, a test parameter, an expected test result, and the like of each diagnostic item.
As a preferred embodiment, as shown in fig. 2 to fig. 7, the test requirement and the constructed automated test framework are the basis for writing the diagnostic test library, and the automated test framework includes the following components in sequence according to the test execution order:
a pre-processing library module 100 for setting the testing environment;
a failure and diagnosis result determination library module 200 for performing failure condition setting and failure diagnosis determination;
a diagnosis processing library module 300 for setting and judging the action to be executed under the fault condition;
a failure recovery and diagnosis result determination library module 400 for performing failure recovery condition setting and recovery result determination;
a post-processing library module 500 for performing test environment recovery.
Specifically, in this embodiment, the pre-processing library module 100, the diagnosis processing library module 300, and the post-processing module 500 are general library modules, each diagnosis item needs to be provided with each general library module, that is, the test frame is general, and only corresponding parameter adjustment needs to be performed for different diagnosis items, in other words, when the diagnosis test library is compiled, only a general test library corresponding to each general library module needs to be compiled, and when each subsequent diagnosis item performs diagnosis test case generation, corresponding parameter calling is performed according to the general test library, and it is not necessary to compile a diagnosis test library for each general library module of each diagnosis item.
The failure and diagnosis result determination library module 200 and the failure recovery and diagnosis result determination library module 400 are differentiated library modules, and different diagnosis items correspond to different differentiated library modules. When the test requirement is updated, such as the test conditions, the test parameters, the expected test results and the like of the diagnosis items in the test requirement are updated or new diagnosis items are added in the test requirement, for the automatic script generated according to the automatic test framework, due to the universality of all the universal library modules, the structured and decoupled automatic test framework is adopted, only the differential library modules need to be maintained, the test case reusability is high, the coverage degree and the expandability are high, and the script maintenance cost brought by the update of the test requirement is greatly reduced.
As a preferred embodiment, in order to implement the parameter calling, a parameter extraction unit 2 is arranged to respectively extract a group of first test parameters of each diagnostic item from the test requirements, and each group of first test parameters is associated with a plurality of diagnostic test libraries; and the first test parameters of each group are used as called parameters.
As a preferred embodiment, as shown in fig. 8, the parameter extraction unit 2 may include a parameter storage module 21 for storing each first test parameter, and in the parameter storage module 21, a set of first test parameters of each diagnostic item extracted from the test requirement may be stored in the form of a diagnostic test list. As a preferred embodiment, the first test parameter includes an equipment operation mode corresponding to each diagnostic item, a fault code, and a fault level to be reported when the fault code occurs in the equipment operation mode.
In the above diagnostic test list, the device operation modes, which may be expanded based on different test item requirements, may be stored as rows of the diagnostic test list, respectively, Mode1, Mode2, Mode3, Mode4, Mode5, etc.; storing fault codes dtc (diagnostic Trouble code) as columns in a diagnostic test list, such as 160001, 160002, 160003, 160004, 160184, 160185, etc. in fig. 9; the intersection of the rows and the columns in the diagnostic test list is a fault level that the vehicle controller should report when a fault code of the row occurs in the equipment operation Mode of the row, for example, the test parameter 6 in the first row and the first column indicates that the vehicle controller should report the fault level 6 when the vehicle controller generates 160001 fault codes in the Mode 1. In fig. 9, the fault levels are indicated by the numbers 1-8, where the fault level X indicates that the vehicle controller is not performing or is not diagnosing the fault item in the device operating mode.
As a preferred embodiment, taking a vehicle controller as an example of a diagnostic test object, according to a test execution sequence, before each diagnostic item of the vehicle controller is tested, a test environment of the diagnostic item needs to be set, in this embodiment, the setting of the test environment is implemented by setting a pre-processing library module 100, and when writing a diagnostic test library corresponding to the pre-processing module 100, the diagnostic test library corresponding to the pre-processing library module 100 may include:
a first sub-module 101 for determining whether the testing environment is in a non-barrier state, and ensuring that the corresponding testing environment is in the non-barrier state before each diagnostic item is subjected to the diagnostic test;
a second sub-module 102, configured to set the device operation mode in the first test parameter, where the device operation mode can be set by calling the diagnostic test list.
As a preferred embodiment, after the test environment setting, the automated test framework sequentially sets the fault and diagnosis result determination library module 200, and the corresponding diagnosis test library includes:
a third sub-module 201, configured to set a fault detection enabling condition, a trigger condition of a fault code in the first test parameter, and a setting condition of the fault code;
and a fourth sub-module 202 connected to the third sub-module 201 for determining whether the fault code is asserted when the fault detection enable condition, the trigger condition and the assertion condition are satisfied.
In the above embodiment, after it is determined that the vehicle controller can normally operate, the failure and diagnosis result determination needs to be performed, that is, a corresponding failure result should be given by the vehicle controller according to the requirement in the test requirement under the preset test condition, and then the preset test condition is simulated, so as to determine whether the failure result given by the vehicle controller under the preset test condition is consistent with the test requirement. The diagnosis item is taken as an example of the single under-voltage fault for explanation: the preset test conditions comprise fault monitoring enabling conditions, namely the test environment can realize the monitoring of the cell voltage, and fault code triggering conditions, a voltage threshold may be set such that a monitored cell voltage triggers a cell under-voltage fault when less than the voltage threshold, and a fault code set condition, a fault duration threshold may be set, when the duration of triggering the single under-voltage fault is greater than the fault duration threshold, setting a fault code corresponding to the single under-voltage fault, and after the preset test condition is set, the diagnosis test of the single under-voltage fault of the vehicle controller can be carried out, namely whether the vehicle controller can finally set the fault code corresponding to the single under-voltage fault when the preset test conditions are met is detected, if the fault code can be set, the test is passed, and if the fault code cannot be set, the test is not passed.
As a preferred embodiment, after the fault and fault diagnosis test, a diagnosis processing library module 300 may be further provided in the automated test framework to test whether the vehicle controller can perform the expected corresponding action under the current fault code, and the diagnosis test library corresponding to the diagnosis processing library module 300 may include:
a fifth sub-module 301, configured to set an action to be executed under each fault level in the first test parameter;
a sixth sub-module 302, connected to the fifth sub-module 301, for determining whether the actual execution action is consistent with the corresponding action to be executed under the fault level.
In particular, in the above embodiments, when the vehicle controller has a corresponding fault code, the test requirement usually requires that the vehicle controller can give a corresponding diagnosis process, such as power limitation, power reduction rate and other fault level recovery strategies under different fault levels. Similarly, the diagnostic test library corresponding to the diagnostic processing library module 300 defines the actions to be executed by the vehicle controller under different failure levels, and when performing diagnostic processing, it needs to detect whether the diagnostic processing measures actually given by the vehicle controller are consistent with the actions to be executed, if so, it indicates that the diagnostic processing test is passed, and if not, it indicates that the diagnostic processing test is not passed.
As a preferred embodiment, after the diagnosis processing test, a fault recovery and diagnosis result determination library module 400 may be further provided in the automated test framework to test whether the fault of the vehicle controller can be recovered by itself when the fault recovery condition is satisfied, and the diagnosis test library corresponding to the fault recovery and diagnosis result determination library module 400 includes:
a seventh sub-module 401, configured to set recovery conditions for the fault codes in the first test parameters;
an eighth sub-module 402, connected to the seventh sub-module 401, for determining whether the fault is set to recovery when the recovery condition is satisfied.
Specifically, in the above embodiment, the vehicle controller is taken as an example of a diagnostic test object, and after a corresponding fault code occurs in a vehicle, it is further required to detect whether the vehicle controller can recover by itself when the fault code recovery condition is satisfied, so that the fault code recovery condition is set in the diagnostic test library corresponding to the fault recovery and diagnostic result determination library module 400, and when the fault recovery and diagnostic result determination is performed, it is required to detect whether the vehicle controller can set the fault as recovery when the fault code recovery condition is satisfied, if the vehicle controller can set the fault as recovery, it is described that the fault recovery and diagnostic result determination test is passed, and if the vehicle controller cannot set the fault as recovery, it is described that the fault recovery and diagnostic result determination test is not passed.
In a preferred embodiment, the diagnostic test library corresponding to the post-processing library module 50 in the automated test framework includes a ninth sub-module 501 for restoring the test environment to a fault-free state.
Specifically, in the above embodiment, after the test of each diagnostic item is completed, the test environment needs to be restored to a fault-free state, so as to facilitate the test process of other subsequent diagnostic items.
As a preferred embodiment, the system further comprises a preprocessing unit 4 connected with the frame building unit 1, wherein the preprocessing unit 4 comprises:
a first storage module 41, configured to build and store a plurality of general function libraries according to test requirements, where each general function library is associated with a plurality of diagnostic items;
a second storage module 42, connected to the first storage module 41, for extracting and storing second test parameters corresponding to the generic function library of each diagnostic item from the test requirements;
the framework construction unit 1 writes a fault and diagnosis result judgment library module of each diagnosis item and a diagnosis test library corresponding to the fault recovery and diagnosis result judgment library module respectively according to the general function library and the corresponding second test parameters.
Specifically, in the above embodiment, the number of diagnostic items in the test requirements acquired in advance may reach several hundred or even more, and by constructing the general function library and extracting the corresponding second test parameters for respective storage, when the diagnostic test libraries corresponding to the fault and diagnostic result determination library module and the fault recovery and diagnostic result determination library module of each diagnostic item are compiled, it is not necessary to compile each diagnostic item respectively, and only the general function library needs to be compiled in a unified manner, and then the diagnostic test libraries are formed by calling the corresponding second test parameters, so that the compiling number of the diagnostic test libraries can be effectively reduced, and further the maintenance cost is reduced. Taking a vehicle controller as an example of a diagnosis test object, taking a test variable as a monomer voltage, the test requirement can comprise six diagnosis items of monomer under-voltage level 1, monomer under-voltage level 2, monomer under-voltage level 3, monomer under-voltage level 4, monomer voltage sampling over-range high and monomer voltage sampling over-range low, the same judgment functions are adopted from the monomer under-voltage level 1 to the monomer under-voltage level 4, only the corresponding judgment thresholds are different, the same judgment functions are adopted from the monomer voltage sampling over-range high and the monomer voltage sampling over-range low, only the corresponding judgment thresholds are different, therefore, through the establishment of a general function library, the four diagnosis items of the monomer under-voltage level 1, the monomer under-voltage level 2, the monomer under-voltage level 3 and the monomer under-voltage level 4 can adopt the same judgment function as the general function library, the general function library is used for judging monomer under-voltage faults, the monomer voltage sampling over-range high and the monomer voltage sampling over-range low adopt the same judgment function as the And the universal function library is used for judging the single voltage sampling out-of-range fault, and reduces the diagnosis test library of diagnosis items to two items, so that the maintenance cost can be reduced.
As a preferred embodiment, the automated testing framework further includes an interface parameter library module 600, which is used to extract all signal interfaces of the pre-processing library module 100, the fault and diagnosis result determination library module 200, the diagnosis processing library module 300, the fault recovery and diagnosis result determination library module 400 and the post-processing library module 500, and define the mapping relationship between the signal interfaces.
Specifically, in the foregoing embodiment, for different diagnostic items, due to different test requirements of each diagnostic item, the output signals are of various types, and by extracting all signal interfaces and defining the mapping relationship between the signal interfaces, data compatibility and normal data transmission are ensured.
As a preferred embodiment, the system further comprises a sequence generating unit 5 connected to the case generating unit 3, for adding the diagnostic test case of each diagnostic item into a diagnostic test sequence, and sequentially executing each diagnostic test case in the diagnostic test sequence to complete the automated diagnostic test.
In a preferred embodiment, the test system further comprises a report generating unit 6 connected to the sequence generating unit 5 for generating an automated diagnostic test report after the automated diagnostic test is completed.
Also provided is an automated diagnostic test case generation method, as shown in fig. 10, including the following steps:
s1, constructing an automatic test framework, and compiling a diagnosis test library according to the automatic test framework and test requirements;
step S2, a group of first test parameters of each diagnosis item are respectively extracted from the test requirements, and each group of first test parameters is associated with a plurality of diagnosis test libraries;
and step S3, compiling an automatic test script according to the automatic test framework, and calling the diagnosis test libraries associated with the first test parameters of each group respectively by using the automatic test script to generate the diagnosis test cases of each diagnosis item.
In a preferred embodiment, in step S1, the automated testing framework includes, in order of test execution:
a pretreatment library module for setting a test environment;
the fault and diagnosis result judgment library module is used for setting fault conditions and judging fault diagnosis;
the diagnosis processing library module is used for setting and judging the action to be executed under the fault condition;
the fault recovery and diagnosis result judgment library module is used for setting fault recovery conditions and judging recovery results;
and the post-processing library module is used for recovering the test environment.
As a preferred embodiment, before executing step S1, the method further includes a process of preprocessing the test requirement, as shown in fig. 11, specifically including:
a1, building and storing a plurality of universal function libraries according to test requirements, wherein each universal function library is associated with a plurality of diagnosis items;
step A2, extracting and storing second test parameters corresponding to the universal function library of each diagnosis item from the test requirements;
in step S1, the fault and diagnosis result determination library module of each diagnosis item and the diagnosis test library corresponding to the fault recovery and diagnosis result determination library module are written according to the general function library and the corresponding second test parameters.
As a preferred embodiment, the automated testing framework further includes an interface parameter library module, which is used to extract all signal interfaces of the pre-processing library module, the fault and diagnosis result determination library module, the diagnosis processing library module, the fault recovery and diagnosis result determination library module and the post-processing library module, and define the mapping relationship between the signal interfaces.
Specifically, in the above embodiment, for different diagnostic items, because the test method of each diagnostic item is different, the types of output signals are various, and by extracting all signal interfaces and defining the mapping relationship between the signal interfaces, the compatibility of data and the normal transmission of data are ensured.
As a preferred embodiment, after the step S3 is executed, a diagnosis execution process is further included, which specifically includes:
and adding the diagnostic test case of each diagnostic item into a diagnostic test sequence, and sequentially executing each diagnostic test case in the diagnostic test sequence to finish the automatic diagnostic test.
As a preferred embodiment, after the diagnostic execution process is executed, the method further includes:
and generating an automated diagnostic test report after the automated diagnostic test is completed.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.

Claims (18)

1. An automated diagnostic test case generation system is characterized by specifically comprising:
the framework construction unit is used for constructing an automatic test framework and compiling a diagnosis test library according to the automatic test framework and test requirements;
a parameter extraction unit, configured to extract a set of first test parameters of each diagnostic item from the test requirement, where each set of first test parameters is associated with a plurality of diagnostic test libraries;
and the case generating unit is respectively connected with the framework constructing unit and the parameter extracting unit and used for compiling an automatic test script according to the automatic test framework and respectively calling the diagnostic test library associated with each group of the first test parameters by adopting the automatic test script to generate the diagnostic test case of each diagnostic item.
2. The automated diagnostic test case generation system of claim 1, wherein the automated test framework comprises, in order of test execution:
a pretreatment library module for setting a test environment;
the fault and diagnosis result judgment library module is used for setting fault conditions and judging fault diagnosis;
the diagnosis processing library module is used for setting and judging the action to be executed under the fault condition;
the fault recovery and diagnosis result judgment library module is used for setting fault recovery conditions and judging recovery results;
and the post-processing library module is used for recovering the test environment.
3. The automated diagnostic test case generation system of claim 2, further comprising a preprocessing unit coupled to the framework building unit, the preprocessing unit comprising:
the first storage module is used for building and storing a plurality of universal function libraries according to test requirements, and each universal function library is associated with a plurality of diagnosis items;
the second storage module is connected with the first storage module and used for extracting and storing second test parameters, corresponding to the universal function library, of each diagnosis item from the test requirements;
and the framework construction unit writes the fault and diagnosis result judgment library module of each diagnosis item and the diagnosis test library corresponding to the fault recovery and diagnosis result judgment library module respectively according to the universal function library and the corresponding second test parameters.
4. The automated diagnostic test case generation system of claim 2, wherein the automated test framework further comprises an interface parameter library module for extracting all signal interfaces of the pre-processing library module, the fault and diagnostic result determination library module, the diagnostic processing library module, the fault recovery and diagnostic result determination library module, and the post-processing library module, and defining a mapping relationship between the signal interfaces.
5. The automated diagnostic test case generation system of claim 2, wherein the first test parameters include a device operation mode corresponding to each diagnostic item, a fault code, and a fault level to be reported when the fault code occurs in the device operation mode.
6. The automated diagnostic test case generation system of claim 5, wherein in the automated test framework, the diagnostic test library corresponding to the preprocessing library module comprises:
a first sub-module for determining whether the testing environment is in an unobstructed state;
and the second submodule is used for setting the equipment operation mode in the first test parameter.
7. The automated diagnostic test case generation system of claim 5, wherein the diagnostic test library corresponding to the failure and diagnostic result determination library module in the automated test framework comprises:
a third sub-module, configured to set a fault detection enabling condition, a trigger condition of the fault code in the first test parameter, and a setting condition of the fault code;
and the fourth submodule is connected with the third submodule and used for judging whether the fault code is put out when the fault detection enabling condition, the triggering condition and the putting-out condition are met simultaneously.
8. The automated diagnostic test case generation system of claim 5, wherein the diagnostic test library corresponding to the diagnostic processing library module in the automated test framework comprises:
a fifth sub-module, configured to set an action to be executed under each of the failure levels in the first test parameter;
and the sixth submodule is connected with the fifth submodule and used for judging whether the actual execution action is consistent with the corresponding action to be executed under the fault level.
9. The automated diagnostic test case generation system of claim 5, wherein the diagnostic test library corresponding to the failure recovery and diagnostic result determination library module in the automated test framework comprises:
a seventh sub-module for setting recovery conditions of the fault code in the first test parameter;
and the eighth submodule is connected with the seventh submodule and used for judging whether the fault is set to be recovered or not when the recovery condition is met.
10. The automated diagnostic test case generation system of claim 5, wherein the diagnostic test library corresponding to the post-processing library module in the automated test framework comprises a ninth sub-module for restoring the test environment to a non-failure state.
11. The system according to claim 1, further comprising a sequence generation unit, connected to the case generation unit, for adding the diagnostic test case of each diagnostic item to a diagnostic test sequence, and sequentially executing each diagnostic test case in the diagnostic test sequence to complete an automated diagnostic test.
12. The automated diagnostic test case generation system of claim 11, further comprising a report generation unit coupled to the sequence generation unit for generating an automated diagnostic test report after the automated diagnostic test is completed.
13. An automatic diagnosis test case generation method is characterized by comprising the following steps:
s1, constructing an automatic test framework, and compiling a diagnosis test library according to the automatic test framework and the test requirements;
step S2, a group of first test parameters of each diagnosis item is respectively extracted from the test requirements, and each group of first test parameters is associated with a plurality of diagnosis test libraries;
and step S3, compiling an automatic test script according to the automatic test framework, and calling the diagnosis test library associated with each group of the first test parameters respectively by using the automatic test script to generate a diagnosis test case of each diagnosis item.
14. The method for generating the test case for the automated diagnosis of claim 13, wherein in step S1, the automated test framework comprises, in order of test execution:
a pretreatment library module for setting a test environment;
the fault and diagnosis result judgment library module is used for setting fault conditions and judging fault diagnosis;
the diagnosis processing library module is used for setting and judging the action to be executed under the fault condition;
the fault recovery and diagnosis result judgment library module is used for setting fault recovery conditions and judging recovery results;
and the post-processing library module is used for recovering the test environment.
15. The method for generating the test case for the automated diagnosis according to claim 14, wherein before the step S1 is executed, the method further includes a process of preprocessing a test requirement, specifically including:
a1, building and storing a plurality of universal function libraries according to test requirements, wherein each universal function library is associated with a plurality of diagnosis items;
step A2, extracting and storing second test parameters corresponding to the universal function library of each diagnostic item from the test requirements respectively;
in step S1, the failure and diagnosis result determination library module of each diagnosis item and the diagnosis test library corresponding to the failure recovery and diagnosis result determination library module are written according to the general function library and the corresponding second test parameters.
16. The method for generating the automatic diagnostic test case according to claim 14, wherein the automatic test framework further comprises an interface parameter library module for extracting all signal interfaces of the pre-processing library module, the fault and diagnostic result determination library module, the diagnostic processing library module, the fault recovery and diagnostic result determination library module, and the post-processing library module, and defining a mapping relationship between the signal interfaces.
17. The method for generating the automated diagnostic test case according to claim 13, wherein the step S3 is executed and then further includes a diagnostic execution process, specifically including:
and adding the diagnostic test case of each diagnostic item into a diagnostic test sequence, and sequentially executing each diagnostic test case in the diagnostic test sequence to finish the automatic diagnostic test.
18. The method for generating test cases for automated diagnosis according to claim 17, wherein after executing the diagnosis execution process, the method further comprises:
generating an automated diagnostic test report after the automated diagnostic test is completed.
CN202010924363.XA 2020-09-04 2020-09-04 Automatic diagnosis test case generation system and method Active CN111983998B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010924363.XA CN111983998B (en) 2020-09-04 2020-09-04 Automatic diagnosis test case generation system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010924363.XA CN111983998B (en) 2020-09-04 2020-09-04 Automatic diagnosis test case generation system and method

Publications (2)

Publication Number Publication Date
CN111983998A true CN111983998A (en) 2020-11-24
CN111983998B CN111983998B (en) 2021-11-30

Family

ID=73447748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010924363.XA Active CN111983998B (en) 2020-09-04 2020-09-04 Automatic diagnosis test case generation system and method

Country Status (1)

Country Link
CN (1) CN111983998B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5003477A (en) * 1988-02-18 1991-03-26 Fuji Jukogyo Kabushiki Kaisha Diagnosis system for a motor vehicle
US5629878A (en) * 1993-10-07 1997-05-13 International Business Machines Corporation Test planning and execution models for generating non-redundant test modules for testing a computer system
CN1877543A (en) * 2005-06-06 2006-12-13 华为技术有限公司 Data-driven automatic testing system and method
CN104483959A (en) * 2014-11-04 2015-04-01 普华基础软件股份有限公司 Fault simulation and test system
CN104865948A (en) * 2014-12-19 2015-08-26 北汽福田汽车股份有限公司 Automatic vehicle controller diagnosing device and method
CN105068927A (en) * 2015-08-04 2015-11-18 株洲南车时代电气股份有限公司 Keyword drive-based automatic test method of urban rail drive control units
CN107450515A (en) * 2017-07-31 2017-12-08 北京新能源汽车股份有限公司 Fault diagnosis automatic test approach and device
CN108845940A (en) * 2018-06-14 2018-11-20 云南电网有限责任公司信息中心 A kind of enterprise information system automated function test method and system
CN109117369A (en) * 2018-08-01 2019-01-01 北京长城华冠汽车技术开发有限公司 Method for generating test case executes method and device
US20190146472A1 (en) * 2016-05-09 2019-05-16 Strong Force Iot Portfolio 2016, Llc Systems and methods for enabling user selection of components for data collection in an industrial environment
CN110781069A (en) * 2019-08-28 2020-02-11 腾讯科技(深圳)有限公司 Positioning module testing method, device and equipment for automatic driving vehicle

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5003477A (en) * 1988-02-18 1991-03-26 Fuji Jukogyo Kabushiki Kaisha Diagnosis system for a motor vehicle
US5629878A (en) * 1993-10-07 1997-05-13 International Business Machines Corporation Test planning and execution models for generating non-redundant test modules for testing a computer system
CN1877543A (en) * 2005-06-06 2006-12-13 华为技术有限公司 Data-driven automatic testing system and method
CN104483959A (en) * 2014-11-04 2015-04-01 普华基础软件股份有限公司 Fault simulation and test system
CN104865948A (en) * 2014-12-19 2015-08-26 北汽福田汽车股份有限公司 Automatic vehicle controller diagnosing device and method
CN105068927A (en) * 2015-08-04 2015-11-18 株洲南车时代电气股份有限公司 Keyword drive-based automatic test method of urban rail drive control units
US20190146472A1 (en) * 2016-05-09 2019-05-16 Strong Force Iot Portfolio 2016, Llc Systems and methods for enabling user selection of components for data collection in an industrial environment
CN107450515A (en) * 2017-07-31 2017-12-08 北京新能源汽车股份有限公司 Fault diagnosis automatic test approach and device
CN108845940A (en) * 2018-06-14 2018-11-20 云南电网有限责任公司信息中心 A kind of enterprise information system automated function test method and system
CN109117369A (en) * 2018-08-01 2019-01-01 北京长城华冠汽车技术开发有限公司 Method for generating test case executes method and device
CN110781069A (en) * 2019-08-28 2020-02-11 腾讯科技(深圳)有限公司 Positioning module testing method, device and equipment for automatic driving vehicle

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHIBO PANG: "《Location aided commissioning of building automation devices enabled by high accuracy indoor positioning》", 《JOURNAL OF INDUSTRIAL INFORMATION INTEGRATION》 *
王邵龙: "《从节点丢失故障码的误报浅谈故障码的测试》", 《汽车电器》 *

Also Published As

Publication number Publication date
CN111983998B (en) 2021-11-30

Similar Documents

Publication Publication Date Title
CN109240277B (en) Control system diagnosis function real vehicle test automation platform and test method
Ramirez-Trevino et al. Structural diagnosability of DES and design of reduced Petri net diagnosers
CN102707712B (en) Electronic equipment fault diagnosis method and system
CN103163398A (en) System and method of nuclear power station Berea panel reliability detection
US20110125302A1 (en) Method and system for formal safety verification of manufacturing automation systems
CN107516546B (en) Online detection device and method for random access memory
CN111983998B (en) Automatic diagnosis test case generation system and method
Cabasino et al. A comparison among tools for the diagnosability of discrete event systems
CN105653455A (en) Program vulnerability detection method and detection system
CN107797540B (en) Transmission fault testing method and device and terminal
CN116107794B (en) Ship software fault automatic diagnosis method, system and storage medium
CN108594051B (en) Automatic detection method and system for electrical equipment fault
CN114062806B (en) Vehicle testing method and device
CN111830935A (en) Metamorphic test method for automatic driving system
KR20210031179A (en) System for predicting engine failure using big data
CN114898174A (en) Cable fault recognition system based on different recognition models
Hu et al. Active diagnosis of Petri nets using Q-diagnoser
CN111552263B (en) Method, computer-readable storage medium and system for inspecting industrial facilities
CN114338451A (en) Controller local area network bus test system, method and storage medium
KR20220048233A (en) Method for detecting abnomal event and apparatus implementing the same method
CN114595143B (en) Embedded test credibility detection and verification method and system for aviation communication electronic system
CN112433947A (en) Chaos engineering method and system based on network data
CN102426332A (en) Fault removal method for multi-signal flow graph
Kum et al. Automated testing for automotive embedded systems
Simeu-Abazi et al. Fault diagnosis method for timed discrete-event systems: Application to autonomous electric vehicle

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
GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20240222

Granted publication date: 20211130

PP01 Preservation of patent right