CN111016978B - Method for realizing regional controller equipment test based on GoogleTest test framework - Google Patents
Method for realizing regional controller equipment test based on GoogleTest test framework Download PDFInfo
- Publication number
- CN111016978B CN111016978B CN201911369146.2A CN201911369146A CN111016978B CN 111016978 B CN111016978 B CN 111016978B CN 201911369146 A CN201911369146 A CN 201911369146A CN 111016978 B CN111016978 B CN 111016978B
- Authority
- CN
- China
- Prior art keywords
- test
- model
- train
- case
- framework
- 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.)
- Active
Links
Images
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B61—RAILWAYS
- B61L—GUIDING RAILWAY TRAFFIC; ENSURING THE SAFETY OF RAILWAY TRAFFIC
- B61L27/00—Central railway traffic control systems; Trackside control; Communication systems specially adapted therefor
- B61L27/60—Testing or simulation
Landscapes
- Engineering & Computer Science (AREA)
- Mechanical Engineering (AREA)
- Train Traffic Observation, Control, And Security (AREA)
Abstract
The invention relates to a method for realizing regional controller equipment test based on a GoogleTest test framework, which comprises S1, compiling cases; s2, converting the case into a test case code through graphical interface operation; s3, setting the execution times of the automatic test; s4, starting a corresponding test model according to the test case, and starting a tested object; s5, setting corresponding state values according to the cases; s6, judging whether the calculated result of the tested object is consistent with the expected result by an assertion mode; s7, judging whether the test times are reached, if not, executing the step S3, otherwise, continuing; and S8, displaying the test result. The GTest-based test system can realize imaging and can also directly and quickly realize writing of case scripts through C + + language.
Description
Technical Field
The invention aims to provide a rail transit testing technology, and particularly relates to a method for realizing regional controller equipment testing based on a GoogleTest testing framework.
Background
The CBTC (Communication Based Train automatic Control) System plays a great role in guaranteeing the safe operation of trains and improving the operation efficiency as a central System for controlling urban rail trains, and a zone controller subsystem serving as trackside safety equipment of the CBTC System generates Train driving permission commands in real time through interfaces with CI, ATS, ATP, adjacent ZC and maintenance equipment according to the states of controlled trains, the running positions in the Control range, interlocking route information, temporary speed limit commands and other information, and transmits the Train driving permission commands to an ATP vehicle-mounted subsystem through a wireless Communication System, so that the running safety of all trains in the jurisdiction of the System is guaranteed, and mobile blocking is realized.
Because the unmanned aerial vehicle interface of regional controller subsystem, relative to other CBTC subsystems, the test degree of difficulty is great. As a system with higher security level requirements, how to ensure the integrity and utilization rate of the test is a problem to be solved urgently.
The traditional software test of the zone controller equipment or the test based on the simulation test platform of the tester needs a long time for one-time covering complete test and is complex to operate. Or the test software based on the XML automation script is low in efficiency and only aims at testers without programming experience, and the test system based on the GTest can be realized by testers without programming basis or developers with programming experience.
Disclosure of Invention
The invention aims to provide a method for realizing regional controller equipment testing based on a GoogleTest testing framework, which is used for solving the problem of tedious manual testing, can replace manual operation with scripts, and has the disadvantages of higher difficulty coefficient, too many related models, complicated operation and easy generation of unexpected problems.
The invention relates to a method for realizing regional controller equipment test based on a GoogleTest test framework, which comprises S1, compiling cases; s2, converting the case into a test case code through graphical interface operation; s3, setting the execution times of the automatic test; s4, starting a corresponding test model according to the test case, and starting a tested object; s5, setting corresponding state values according to the cases; s6, judging whether the calculated result of the tested object is consistent with the expected result by an assertion mode; s7, judging whether the test times are reached, if not, executing the step S3, otherwise, continuing; and S8, displaying the test result.
According to an embodiment of the method for realizing the equipment test of the zone controller based on the GoogleTest test framework, all modules and a bottom layer structure are established on the basis of the GTest framework, the execution of the case is realized by operating an open interface, the execution result of the test object is compared with the expected result by the GTest framework based on an assertion method, and the test result is obtained to judge whether the case is executed successfully or not.
According to an embodiment of the method for realizing the regional controller equipment test based on the GoogleTest test framework, the method for upgrading the train to the CBTC level comprises the following steps: starting a train model, starting a tested object ZC of a target machine, locking the arranged sections on a route by a CI model, initiating a registration event by the train model and the tested object ZC, sending the position of a train by the train model after the registration is successful, moving the train to the uplink direction according to a set speed value, unpacking and verifying the train model according to the data of the CI model train model, calculating MA information for the current train model when the distance between the maximum safety front end and the current occupied axle is less than 25m and the current train is in normal communication after the train meets the requirement that the current occupied axle is less than 25m, setting the current grade as CBTC by the train model after the train receives the MA information, continuously detecting whether the grade of the train model is the CBTC grade by software in an assertion mode, passing the current test case if the grade is detected to be the CBTC grade in a set time range, and failing otherwise.
According to the embodiment of the method for realizing the regional controller equipment test based on the GoogleTest test framework, the length of a train is set to be 120 meters, and the speed is set to be right at 15 km/h.
According to an embodiment of the method for realizing regional controller equipment testing based on the GoogleTest testing framework, an upper route is arranged, and a train is placed at a distance of 50 meters in front of a current axle counting end point of the route.
According to an embodiment of the method for realizing the regional controller equipment test based on the GoogleTest test framework, a CI model and an ATS model are started, a temporary speed limit value of a certain shaft is set to be 30km/h, the ATS model sends a verification command of the shaft for 30km/h to a tested object ZC, the tested object ZC replies a verification confirmation success after receiving the command, the ATS model continues to send a speed limit execution command of 30km/h to the ZC model after receiving the verification confirmation success command, the ATS model completes the speed limit temporary setting function after receiving the speed limit execution confirmation success command of the tested object ZC, the temporary speed limit value of a current section sent by the tested object ZC is detected through an assertion mode to see whether the temporary speed limit value meets the value of 30km/h or not, the condition is satisfied within a set time, namely the case operation success, and otherwise the case operation fails.
The invention solves the problem of low XML case compiling efficiency of automatic test, and the test system based on GTest can realize not only the imaging but also the quick compiling of case scripts directly through C + + language.
Drawings
FIG. 1 is a diagram of a software architecture;
FIG. 2 is a block diagram of an embodiment;
FIG. 3 is a flowchart of a method for implementing a device test for a zone controller based on the GoogleTest test framework.
Detailed Description
In order to make the objects, contents, and advantages of the present invention clearer, the following detailed description of the embodiments of the present invention will be made in conjunction with the accompanying drawings and examples.
Fig. 1 is a software architecture diagram, as shown in fig. 1, which clearly shows the overall architecture of the software, and only the display interface that the tester can contact is connected with the functional interfaces of the modules. The bottom layer interface is only open to the developer. This has the advantage of preventing the whole environment from being damaged due to misoperation of a tester.
Fig. 2 is a specific implementation framework diagram, and as shown in fig. 2, all modules and an underlying structure are established On the basis of a Gtest (google test framework), and the modules that can be operated and controlled by a case writer include a scheduling management module, a base module, an ATS (Automatic Train Supervision) module, a ZC (Zone Controller area Controller) module, a VOBC (vessel On-Board Controller) module, and a CI (Computer Interlock) module. The execution of the case is realized by operating on an open interface. And comparing the execution result of the test object with an expected result through a GTest framework based on an assertion method, and obtaining a test result to judge whether the case is successfully executed.
Fig. 3 is a flowchart of a method for implementing a device test of a local controller based on a google test framework, and as shown in fig. 3, the method for implementing the device test of the local controller based on the google test framework includes:
s1, compiling cases;
s2, converting the case into a test case code through graphical interface operation;
s3, setting the execution times of the automatic test;
s4, starting a corresponding test model according to the test case, and starting a tested object;
s5, setting corresponding state values according to the cases;
s6, judging whether the calculated result of the tested object is consistent with the expected result by an assertion mode;
s7, judging whether the test times are reached, if not, executing the step S3, otherwise, continuing;
and S8, displaying the test result.
Specific embodiment example 1:
case (2): train 1 upgraded to CBTC level
The realization is as follows:
the models to be started are prepared to comprise VOBC models and CI models, and the maps are selected to be standard station maps.
An up-route is arranged and the train is placed at a distance of approximately 50 meters ahead of the current axle counting end point of the route.
The train length is set to be 120 meters, and the speed is set to be right at 15km/h (the up-run defaults from left to right).
And starting the train model, the CI model and the ZC of the measured object of the target machine. At this time, the CI model locks the arranged sections on the route, the train model firstly initiates a registration event with the measured object ZC, after the registration is successful, the train model sends the train position to the measured object ZC, and the train moves to the upstream direction according to the set speed value. After unpacking verification of data sent by a CI model train model is passed, when a train meets the condition that the distance between the maximum safe front end and the current occupied pressure is less than 25m and the current train communication is normal, MA is calculated for the current train model, after the train receives MA information of the tested object ZC, the train model can set the current grade as CBTC, the software continuously detects whether the grade of the train model is the CBTC grade through an assertion mode, if the grade detected in a set time range is the CBTC grade, the current case test is passed, and if not, the current case test is failed.
Specific embodiment example 2:
the prepared models to be started comprise a CI model and an ATS model, and the map is selected as a standard station map.
Starting a CI model and an ATS model, and setting the temporary speed limit value of a certain axle to be 30 km/h. The ATS model sends a verification command of the metering shaft of 30km/h to the measured object ZC, the measured object ZC replies a verification confirmation success after receiving the command, the ATS model continues to send a speed limit execution command of 30km/h to the measured object ZC after receiving the verification confirmation success command, and the ATS model completes a temporary speed limit setting function after receiving the speed limit execution confirmation success command of the measured object ZC. And detecting the temporary speed limit value of the current section sent by the ZC to be tested by an assertion mode to determine whether the temporary speed limit value meets the value of 30km/h, wherein the condition that the temporary speed limit value meets the value within the set time is that the case runs successfully, and otherwise, the case fails.
The invention is based on the GTest zone controller equipment unit test method with VOBC model, CI model, ZC model and ATS model, controls the test process by means of assertion, and judges the result intuitively; the VOBC model, the CI model, the ZC model and the ATS model which are unique can be conveniently controlled by graphical script compiling, and the graphical script can be more conveniently converted into a test script based on GTest.
The Google Test is an open-source C + + automatic Test framework which is dominated by Google, and is called GTest for short. GTest is based on an xUnit cell test system, and similar to CppUint, can be regarded as the transplantation of JUnit, PyUnit and the like to C + +. The software is an automatic testing solution based on GTest, and in an urban rail CBTC signal system, the main testing means is to realize the testing work of a case by manually operating various models or the automatic testing of compiling scripts by XML language. The invention provides a method for realizing regional controller equipment testing based on a GoogleTest testing framework, which is superior to the existing automatic testing method. The technical scheme adopted by the invention is as follows: the test method comprises the steps of communicating with a tested object through software simulation, generating a test script through a C + + or graphical interface, judging a test result through a GTest assertion-based mode, displaying through Console and XML, flexibly controlling a test process and visually judging the result.
Compared with the prior art, the scheme of the invention has the following advantages:
1. GTest based zone controller test systems may share the same test data configuration. The problem that the workload of coding is increased due to the definition of test data when the number of test cases is too large is solved; the problem that the test cases are troublesome to maintain and manage is solved; and the test program needs to be recompiled every time the data of the test case is modified.
2. Simulating a real situation: tests which cannot be executed by manual tests can be executed, for example, the load of 40 VOBC vehicle test systems is added simultaneously, the conventional simulation environment cannot achieve the test purpose, and the automatic test tool can be used for simulating the multi-VOBC concurrent process.
3. The test result based on GTest supports two output modes of the formats of Console and XML file, and the output content comprises the execution result and time of the test case. The test result is more visual and flexible to judge and control the test process.
4. The system has the advantages of unique VOBC model, CI model, ZC model and ATS model, and more convenient and faster simulation of a real test scene.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.
Claims (5)
1. A method for realizing regional controller equipment testing based on a GoogleTest testing framework is characterized by comprising the following steps:
s1, compiling cases;
s2, converting the case into a test case code through graphical interface operation;
s3, setting the execution times of the automatic test;
s4, starting a corresponding test model according to the test case, and starting a tested object;
s5, setting corresponding state values according to the cases;
s6, judging whether the calculated result of the tested object is consistent with the expected result by an assertion mode;
s7, judging whether the test times are reached, if not, executing the step S3, otherwise, continuing;
s8, displaying the test result;
the train upgraded to the CBTC level comprises the following steps:
starting a train model, starting a tested object ZC of a target machine, locking the arranged sections on a route by a CI model, initiating a registration event by the train model and the tested object ZC, sending the position of a train by the train model after the registration is successful, moving the train to the uplink direction according to a set speed value, unpacking and verifying the train model according to the data of the CI model train model, calculating MA information for the current train model when the distance between the maximum safety front end and the current occupied axle is less than 25m and the current train is in normal communication after the train meets the requirement that the current occupied axle is less than 25m, setting the current grade as CBTC by the train model after the train receives the MA information, continuously detecting whether the grade of the train model is the CBTC grade by software in an assertion mode, passing the current test case if the grade is detected to be the CBTC grade in a set time range, and failing otherwise.
2. The method for implementing equipment testing of zone controllers based on the google test framework as claimed in claim 1, wherein all modules and infrastructure are built on the basis of GTest framework, implementing case execution by operating open interfaces, comparing the execution result of the test object with the expected result by GTest framework based on assertion method, and obtaining the test result to determine whether case execution succeeds.
3. The method for implementing regional controller equipment testing based on the google test framework of claim 1, wherein the train length is set to 120 meters and the speed is set to the right at 15 km/h.
4. The method for implementing regional controller device testing based on the google test framework of claim 1, wherein an up-going route is ranked and the train is placed at a distance of 50 meters ahead of a current axle counting end point of the route.
5. A method for realizing regional controller equipment testing based on a GoogleTest testing framework is characterized by comprising the following steps:
s1, compiling cases;
s2, converting the case into a test case code through graphical interface operation;
s3, setting the execution times of the automatic test;
s4, starting a corresponding test model according to the test case, and starting a tested object;
s5, setting corresponding state values according to the cases;
s6, judging whether the calculated result of the tested object is consistent with the expected result by an assertion mode;
s7, judging whether the test times are reached, if not, executing the step S3, otherwise, continuing;
s8, displaying the test result;
the method specifically comprises the following steps: starting a CI model and an ATS model, setting a temporary speed limit value of a certain axle to be 30km/h, sending a verification command of the axle of 30km/h to a measured object ZC by the ATS model, replying a verification confirmation success after the measured object ZC receives the command, continuing sending a speed limit execution command of 30km/h to the ZC model after the ATS model receives the verification confirmation success command, completing a temporary speed limit setting function after the ATS model receives the speed limit execution confirmation success command of the measured object ZC, detecting whether the temporary speed limit value of a current section sent by the measured object ZC meets the value of 30km/h through an assertion mode, wherein the condition that the condition is met in a set time is successful case operation, and otherwise, failing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911369146.2A CN111016978B (en) | 2019-12-26 | 2019-12-26 | Method for realizing regional controller equipment test based on GoogleTest test framework |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911369146.2A CN111016978B (en) | 2019-12-26 | 2019-12-26 | Method for realizing regional controller equipment test based on GoogleTest test framework |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111016978A CN111016978A (en) | 2020-04-17 |
CN111016978B true CN111016978B (en) | 2021-11-16 |
Family
ID=70214818
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911369146.2A Active CN111016978B (en) | 2019-12-26 | 2019-12-26 | Method for realizing regional controller equipment test based on GoogleTest test framework |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111016978B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111857090B (en) * | 2020-05-26 | 2021-09-28 | 卡斯柯信号有限公司 | Method and device for ATS performance test |
CN111949008B (en) * | 2020-08-06 | 2022-05-06 | 青岛海信微联信号有限公司 | Method and device for testing zone controller, electronic equipment and storage medium |
CN112511386B (en) * | 2020-12-09 | 2022-07-26 | 爱瑟福信息科技(上海)有限公司 | Vehicle-mounted Ethernet test method and system based on robotframe and Ethernet test equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103744781B (en) * | 2013-12-27 | 2016-05-18 | 北京交控科技股份有限公司 | A kind of method of testing of interlocking software and test macro |
JP6025763B2 (en) * | 2014-02-05 | 2016-11-16 | 三菱電機株式会社 | Embedded device software development test equipment |
CN104360940A (en) * | 2014-10-31 | 2015-02-18 | 北京交控科技有限公司 | DSU (Data Service Unit) test method and device |
CN105701014A (en) * | 2016-01-11 | 2016-06-22 | 上海富欣智能交通控制有限公司 | Automatic testing method for railway signal computer interlocking system |
CN109710513B (en) * | 2018-12-07 | 2020-10-13 | 天津津航计算技术研究所 | Engine for automatic test of CBTC (communication based train control) system |
CN109656820B (en) * | 2018-12-10 | 2022-02-22 | 中国铁道科学研究院集团有限公司通信信号研究所 | Intelligent automatic test system based on CBTC |
-
2019
- 2019-12-26 CN CN201911369146.2A patent/CN111016978B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN111016978A (en) | 2020-04-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111016978B (en) | Method for realizing regional controller equipment test based on GoogleTest test framework | |
RU2675728C2 (en) | Method and device for implementing testing process of rail vehicle | |
CN102566442B (en) | CBTC (Communications Based Train Control) signal system simulation testing platform | |
CN108508867B (en) | Vehicle-mounted controller software testing system and method based on behavior driving script | |
CN109901546A (en) | Auxiliary drives vehicle hardware assemblage on-orbit test method and system | |
CN104699069A (en) | Train control system vehicular device simulation testing system | |
CN109298648A (en) | A kind of train control center emulation Auto-Test System | |
CN106484757B (en) | Position the train event on railway network | |
CN103529711B (en) | Automatic testing method and system for ATC vehicle-mounted equipment | |
CN103631257A (en) | Automated testing method and system for subway train signal systems | |
CN107861496A (en) | A kind of system and method for emulation platform transponder beacon message | |
CN105138455A (en) | Testing system and testing method of train control on-board device | |
CN113009935B (en) | Unmanned aerial vehicle simulation test system and method and unmanned aerial vehicle flight controller | |
CN109664921B (en) | VBTC multi-vehicle tracking safety verification method and system based on trackside simulator | |
CN114706747A (en) | Automatic test system for TACS (train operation control System) | |
CN108259258A (en) | A kind of system and method for realizing shunting monitoring system automation functional test | |
Wang et al. | Cloud-based simulated automated testing platform for virtual coupling system | |
CN116149303B (en) | Test method and device for remote limit driving mode of train | |
CN114089719A (en) | Vehicle signal interface simulation verification method and device for TACS (train operation control System) | |
CN109656231B (en) | Communication test system for magnetic suspension traffic vehicle-mounted operation control | |
CN110597087A (en) | System and method for simulating operation of magnetic suspension train | |
CN115892146A (en) | Automatic test method for interactive code bits of interlocking system and external system interface | |
CN118131722A (en) | Multi-vehicle operation automatic test system, method, equipment and storage medium | |
CN213657892U (en) | Intelligent driving vehicle test system | |
KR102670845B1 (en) | Test apparatus and method of Automatic Train Operation for train |
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 |