Disclosure of Invention
The invention provides a testing method and a testing system for interlocking software, which can improve the automation of testing an interlocking system and improve the efficiency and accuracy of testing.
The invention provides a method for testing interlocking software, which comprises the following steps:
step S1, receiving a test instruction input by a user, wherein the test instruction is used for indicating the test content of the current test;
step S2, determining the test parameters needed for completing the test content;
and step S3, simulating the test parameters, and inputting the simulated test parameters into a parameter acquisition interface of the interlocking software.
Preferably, after step S3, the method further includes:
step S4, acquiring the output result of the interlocking software;
step S5, generating a test result according to the output result of the interlocking software;
and step S6, outputting the test result.
Preferably, the step S4 specifically includes:
acquiring an output signal of interlocking software, and taking the acquired output signal as an output result; or,
acquiring an output result of the physical device input by an output signal of interlocking software, and taking the output result of the physical device as the output result of the interlocking software; or,
and acquiring an output result of the simulation equipment input by an output signal of the interlocking software, and taking the output result of the simulation equipment as the output result of the interlocking software.
Preferably, before the step S6, the method further includes:
receiving a test expectation input by a user;
the step S6 specifically includes:
and comparing the test expectation input by the user with the output result of the interlocking software, and outputting the test result according to the comparison result.
Preferably, before the step S1, the method further includes:
receiving a test trigger instruction input by a user;
instructing the user to input a test instruction into a particular location in a test script;
the step S1 includes:
and receiving a test instruction input by a user at the specific position.
Preferably, the method is further used for testing hardware of the interlock system, and the method further includes:
receiving a hardware test instruction input by a user, wherein the hardware test instruction comprises a signal to be acquired by tested hardware;
calling corresponding tested hardware to acquire corresponding signals;
judging whether the tested hardware is normal or not according to the signal fed back by the tested hardware;
and outputting a judgment result.
The invention also provides an interlocking software testing system, which comprises:
the test instruction acquisition interface is used for receiving a test instruction input by a user, and the test instruction is used for indicating the test content of the current test;
the parameter determining module is used for determining the test parameters required by the test content;
and the parameter simulation module simulates the test parameters and inputs the simulated test parameters into a parameter acquisition interface of the interlocking software.
Preferably, the system further comprises:
the output result acquisition module is used for acquiring the output result of the interlocking software;
the test result generation module generates a test result according to the output result of the interlocking software;
and the feedback module is used for outputting the test result generated by the test result generation module.
Preferably, the output result acquisition module is specifically used for
Acquiring an output signal of interlocking software, and taking the acquired output signal as an output result; or,
acquiring an output result of the physical device input by an output signal of interlocking software, and taking the output result of the physical device as the output result of the interlocking software; or,
and acquiring an output result of the simulation equipment input by an output signal of the interlocking software, and taking the output result of the simulation equipment as the output result of the interlocking software.
Preferably, the system further comprises:
the test expectation acquisition module is used for receiving the test expectation input by the user;
the feedback module is specifically used for comparing the test expectation input by the book with the output result of the interlocking software and outputting the test result according to the comparison result.
Preferably, the system further comprises:
the trigger module is used for receiving a test trigger instruction input by a user;
the indicating module is used for indicating the user to input the test instruction to a specific position in the test script after the triggering module receives the test triggering instruction;
and the test instruction acquisition interface is specifically used for receiving a test instruction input by a user at the specific position.
Preferably, the test system is also used for testing the hardware of the interlocking system,
the test instruction acquisition interface is also used for receiving a hardware test instruction input by a user, wherein the hardware test instruction comprises a signal to be acquired by the tested hardware;
the calling module is also used for calling the corresponding tested hardware to acquire corresponding signals;
the test result generation module is also used for judging whether the tested hardware is normal according to the signal fed back by the tested hardware;
the feedback module is also used for outputting the judgment result of the test result generation module.
In the test method provided by the invention, after a test instruction input by a user is received, test parameters required by the test content are determined according to the test content indicated by the test instruction, then the test parameters are simulated, and the simulated test parameters are input into the interlocking software. Therefore, in the test process, the test system can automatically complete the input of the test parameters, and the automation degree of the test is improved. The burden of testing personnel is reduced, and the testing accuracy is improved.
Detailed Description
The following description of the embodiments of the present invention will be made with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
The invention provides a testing method of interlocking software, which is used for testing the interlocking software of an interlocking system and comprises the following steps of:
step 101, receiving a test instruction input by a user, wherein the test instruction is used for indicating test content of a current test.
Step 102, determining the test parameters needed for completing the test content.
And 103, simulating the test parameters, and inputting the simulated test parameters into a parameter acquisition interface of the interlocking software.
In the test method provided by the embodiment of the invention, after a test instruction input by a user is received, test parameters required by the test content are determined according to the test content indicated by the test instruction, then the test parameters are simulated, and the simulated test parameters are input into the interlocking software. Therefore, in the test process, the test system can automatically complete the input of the test parameters, and the automation degree of the test is improved. The burden of testing personnel is reduced, and the testing accuracy is improved.
In practical application, the corresponding relationship between the test content and the test parameters may be stored in the test device in advance, so that the test device can determine the required test parameters according to the test content in the test instruction after receiving the test instruction.
Preferably, the step 103 may also be replaced by inputting a simulated trigger signal into the local control system, so that the local control system inputs corresponding parameters to the parameter acquisition interface of the interlock software according to the simulated trigger signal.
On the basis of the first embodiment, the test method provided by the second embodiment of the present invention can also be shown in fig. 2, and includes:
step 201-step 203, and step 101-step 101.
And step 204, collecting an output result of the interlocking software.
And step 205, generating a test result according to the output result of the interlocking software.
And step 206, outputting a test result.
In step 205, there may be a plurality of ways to generate the test result according to the output result, for example, a corresponding curve is generated according to the output signal in the output result, and the curve is output as the output test result, or the signals collected at each sampling point are derived as a table and output, and the specific adoption of the deteriorated town south relationship way does not affect the protection scope of the present invention.
By the method, the test system can automatically output the test result, the burden of data analysis of testers is reduced, and the test efficiency is further improved.
Preferably, step 204 may be implemented by one of the following ways:
in the mode (a), the output signal of the interlocking software is collected, and the collected output signal is used as the output result.
And (b) acquiring an output result of the physical device input by the output signal of the interlocking software, and taking the output result of the physical device as the output result of the interlocking software.
And (c) acquiring an output result of the simulation equipment input by the output signal of the interlocking software, and taking the output result of the simulation equipment as the output result of the interlocking software.
The simulator herein may include:
a trackside simulator:
displaying all on-site trackside equipment and states thereof through an interface, wherein in the automatic test system, a trackside simulator needs to open a corresponding interface; the interlocking automated test software may send corresponding commands to the trackside simulator such as: the section occupation pressure, the signal machine fault and the like, and the current state of the corresponding equipment can be obtained from the trackside simulator.
The relay combination rack simulator:
the relay combined frame simulator is mainly used for driving and collecting signals of a hardware function test system.
After receiving the trackside equipment state information of the trackside simulator, the relay combined frame simulator converts the trackside equipment state information into corresponding relay code bits to drive a hardware function test system; collecting the code bit information of the relay of the hardware function test system, correspondingly resetting the code bit information, and issuing the code bit information to the trackside simulator subsystem. And the relay combined frame simulator realizes the test of the related functions of the actual CI through fault injection.
LEU simulator:
for simulating an actual LEU subsystem. The LEU simulator is mainly used for the point type MA screening function, the CI simulator conducts CAN code bit information and LEU state serial port code bit information interaction, and therefore the point type MA screening function is achieved through LEU state serial port code bit information interaction with an actual CI. And sending the screened point type MA to the trackside simulator.
And a CI simulator:
for simulating an actual CI device. In automated testing of interlocking machines, there may be multiple interlocking stations. The CI simulator can form a station connection relation with the actual CI, and the automatic test environment is more perfect. The CI simulator can replace substantially most of the functionality of an actual CI and needs to interface with interlocking automated test software in an automated test system.
ZC simulator:
for simulating an actual ZC installation. In the automatic test of the interlocking machine, the test of the CBTC level is required, the ZC simulator can sequence the trains through the interaction with the VOBC simulator, calculate the safe position of the trains, send the movement authorization of the trains at the CBTC level to the trains, log off the trains, monitor the communication state with the trains and the like; the ZC simulator needs to interface with the interlock automation test software.
VOBC simulator:
for simulating the actual VOBC. The VOBC simulator can conveniently increase simulation vehicles and play an irreplaceable role in actual test. The interlocking automatic test software is added in the framework to communicate with the interface of the simulation car, so that the automatic test of a sports car scene can be realized.
Of course, in practical application, a person skilled in the art may also adopt other modes, and the preferred embodiments provided by the embodiments of the present invention should not be understood as limiting the scope of the present invention.
Preferably, before step 206 of the second embodiment, the method may further include:
receiving a test expectation input by a user;
at this time, step 206 specifically includes:
and comparing the test expectation input by the user with the output result of the interlocking software, and outputting the test result according to the comparison result.
Preferably, based on any one of the above embodiments, a third embodiment of the present invention provides a method for a test system to obtain a test instruction of a user, where the method may further include, as shown in fig. 3:
step 301, receiving a test trigger instruction input by a user;
as will be readily understood by those skilled in the art, a test trigger instruction herein is an instruction that triggers a test system to perform a test.
Step 302, instruct the user to input a test instruction into a specific location in a test script.
Step 303, receiving a test instruction input by the user at the specific position.
By the method, the structured test script can be provided, and the test script is convenient for testers to create and edit.
Preferably, the test method provided by the fourth embodiment of the present invention may also be used for testing hardware of an interlock system, as shown in fig. 4, a test procedure may include:
step 401, receiving a hardware test instruction input by a user, where the hardware test instruction includes a signal to be acquired by tested hardware.
Step 402, calling corresponding tested hardware to collect corresponding signals.
And 403, judging whether the tested hardware is normal or not according to the signal fed back by the tested hardware.
And step 404, outputting a judgment result.
The tested hardware can comprise: the interlocking host, the I \ O cabinet, the relay plug box and the like.
Similarly, the tested system automatically acquires corresponding signals and automatically outputs the test result of whether the tested hardware is normal or not, so that the test complexity is reduced and the test efficiency is improved.
Based on the same concept, a fifth embodiment of the present invention further provides an interlocking software testing system, as shown in fig. 5, the system includes:
a test instruction acquisition interface 501, configured to receive a test instruction input by a user, where the test instruction is used to indicate test content of a current test;
a parameter determining module 502, configured to determine a test parameter required for completing the test content;
and the parameter simulation module 503 is used for simulating the test parameters and inputting the simulated parameters into a parameter acquisition interface of the interlocking software.
Preferably, the system further comprises:
the output result acquisition module is used for acquiring the output result of the interlocking software;
the test result generation module generates a test result according to the output result of the interlocking software;
and the feedback module is used for outputting the test result generated by the test result generation module.
Preferably, the system further comprises:
the output result acquisition module is specifically used for
Acquiring an output signal of interlocking software, and taking the acquired output signal as an output result; or,
acquiring an output result of the physical device input by an output signal of interlocking software, and taking the output result of the physical device as the output result of the interlocking software; or,
and acquiring an output result of the simulation equipment input by an output signal of the interlocking software, and taking the output result of the simulation equipment as the output result of the interlocking software.
Preferably, the system further comprises:
the test expectation acquisition module is used for receiving the test expectation input by the user;
the feedback module is specifically used for comparing the test expectation input by the book with the output result of the interlocking software and outputting the test result according to the comparison result.
Preferably, the system further comprises:
the trigger module is used for receiving a test trigger instruction input by a user;
the indicating module is used for indicating the user to input the test instruction to a specific position in the test script after the triggering module receives the test triggering instruction;
the test instruction collecting interface 501 is specifically configured to receive a test instruction input by the user at the specific location.
Preferably, the system is also used for testing the hardware of the interlocking system,
the test instruction acquisition interface 501 is further configured to receive a hardware test instruction input by a user, where the hardware test instruction includes a signal to be acquired by the tested hardware;
further comprising: the calling module is also used for calling the corresponding tested hardware to acquire corresponding signals;
the test result generation module is also used for judging whether the tested hardware is normal according to the signal fed back by the tested hardware;
the feedback module is also used for outputting the judgment result of the test result generation module.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the technical principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.