CN111016978A - 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 PDF

Info

Publication number
CN111016978A
CN111016978A CN201911369146.2A CN201911369146A CN111016978A CN 111016978 A CN111016978 A CN 111016978A CN 201911369146 A CN201911369146 A CN 201911369146A CN 111016978 A CN111016978 A CN 111016978A
Authority
CN
China
Prior art keywords
test
model
train
framework
case
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
CN201911369146.2A
Other languages
Chinese (zh)
Other versions
CN111016978B (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.)
Tianjin Jinhang Computing Technology Research Institute
Original Assignee
Tianjin Jinhang Computing Technology Research Institute
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 Tianjin Jinhang Computing Technology Research Institute filed Critical Tianjin Jinhang Computing Technology Research Institute
Priority to CN201911369146.2A priority Critical patent/CN111016978B/en
Publication of CN111016978A publication Critical patent/CN111016978A/en
Application granted granted Critical
Publication of CN111016978B publication Critical patent/CN111016978B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B61RAILWAYS
    • B61LGUIDING RAILWAY TRAFFIC; ENSURING THE SAFETY OF RAILWAY TRAFFIC
    • B61L27/00Central railway traffic control systems; Trackside control; Communication systems specially adapted therefor
    • B61L27/60Testing 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

Method for realizing regional controller equipment test based on GoogleTest test framework
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 testing 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 (ZoneController zone Controller) module, a VOBC (Vehicle On-Board Controller) module, a CI (Computer Interlock) module, and the like. 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 (6)

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;
and S8, displaying the test result.
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 upgrading a train to a CBTC class comprises:
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.
4. The method for implementing regional controller equipment testing based on the google test framework of claim 3, wherein the train length is set to 120 meters and the speed is set to the right at 15 km/h.
5. The method for implementing regional controller device testing based on the google test framework of claim 3, 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.
6. The method for implementing regional controller device testing based on the GoogleTest testing framework of claim 1,
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.
CN201911369146.2A 2019-12-26 2019-12-26 Method for realizing regional controller equipment test based on GoogleTest test framework Active CN111016978B (en)

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 true CN111016978A (en) 2020-04-17
CN111016978B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857090A (en) * 2020-05-26 2020-10-30 卡斯柯信号有限公司 Method and device for ATS performance test
CN111949008A (en) * 2020-08-06 2020-11-17 青岛海信微联信号有限公司 Method and device for testing zone controller, electronic equipment and storage medium
CN112511386A (en) * 2020-12-09 2021-03-16 爱瑟福信息科技(上海)有限公司 Vehicle-mounted Ethernet test method and system based on robotframe and Ethernet test equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744781A (en) * 2013-12-27 2014-04-23 北京交控科技有限公司 Test method and test system for interlocking software
CN104360940A (en) * 2014-10-31 2015-02-18 北京交控科技有限公司 DSU (Data Service Unit) test method and device
JP2015148879A (en) * 2014-02-05 2015-08-20 三菱電機株式会社 Incorporated equipment software development testing device
CN105701014A (en) * 2016-01-11 2016-06-22 上海富欣智能交通控制有限公司 Automatic testing method for railway signal computer interlocking system
CN109656820A (en) * 2018-12-10 2019-04-19 中国铁道科学研究院集团有限公司通信信号研究所 Intelligent automation test macro based on CBTC
CN109710513A (en) * 2018-12-07 2019-05-03 天津津航计算技术研究所 A kind of engine for the test of CBTC system automation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744781A (en) * 2013-12-27 2014-04-23 北京交控科技有限公司 Test method and test system for interlocking software
JP2015148879A (en) * 2014-02-05 2015-08-20 三菱電機株式会社 Incorporated equipment software development testing device
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
CN109710513A (en) * 2018-12-07 2019-05-03 天津津航计算技术研究所 A kind of engine for the test of CBTC system automation
CN109656820A (en) * 2018-12-10 2019-04-19 中国铁道科学研究院集团有限公司通信信号研究所 Intelligent automation test macro based on CBTC

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘小双等: "使用Google测试框架的软件单元测试", 《单片机与嵌入式系统应用》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857090A (en) * 2020-05-26 2020-10-30 卡斯柯信号有限公司 Method and device for ATS performance test
CN111949008A (en) * 2020-08-06 2020-11-17 青岛海信微联信号有限公司 Method and device for testing zone controller, electronic equipment and storage medium
CN112511386A (en) * 2020-12-09 2021-03-16 爱瑟福信息科技(上海)有限公司 Vehicle-mounted Ethernet test method and system based on robotframe and Ethernet test equipment
CN112511386B (en) * 2020-12-09 2022-07-26 爱瑟福信息科技(上海)有限公司 Vehicle-mounted Ethernet test method and system based on robotframe and Ethernet test equipment

Also Published As

Publication number Publication date
CN111016978B (en) 2021-11-16

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
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
CN103529711B (en) ATC mobile unit automatic test approach and system
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
CN109857087A (en) A kind of urban rail zone controller system hardware is in ring test system
CN106484757A (en) Train event on positioning railway network
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
CN108259258A (en) A kind of system and method for realizing shunting monitoring system automation functional test
CN114089719A (en) Vehicle signal interface simulation verification method and device for TACS (train operation control System)
CN116149303B (en) Test method and device for remote limit driving mode of train
CN114706747A (en) Automatic test system for TACS (train operation control System)
Wang et al. Cloud-based simulated automated testing platform for virtual coupling system
Wang et al. Hybrid online model-based testing for communication-based train control systems
CN115892146A (en) Automatic test method for interactive code bits of interlocking system and external system interface
CN109656231A (en) The communication test system of magnetic floating traffic vehicle-mounted running control
CN115129027A (en) Automatic evaluation method and device for intelligent driving
CN118131722A (en) Multi-vehicle operation automatic test system, method, equipment and storage medium
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