Signal-oriented automatic test implementation method
Technical Field
The invention relates to a signal-oriented automatic test implementation method, and belongs to the technical field of test measurement.
Background
With the increasing complexity of modern equipment, automatic test systems play an increasingly important role in the development, production and maintenance security processes of the equipment. The Test Program Set (TPS) of the automatic test system is instrument-oriented for a long time in the past, test software is compiled aiming at the drive of the instrument, so that the test software is tightly coupled with the specific instrument and only can run on a specific hardware platform and is difficult to transplant, the development cost of the software is increased, the software architecture does not support the instrument exchange, the types and the number of spare parts are greatly increased, and the running and maintenance cost of the automatic test system cannot be effectively reduced.
In order to solve the problems of poor universality, low portability and poor instrument interchangeability of an instrument-oriented test program set, a signal-oriented test idea is provided in the industry, a signal is used for describing test requirements and test resources, the signal is the key of the whole test system, developers only need to consider the type of signal measurement and compile test cases by taking the signal as an object, and the test cases are not changed due to the change of a hardware platform. Therefore, the signal-oriented automatic test method is designed, the software development efficiency of the automatic test system can be obviously improved, and the operation and maintenance cost is reduced.
Disclosure of Invention
The invention aims to provide a signal-oriented automatic test implementation method, which is used for realizing the transportability and good universality of a test program set and reducing the development, operation and maintenance costs of an automatic test system.
The technical scheme of the invention is as follows:
the signal-oriented automatic test implementation method is characterized in that: the method comprises the following steps:
step 1: modeling a signal of an automatic test system, extracting a signal attribute, storing by applying an XML element, and generating a signal library in an XML format;
step 2: modeling elements of the automatic test system, storing modeling information by applying XML elements which accord with ATML standards, and generating a test element model library in an XML format; the elements comprise a test instrument, a test platform, an adapter and a UUT;
and step 3: describing the test requirement of the UUT based on the signal to generate a test case, and storing the test case information by using XML elements which accord with ATML standards;
and 4, step 4: packaging the drive of the test instrument into a uniform middleware;
and 5: and (3) calling corresponding signal models and test element models from the signal library established in the step (1) and the test element model library established in the step (2) according to test requirements, translating the signal models, the test element models and the test cases in the step (3) into test programs executable by an operating system, calling the middleware packaged in the step (4), executing the test, generating test results, and storing the results as XML information to realize the sharing and fault diagnosis of the test results.
Further preferably, the method for implementing signal-oriented automatic testing is characterized in that: the signals in the step 1 comprise RS232, RS422, RS485, 1553B, ARINC429, FC, AFDX, CAN, 1394B, analog quantity input and output signals and discrete quantity input and output signals.
Further preferably, the method for implementing signal-oriented automatic testing is characterized in that: in step 2, the modeling process of the test instrument is as follows:
respectively defining the signal capability, the resources and the physical ports of the test instrument, and then completing the mapping from the signal capability to the resources and from the resources to the physical ports; storing the definition and mapping relation according to an XML element applied by an ATML standard;
the modeling process of the test platform is as follows:
defining an ICA end of a test platform, and then mapping the wiring relation in the test platform, wherein the mapping comprises mapping between physical ports of various test instruments working in the test platform and mapping between the test instruments and the ICA end; storing the definition and mapping relation according to an XML element applied by an ATML standard;
the modeling process of the adapter is as follows:
port information of two ends of the adapter is defined, wherein one end is an ITA end connected with the test platform, and the other end is a cable end connected with the UUT; then mapping the physical port connection relation of the two ends of the adapter; storing the definition and mapping relation according to an XML element applied by an ATML standard;
the modeling process of the UUT is as follows:
and defining the physical port information of the UUT, and storing the definition by applying an XML element according to the ATML standard.
Further preferably, the method for implementing signal-oriented automatic testing is characterized in that: in step 3, when a certain UUT is tested, a plurality of corresponding test items are established for different functional tests of the UUT in the test case, each test item is composed of a plurality of test actions, and the test actions include establishing, connecting, changing, resetting, comparing, setting conditions, disconnecting, enabling, disabling, user inputting, displaying to a user, reading data, circulating, setting state variables or delaying.
Further preferably, the method for implementing signal-oriented automatic testing is characterized in that: in step 5, translating the test case to generate a class function, wherein the class function and the middleware form a mapping relation; and (4) carrying out serialization processing on the attributes, names, types and descriptions of the XML elements of the signals in the corresponding signal models, assigning the attributes, the names, the types and the descriptions to class functions, and automatically generating a test program.
Advantageous effects
The invention uses XML language to describe the test requirement of UUT, generates the test case, separates the test case from the concrete instrument hardware, effectively improves the portability of the test program and the interchangeability of the test instrument, and reduces the development and maintenance cost of the automatic test system.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a signal-oriented test methodology implementation;
FIG. 2 is an instrument modeling map;
fig. 3 is a schematic diagram of a test link.
Detailed Description
The invention aims to provide a signal-oriented automatic test implementation method, which is used for realizing the transportability and good universality of a test program set and reducing the development, operation and maintenance costs of an automatic test system. The basic principle is that firstly, a signal and a test element of an automatic test system are modeled, then, the test requirement of a tested object (UUT) is described, a test case is generated, finally, the test case is translated into an executable test program, and the drive of an instrument is called to complete the test.
The specific method steps are given below with reference to the attached drawings:
step 1: for signals commonly used in automatic test systems: RS232, RS422, RS485, 1553B, ARINC429, FC, AFDX, CAN, 1394B, analog input and output, discrete input and output and other signals are modeled, signal attributes are extracted, XML elements are used for storage, and a signal library in an XML format is generated. For example, the properties of the RS422 bus signal include: data, baud rate, data bits, parity bits, stop bits, flow control, data repetition period, and the number of repetitions of transmitted data.
Step 2: modeling elements of the automatic test system, storing modeling information by applying XML elements which accord with ATML standards, and generating a test element model library in an XML format; the elements comprise a testing instrument, a testing platform, an adapter and a UUT, and the modeling is respectively as follows:
the modeling process of the test instrument is as follows:
respectively defining the signal capability, resources and physical ports of a test instrument, wherein the capability refers to functions of the instrument, if a DA board card is used, the capability is an analog quantity output function, the resources refer to the number of channels of the capability of the instrument, and the physical ports refer to external physical ports of the instrument and comprise ports, connectors and contacts; then, mapping from the signal capability to the resource and from the resource to the physical port is completed; storing the definition and mapping relation according to an XML element applied by an ATML standard; the instrument modeling mapping is shown in FIG. 2.
The modeling process of the test platform is as follows:
defining an ICA end of the test platform, wherein the instrument works in the test platform, and information related to the instrument directly refers to instrument modeling content; then mapping the wiring relation in the test platform, wherein the mapping comprises mapping between physical ports of all test instruments working in the test platform and mapping between the test instruments and an ICA (independent component analysis) end; and applying XML elements to store the definitions and the mapping relations according to the ATML standard.
The modeling process of the adapter is as follows:
port information of two ends of the adapter is defined, wherein one end is an ITA end connected with the test platform, and the other end is a cable end connected with the UUT; then mapping the physical port connection relation of the two ends of the adapter; and applying XML elements to store the definitions and the mapping relations according to the ATML standard.
The modeling process of the UUT is as follows:
and defining the physical port information of the UUT, and storing the definition by applying an XML element according to the ATML standard.
Through the process, the modeling of the test element stores the complete information of a test link (instrument-test station ICA end-adapter ITA end-adapter cable end-UUT end). Because the description of the test requirement is directed to the UUT, but the excitation or measurement is performed by the instrument, with the above-mentioned complete link, the excitation or measurement operation of the UUT by the instrument can be completed only when the automatic test program parses the test description information. The test link is schematically shown in fig. 3.
And step 3: describing the test requirement of the UUT based on the signal to generate a test case, and storing the test case information by using XML elements which accord with the ATML standard.
When a certain UUT is tested, a plurality of corresponding test items are established aiming at different functional tests of the UUT in a test case, each test item consists of a plurality of test actions, and the test actions comprise establishing, connecting, changing, resetting, comparing, setting conditions, disconnecting, enabling, forbidding, inputting by a user, displaying to the user, reading data, circulating, setting state variables or delaying and the like. For example, a simple test is performed by performing the operations of establishing, connecting, reading, disconnecting, and resetting, where the establishing operation assigns values to the UUT ports according to the signal attribute information defined in step 1, the connecting operation applies stimuli to the UUT ports, the reading operation measures signals at the designated UUT ports, the disconnecting operation removes signals from the UUT ports, and the resetting operation removes the definitions of the assignments to the signals. Applying these actions in combination can perform a variety of complex excitation and measurement functions.
And 4, step 4: and packaging the drive of the test instrument into a uniform middleware.
Uniformly defining a group of functions according to test instrument board cards of different manufacturers: and opening the board card function, the parameter initialization function, the data input function, the data output function, closing the board card function and the like, namely packaging the board card drive interface function into a uniform middleware. When the automatic test system is used for replacing test instrument board cards of different manufacturers, only the driver needs to be updated, the test cases are directly transplanted, and the test program does not need to be rewritten.
And 5: and (3) calling corresponding signal models and test element models from the signal library established in the step (1) and the test element model library established in the step (2) according to test requirements, translating the signal models, the test element models and the test cases in the step (3) into test programs executable by an operating system, calling the middleware packaged in the step (4), executing the test, generating test results, and storing the results as XML information to realize the sharing and fault diagnosis of the test results.
The test case is translated to generate a class function, and the class function and the middleware form a mapping relation; and (4) carrying out serialization processing on the attributes, names, types and descriptions of the XML elements of the signals in the corresponding signal models, assigning the attributes, the names, the types and the descriptions to class functions, and automatically generating a test program.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention.