Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views14 pages

Test Sequence Optimization

Uploaded by

Fabricio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views14 pages

Test Sequence Optimization

Uploaded by

Fabricio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

INTERNATIONAL JOURNAL OF COMPUTERS COMMUNICATIONS & CONTROL

ISSN 1841-9836, 10(4):593-606, August, 2015.

Automated Test Sequence Optimization Based on the


Maze Algorithm and Ant Colony Algorithm
W. Zheng, N.W. Hu

Wei Zheng*, Naiwen Hu


National Engineering Research Center of
Rail Transportation Operation and Control System
Beijing Jiaotong University
Beijing 100044, China
[email protected], [email protected]
*Corresponding author: [email protected]

Abstract: With the rapid development of China train operation and control system,
validity and safety of behavioral functions of the system have attracted much attention
in the railway domain. In this paper, an automated test sequence optimization method
was presented from the system functional requirement specification of the high-speed
railway. To overcome the local optimum of traditional ant colony algorithm, the
maze algorithm is integrated with the ant colony algorithm to achieve the dynamical
learning capacity and improve the adaptation capacity to the complex and changeable
environment, and therefore, this algorithm can produce the optimal searching results.
Several key railway operation scenarios are selected as the representative functional
scenarios and Colored Petri Nets (CPN) is used to model the scenarios. After the
CPN model is transformed into the extensible markup language (XML) model, the
improved ant colony algorithm is employed to generate the optimal sequences. The
shortest searching paths are found and the redundant test sequences are reduced
based on the natural law of ants foraging. Finally, the Radio Blocking Center (RBC)
test platform is designed and used to validate the optimal sequence. Testing results
show that the proposed method is able to optimize the test sequences and improve
the test efficiency successfully.
Keywords: Ant colony algorithm, maze algorithm, test sequence, optimization, CPN
model

1 Introduction
As the safety-critical system, the Chinese Train Control System Level 3 (CTCS-3) is capable
of ensuring the safe and efficient operation for a train with high speed and density. Before the
system comes into service, it is essential to execute series of tests, including laboratory testing,
field testing, integrated testing, and interoperability test to verify the consistence of the system
to the requirement specification [1]. A timely and complete test can significantly contribute to
finding the drawbacks in the system design and to assuring the appropriate functional behaviors
of the system. Taking the "7.23" accident in China as an example, there existed flaws in the
fault-tolerant design of the acquisition drive unit, with the result that the Train Control Center
(TCC) misunderstood the train occupancy information. One of the reasons was that the software
functionalities of the TCC were not fully tested because there were not efficient test methods
and enough test time for the signal system before it was put into operation. As the safety-critical
system, the Chinese Train Control System Level 3 (CTCS-3) is capable of ensuring the safe and
efficient operation for a train with high speed and density. There are more and more different
test methods for the safety-critical train control system [2]- [3]. Behrmann proposed the method
of test generation based on UPPAAL timed automata [2]. Hessel described how to generate
real-time verification tool for the test case [4]. Lee referred to a method of black box testing

Copyright © 2006-2015 by CCC Publications


594 W. Zheng, N.W. Hu

based on the input and output finite state machine ( I/O FSM ) [5]. Zhao proposed the input
and output automata of port labeled (LPTIOA), which automatically realizes the test sequences
generation for the LPTIOA model validated by UPPAAL of CTCS-3 on-board system [6]. Jaafar
put forward a kind of automatic generation method of testing script based extensible markup
language (XML) for the characteristics of safety critical system such as large script in scale,
complex structure, difficult maintenance and safety testing demand [7]. Although these methods
have achieved some success, it still exist many defects .For instance, the concurrent behavior of
the system cannot be described by test generation method based on timed automata. Because
the generation of test cases in the railway domain has high levels abstraction, automation can
not to be realized. In addition, most current test methods are semiautomatic, and the test cases
and test sequences manually generated have the drawbacks of a heavy workload, low efficiency,
and high demand for professional expertise.
Ant colony optimization (ACO) is employed to find optimal path in the graph theory. It is
proposed by Marco Dorigo in his doctoral thesis in 1992 and the idea comes from the behavior
that ants search food to find the path [8]. Experiments show that the algorithm has strong
robustness and the ability of finding optimal solution. However, there are still some defects in
it such as slow convergence speed and stagnation behavior. Ant colony algorithm has attracted
wide attention of scholars and the new ant colony algorithm has been widely applied to various
fields, such as fault identification, TSP problem and the construction of roads. At present
the study of ant colony algorithm is mainly focused on the improvement and application of
algorithm. Wu [9] made full use of the concision and efficiency of "2 - exchange method" by
leading in mutation mechanism to the basic ant colony algorithm and proposed an ant colony
algorithm with mutation features. Wang [10] put forward the meeting algorithm based on ant
colony algorithm, improved ant touring quality, combined meeting algorithm with the parallel
segmentation strategy, and proposed a segmentation algorithm for TSP problem based on ant
colony algorithm.
Taking all these aspects into consideration, a type of improved ant colony algorithm is proposed
in this paper to deal with the problems of inefficiency and repetition of the test sequences in
railway domain. The ant colony algorithm and maze algorithm are integrated to generate the
executive optimal sequences automatically. They are applied to generate Extensible Markup
Language (XML) test cases and XML test sequences respectively. These test sequences are
totally feasible for practical test executions. In addition, the repeatability rate of the generated
test sequences is reduced. Finally, four scenarios from the CTCS-3 system specification are taken
as the example and modeled with Petri nets. The algorithm is validated on the radio block center
(RBC) test platform.
The rest of this paper is organized as follows. In Section 2, the basic definitions of Petri nets are
introduced and the improved ant colony algorithm is specified. In Section 3, the Colored Petri
nets are used to model the typical operation scenarios. After the reachable graph of the Petri
nets model is analyzed, the test generation software tool is presented. Finally, the generated test
sequences are validated by the RBC test platform. Some concluding remarks are presented in
Section 4.

2 Automated test generation


The automated test method by CPN model can be depicted as Fig.1 and it is mainly divided
into three stages including modeling, test case generation and test sequence generation. From the
system requirement specification and the modeling rules, the CPN model is built for the operation
scenarios, and then the XML file and the reachable graph of the model are obtained. On the
basis of CPN model with XML format, the proposed improved ant colony algorithm is applied
GLYLGHG LQWR WKUHH VWDJHV LQFOXGLQJ PRGHOLQJ WHVW FDVH JHQHUDWLRQ DQG WHVW VHTXHQFH
JHQHUDWLRQ )URP WKH V\VWHP UHTXLUHPHQW VSHFLILFDWLRQ DQG WKH PRGHOLQJ UXOHV WKH
&31 PRGHO LV EXLOW IRU WKH RSHUDWLRQ VFHQDULRV DQG WKHQ WKH ;0/ ILOH DQG WKH
UHDFKDEOH JUDSK RI WKH PRGHO
Automated TestDUH REWDLQHG
Sequence 2Q WKH EDVLVBased
Optimization RI &31
on PRGHO
the ZLWK ;0/
IRUPDWWKHSURSRVHGLPSURYHGDQWFRORQ\DOJRULWKPLVDSSOLHGLQWRJHQHUDWHWKHVHWRI
Maze Algorithm and Ant Colony Algorithm 595
RULJLQDOWHVWFDVHV7HVWVXEVHTXHQFHFDQEHJHQHUDWHGE\FRQFDWHQDWLQJWKHWHVWFDVHV
XVLQJ DQW FRORQ\ DOJRULWKP DQG WKH LQIRUPDWLRQ LQ WHVW FDVHV )LQDOO\ WKH VHW RI
into generate the set of original test cases. Test subsequence can be generated by concatenating
RULJLQDO WHVW FDVHV DQG WKH WHVW VHTXHQFHV FDQ EH WUDQVIRUPHG LQWR ILOHV ZLWK ;0/
the test cases using ant colony algorithm and the information in test cases. Finally, the set of
IRUPDWDQGWKHQWKH;0/IRUPDWWHVWVHTXHQFHVFDQEHXVHGGLUHFWO\LQSUDFWLFDOWHVW
original test cases and the test sequences can be transformed into files with XML format, and
SURFHVV
then the XML-format test sequences can be used directly in practical test process.



)LJXUH)UDPHGLDJUDPRIWKHWHVWJHQHUDWLRQPHWKRG
Figure 1: Frame diagram of the test generation method


,QWURGXFWLRQRI&RORUHG3HWULQHWV 
2.1 Introduction of &31
&RORUHG3HWULQHWV Colored Petri nets
LVDQDGYDQFHGQHWZRUNV\VWHPLQLQWURGXFHGE\WKH
-HQVHQ.XUWEDVHGRQEDVLF3HWULQHWV>@,WLVPDLQO\FRPSRVHGRIWKHSODFH
Colored Petri nets (CPN) is an advanced network system in 1981 introduced by the Jensen
WUDQVLWLRQWRNHQDQGDUFVWRHVWDEOLVKDV\VWHPPRGHO7KHEDVLF3HWULQHWVKDVWKH
Kurt based on basic Petri nets [11]. It is mainly composed of the place, transition, token and arcs
WKHRUHWLFDOEDVLVDVZHOODVWKHZLGHDSSOLFDWLRQLQGLIIHUHQWGRPDLQVEXWLWKDVQR
to establish a system model. The basic Petri nets has the theoretical basis as well as the wide
GDWDDQGOHYHOFRQFHSWVVRWKDWLWLVKDUGWRPRGHOWKHFRPSOH[V\VWHPVEHFDXVHWKH
application in different domains, but it has no data and level concepts so that it is hard to model
PRGHOZLOOEHYHU\ODUJHDQGGLIILFXOWWRDQDO\]HG&31H[WHQGVWKHEDVLFIHDWXUHVRI
the complex systems because the model will be very large and difficult to analyzed. CPN extends
the basicEDVLF3HWULQHWVDQGLQWURGXFHVWKHFRORUHGPDUNHUVDUFGHVFULSWLRQOHYHOSDJHDQGVR
features of basic Petri nets and introduces the colored markers, arc description, level
page andRQWRFRPSHQVDWHWKHGUDZEDFNVRIWKHEDVH3HWULQHWV&31KDVWKHGHVFULSWLRQ
so on, to compensate the drawbacks of the base Petri nets. CPN has the description
capacityFDSDFLW\IRUWKHFRQFXUUHQWV\QFKURQRXVDV\QFKURQRXVIHDWXUHVUHVRXUFHV
for the concurrent, synchronous, asynchronous features, resources competition and the
coordination of the discrete event dynamic system behavior. If it is combined with the high-level
FRPSHWLWLRQDQGWKHFRRUGLQDWLRQRIWKHGLVFUHWHHYHQWG\QDPLFV\VWHPEHKDYLRU,ILW
programming language, it can model the large-scale system with the definition of complex data
LVFRPELQHGZLWKWKHKLJKOHYHOSURJUDPPLQJODQJXDJHLWFDQPRGHOWKHODUJHVFDOH
types and data processing.
V\VWHPZLWKWKHGHILQLWLRQRIFRPSOH[GDWDW\SHVDQGGDWDSURFHVVLQJ 

2.2 $QWFRORQ\DOJRULWKP
Ant colony algorithm
$VWKHDQWFRORQ\VHDUFKIRUWKHIRRGWKH\FDQXVXDOO\ILQGDQRSWLPDOSDWKIURP
As the ant colony search for the food, they can usually find an optimal path from the nest to

food because
 the ants in the searching path will release a special kind of pheromone. When they
encounter a road they never meet before, they randomly select another path. At the same time,
the ants release a kind of pheromone associated with the path length. The longer the path, the
lower the concentration of hormone released. If the following ants meet this intersection again,
the probability that they choose the path with higher hormone concentration will be relatively
large. This forms a positive feedback mechanics. The hormone concentration of the optimal
path is stronger and stronger, while the other path will diminish as time goes by. Eventually
the whole colony will find the optimal path. In addition, the ants can adapt to the environment
change. If the obstacle suddenly appears on the moving route of the ants, they can quickly find
the optimal path. During the process of searching for the route, although the selecting ability of
single ant is limited, the path information is exchanged with the effect of the hormone between
different ants, and therefore the ant colony could finally find the optimal path.
There exists other path searching algorithm such as traditional depth-first searching (DFS) algo-
rithm and Bee colony algorithm. Although DFS algorithm is able to search in different levels [12],
it doesn?t take recurring nodes into account so that it easily leads to an endless loop, leading to
the instability of the searching process. Bee colony algorithm is a type of optimization method by
imitating the behavior of bees and the main characteristics of the algorithm is it need not know
specific information and only compare the merits of the issue. However, the bee colony optimiza-
tion algorithm method is too restrictive and it can achieve some success in local optimization,
596 W. Zheng, N.W. Hu

but from a global point of view, it is not stable enough and has the relatively large blindness.
The principle of genetic algorithm, similar to neural network algorithm, uses eugenics survival of
the fittest way and achieves the optimization from generation to generation. The neural network
mainly finds the optimal way by training, resulting in the relatively low convergence speed.

2.3 The improved ant colony algorithm

The traditional ant colony algorithm is prone to reach the local optimum. In this paper,
the maze algorithm and ant colony algorithm are integrated to overcome this shortcoming. For
maze algorithm, facing a fork in the maze, the mice can choose one of the roads. If the road is
blocked, the mice will return to the fork and walk the other road. In fact, this idea is a process
of learning and optimization, which can adapt to the complex and changeable environment.
Therefore, together with the idea and the traditional ant colony algorithm, the solutions for the
test sequence optimization are designed.
Assuming that the artificial intelligence ant can secrete a special kind of pheromone, if it finds
no food when meeting a node, it can inform the foraging ants that there is no food. The ant
returns to the nest (initial point) and informs the ant in the nest that this road is blocked and
other roads can be selected. If one of the ants can go straight from the initial point to the
end point, this road should be recorded as one of the test sequences. In order to prevent the
local optimization, the next foraging ants take different roads from those recorded. If other
roads can be found, the recorded optimal road is desired. The reverse thinking can be used to
accomplish the aforementioned idea quickly. For one complex scenario, the number of roads is
limited, so the test sequence sets can be set up. Those test sequences with nodes containing no
DIRUHPHQWLRQHGLGHDTXLFNO\)RURQHFRPSOH[VFHQDULRWKHQXPEHURIURDGVLV
food should beOLPLWHGVRWKHWHVWVHTXHQFHVHWVFDQEHVHWXS7KRVHWHVWVHTXHQFHVZLWKQRGHV
deleted from the test sequence set. Among those remaining test sequences, the
optimal sequenceFRQWDLQLQJQRIRRGVKRXOGEHGHOHWHGIURPWKHWHVWVHTXHQFHVHW$PRQJWKRVH
is the one with the minimum nodes. The reverse thinking can greatly reduce
UHPDLQLQJWHVWVHTXHQFHVWKHRSWLPDOVHTXHQFHLVWKHRQHZLWKWKHPLQLPXPQRGHV
the program running time. In this paper, it is assumed that each node has two different states,
7KHUHYHUVHWKLQNLQJFDQJUHDWO\UHGXFHWKHSURJUDPUXQQLQJWLPH,QWKLVSDSHULWLV
in which "0" means there is no food here whereas "1" means this node has food.
DVVXPHGWKDWHDFKQRGHKDVWZRGLIIHUHQWVWDWHVLQZKLFK³´PHDQVWKHUHLVQRIRRG
From the aforementioned principle, the flow diagram of improved ant colony algorithm is shown
KHUHZKHUHDV³´PHDQVWKLVQRGHKDVIRRG
as Fig.2 [13]. )URPWKHDIRUHPHQWLRQHGSULQFLSOHWKHIORZGLDJUDPRILPSURYHGDQWFRORQ\
DOJRULWKPLVVKRZQDV)LJ>@

6WDUW 7KHUHDUHPDQWV 6WDUW

7KHQWKDQW 1RGHVLQVWDFN
7KHQH[WF\FOH ,QSXWQRGH
UHDG\WRJR
7KHQRGHVWKDWQR
DQWVILQGIRRGZHUH 7KHILUVW3URFHVV )RUNQRGHRIILUVW
&\FOHDQGDOOWKH
UHFRUGHGE\WKH 1RGH SURFHVVQRGH
WHVWFDVHVVHTXHQFH
VWDFN
DOLJQPHQW

< :KHWKHUKDV :KHWKHUKDV <


DVSHFLDO DVSHFLDO 7KHQH[W 1
:KHWKHULVWKH
SKHURPRQH SKHURPRQH WHVWFDVH
QRGHFRQWDLQHG
VHULHV
1 1
<
)RUNQRGHRI )RUNQRGHRI
7KHNWK 7KHNWK
WKHNWK WKHNWK 'HOHWHWKH
SURFHVVQRGH SURFHVVQRGH
SURFHVVQRGH SURFHVVQRGH VHTXHQFH

< :KHWKHUKDV :KHWKHUKDV 8SGDWHGVHW


DVSHFLDO DVSHFLDO RIWHVW
SKHURPRQH SKHURPRQH VHTXHQFHV

1 7KHQH[W
1H[WSURFHVV 1H[WSURFHVV QRGHLQWKH
QRGH QRGH ORRSVWDFN

:KHWKHULV <
2XWSXWQRGH DQH[WQRGH

(QG (QG


)LJXUH7KHIORZFKDUWRILPSURYHGDQWFRORQ\DOJRULWKP
Figure 2: The flow chart of improved ant colony algorithm
$SSOLFDWLRQRIWKHWHVWJHQHUDWLRQDOJRULWKP
5DGLR%ORFNLQJ&HQWHU 5%& DVNH\WUDFNVLGHHTXLSPHQWLQ&7&6FDQ
JHQHUDWHWKHPRYHPHQWDXWKRULW\ 0$ DQGRWKHUFRQWUROFRPPDQGVDFFRUGLQJWRWKH
LQIRUPDWLRQFRPLQJIURPRWKHUVXEV\VWHPV>@KHQFHLWVKRXOGVDWLVI\WKHIXQFWLRQDO
UHTXLUHPHQWVLQWKH&7&6VSHFLILFDWLRQV)RXURSHUDWLRQVFHQDULRVDVVRFLDWHGZLWK
5%&ZLOOEHPRGHOHGXVLQJWKH&31DQGWKHFRUUHVSRQGLQJWHVWFDVHVDQGVHTXHQFHV
ZLOOEHJHQHUDWHGXVLQJWKHSURSRVHGSDWKRSWLPL]DWLRQDOJRULWKP&RPSDUHGZLWKWKH
5:76*>@DQGWUDGLWLRQDO')6DOJRULWKPVWKHQXPEHUVRIWKHWHVWFDVHVDQG
Automated Test Sequence Optimization Based on the
Maze Algorithm and Ant Colony Algorithm 597

3 Application of the test generation algorithm


Radio Blocking Center (RBC), as key trackside equipment in CTCS-3, can generate the
movement authority (MA) and other control commands according to the information coming
from other subsystems [1]; hence, it should satisfy the functional requirements in the CTCS-3
specifications. Four operation scenarios associated with RBC will be modeled using the CPN
and the corresponding test cases and sequences will be generated using the proposed path op-
timization algorithm. Compared with the RW-TSG [14] and traditional DFS algorithms, the
numbers of the test cases and sequences will be seen as the indicators showing the superiority of
the proposed algorithms.

3.1 Functionality of RBC


The main functionalities of the RBC include: (1) receiving the position and train data from
the onboard equipment through the global system for mobile communications for railways (GSM-
R) wireless communication system; (2) generating the MA according to the information from the
Balise, the track circuit, the temporary speed restriction server, and the interlocking system; (3)
transmitting the MA to the onboard equipment, which will calculate the location-speed curve to
protect the train safety operation [15]. In CTCS-3, the RBC is connected with the centralized
traffic control (CTC) system, the computer-based interlocking (CBI) system, the temporary
speed restriction server (TSRS), and the neighbor RBC (NRBC) by different specific safety data
communication "Ethernet," and it is connected with the onboard equipment by GSM-R.

3.2 The main operation scenarios


The main operation scenarios of CTCS-3 includes registration and start, log out, level con-
version, movement authority, RBC handover, temporary speed restriction and so on. In this
paper, only the registered and start, RBC handover, automatic neutral, and log out are studied.
1. Registration and start: describe the process of the train from the initial location to prepare
operation. It mainly includes 6 stages, such as train awaking, train registration, inputting train
data and so on.
2. RBC handover: guarantee the train running from one RBC region to another RBC region.
The neighboring RBCs should have direct communication to exchange RBC handover informa-
tion. Schematic diagram is shown as Fig.3.
In the process of RBC handover, RBC1 (handover RBC) is responsible to send the handover
warning information (ID, the border of RBC Balise group ID, train data) , route request infor-
mation, switching notice information, switching confirmation information and so on. RBC2 is
responsible to send route information to take over train information to RBC1.

3. Automatic passing over of neutral section: the operation scenario of phase area has no elec-
tric interval of the electrified railway. For CTCS-3, RBC sends the phase zone information and
movement authorization (MA) to train, and the zone information includes the distance to phase
point, the length of phase zone and so on. The schematic process is shown in Fig.4.
On-board equipments receive the activated phase information transmitted by RBC, supervises
speed and position of the train in real time, process as followed: 1) When there are 10 seconds
running distance from the neutral section to the front of the train, the on-board equipment
warns the driver;2) When there are 3 seconds running distance from the neutral section to the
front of the train, the on-board equipment sends neutral-section passing order to Electric-Multi-
Unit(EMU); 3) After the front of the train crossing the phase region, the related commands are
canceled by train equipment.
598 W. Zheng, N.W. Hu

RBC Border
The relevant information of the route from RBC1 The relevant information of the route from RBC2

The end point of


MA Notice Switching MA
transponder transponder
Request route information and
other relevant data

RBC1 RBC2
Route information and train control
rights notices


Figure 3: Schematic diagram of RBC switching

SKDVHUHJLRQ

:KHQLWDFKLHYHV
'ULYLQJOLFHQVHDQGWKH WKHGLVWDQFHRI
LQIRUPDWLRQRISKDVHUHJLRQ VHFRQGVZDONLQJ
E\WKH(08LW
ZLOOQRWLFHWKH
(08

7KHOHQJWKIURPWKH 7KHOHQJWKRIWKHSKDVH
5%& WUDLQWRWKHSKDVH UHJLRQ
UHJLRQ

WKHLQIRUPDWLRQRISKDVHUHJLRQ

)LJXUHDXWRPDWLFSDVVLQJRYHURIQHXWUDOVHFWLRQ 
Figure 4: automatic passing over of neutral section
2QERDUGHTXLSPHQWVUHFHLYHWKHDFWLYDWHGSKDVHLQIRUPDWLRQWUDQVPLWWHGE\5%&
VXSHUYLVHVVSHHGDQGSRVLWLRQRIWKHWUDLQLQUHDOWLPHSURFHVVDVIROORZHG :KHQ
4. Logout: describes the process from logout information to shut off the power for the train. It
WKHUHDUHVHFRQGVUXQQLQJGLVWDQFHIURPWKHQHXWUDOVHFWLRQWRWKHIURQWRIWKHWUDLQ
mainly includes 2WKHRQERDUGHTXLSPHQWZDUQVWKHGULYHU
stages: RBC logout and the power of the train is cut off.
:KHQWKHUHDUHVHFRQGVUXQQLQJ
GLVWDQFHIURPWKHQHXWUDOVHFWLRQWRWKHIURQWRIWKHWUDLQWKHRQERDUGHTXLSPHQW
3.3 RBC scenariosVHQGVQHXWUDOVHFWLRQSDVVLQJRUGHUWR(OHFWULF0XOWL8QLW
modeling and test optimization (08  $IWHUWKHIURQWRI
WKHWUDLQFURVVLQJWKHSKDVHUHJLRQWKHUHODWHGFRPPDQGVDUHFDQFHOHGE\WUDLQ
HTXLSPHQW
From the functional characteristics of RBC and the overall technology scheme of CTCS-3,
the RBC test cases /RJRXWGHVFULEHVWKHSURFHVVIURPORJRXWLQIRUPDWLRQWRVKXWRIIWKHSRZHU
of XML format and state space reachable graph are established. By the
IRUWKHWUDLQ,WPDLQO\LQFOXGHVVWDJHV5%&ORJRXWDQGWKHSRZHURIWKHWUDLQLVFXW
improved ant colony algorithm, several cases are optimized and generated to test sequences with
RII
XML format. Finally, the set of the generation test sequence with XML format was validated
by RBC simulation5%&VFHQDULRVPRGHOLQJDQGWHVWRSWLPL]DWLRQ
testing platform. 
)URPWKHIXQFWLRQDOFKDUDFWHULVWLFVRI5%&DQGWKHRYHUDOOWHFKQRORJ\VFKHPHRI
1. Operation scenarios modeling
&7&6WKH5%&WHVWFDVHVRI;0/IRUPDWDQGVWDWHVSDFHUHDFKDEOHJUDSKDUH
Taking the four scenarios as the example including "Registration and start", "RBC handover",
HVWDEOLVKHG%\WKHLPSURYHGDQWFRORQ\DOJRULWKPVHYHUDOFDVHVDUHRSWLPL]HGDQG
"Automatic passing over of neutral section" ,"Logout", the four operation processes are modeling
JHQHUDWHGWRWHVWVHTXHQFHVZLWK;0/IRUPDW)LQDOO\WKHVHWRIWKHJHQHUDWLRQWHVW
with CPNs and VHTXHQFHZLWK;0/IRUPDWZDVYDOLGDWHGE\5%&VLPXODWLRQWHVWLQJSODWIRUP
the high level model are presented by Fig.5 and the other low  level mode are
described as Fig.6 to2SHUDWLRQVFHQDULRVPRGHOLQJ
Fig.8. 
7DNLQJ WKH IRXU VFHQDULRV DV WKH H[DPSOH LQFOXGLQJ ³5HJLVWUDWLRQ DQG VWDUW´
³5%& KDQGRYHU´ ³$XWRPDWLF SDVVLQJ RYHU RI QHXWUDO VHFWLRQ´ ³/RJRXW´ WKH IRXU
RSHUDWLRQSURFHVVHVDUHPRGHOLQJZLWK&31VDQGWKHKLJKOHYHOPRGHODUHSUHVHQWHG
E\)LJDQGWKHRWKHUORZOHYHOPRGHDUHGHVFULEHGDV)LJWR)LJ
2. Reachable state analysis of the Petri nets model
According to the four functional scenarios selected and the relevant requirement specifications of
CTCS-3, the state space reachable graph can be generated with the XML from the CPN models.
Some of those redundant states are deleted. After simplification, the simplest 36 states can be


RII
5%&VFHQDULRVPRGHOLQJDQGWHVWRSWLPL]DWLRQ 
)URPWKHIXQFWLRQDOFKDUDFWHULVWLFVRI5%&DQGWKHRYHUDOOWHFKQRORJ\VFKHPHRI
&7&6WKH5%&WHVWFDVHVRI;0/IRUPDWDQGVWDWHVSDFHUHDFKDEOHJUDSKDUH
HVWDEOLVKHG%\WKHLPSURYHGDQWFRORQ\DOJRULWKPVHYHUDOFDVHVDUHRSWLPL]HGDQG
Automated Test Sequence Optimization Based on the
JHQHUDWHGWRWHVWVHTXHQFHVZLWK;0/IRUPDW)LQDOO\WKHVHWRIWKHJHQHUDWLRQWHVW
Maze Algorithm and Ant Colony Algorithm
VHTXHQFHZLWK;0/IRUPDWZDVYDOLGDWHGE\5%&VLPXODWLRQWHVWLQJSODWIRUP 599
2SHUDWLRQVFHQDULRVPRGHOLQJ 
7DNLQJ WKH IRXU VFHQDULRV DV WKH H[DPSOH LQFOXGLQJ ³5HJLVWUDWLRQ DQG VWDUW´
³5%& KDQGRYHU´ ³$XWRPDWLF SDVVLQJ RYHU RI QHXWUDO VHFWLRQ´ ³/RJRXW´ WKH IRXU
RSHUDWLRQSURFHVVHVDUHPRGHOLQJZLWK&31VDQGWKHKLJKOHYHOPRGHODUHSUHVHQWHG
E\)LJDQGWKHRWKHUORZOHYHOPRGHDUHGHVFULEHGDV)LJWR)LJ




Figure 5: High-level model for the four operation scenarios

)LJXUH  +LJKOHYHOPRGHOIRUWKHIRXURSHUDWLRQVFHQDULRV

)LJXUH  +LJKOHYHOPRGHOIRUWKHIRXURSHUDWLRQVFHQDULRV


)LJXUH5%&KDQGRYHUVFHQDULRV 

Figure 6: RBC handover scenarios


)LJXUH  +LJKOHYHOPRGHOIRUWKHIRXURSHUDWLRQVFHQDULRV


)LJXUH5%&KDQGRYHUVFHQDULRV 


)LJXUH˖$XWRPDWLFSDVVLQJRYHURIQHXWUDOVHFWLRQVFHQDULR


)LJXUH5%&KDQGRYHUVFHQDULRV 


)LJXUH˖$XWRPDWLFSDVVLQJRYHURIQHXWUDOVHFWLRQVFHQDULR

Figure 7: Automatic passing over of neutral section scenario



)LJXUH˖5HJLVWUDWLRQDQGVWDUWVFHQDULR
5HDFKDEOHVWDWHDQDO\VLVRIWKH3HWULQHWVPRGHO 
$FFRUGLQJWRWKHIRXUIXQFWLRQDOVFHQDULRVVHOHFWHGDQGWKHUHOHYDQWUHTXLUHPHQW
VSHFLILFDWLRQVRI&7&6WKHVWDWHVSDFHUHDFKDEOHJUDSKFDQEHJHQHUDWHGZLWKWKH

;0/IURPWKH&31PRGHOV6RPHRIWKRVHUHGXQGDQWVWDWHVDUHGHOHWHG$IWHU
)LJXUH˖$XWRPDWLFSDVVLQJRYHURIQHXWUDOVHFWLRQVFHQDULR
VLPSOLILFDWLRQWKHVLPSOHVWVWDWHVFDQEHDWWDLQHGWKURXJKWKHHTXLYDOHQWPDUNHUV
DVVKRZQLQ)LJ 
)LJXUH˖5HJLVWUDWLRQDQGVWDUWVFHQDULR
5HDFKDEOHVWDWHDQDO\VLVRIWKH3HWULQHWVPRGHO 
$FFRUGLQJWRWKHIRXUIXQFWLRQDOVFHQDULRVVHOHFWHGDQGWKHUHOHYDQWUHTXLUHPHQW
VSHFLILFDWLRQVRI&7&6WKHVWDWHVSDFHUHDFKDEOHJUDSKFDQEHJHQHUDWHGZLWKWKH
;0/IURPWKH&31PRGHOV6RPHRIWKRVHUHGXQGDQWVWDWHVDUHGHOHWHG$IWHU
VLPSOLILFDWLRQWKHVLPSOHVWVWDWHVFDQEHDWWDLQHGWKURXJKWKHHTXLYDOHQWPDUNHUV

 DVVKRZQLQ)LJ 
)LJXUH˖5HJLVWUDWLRQDQGVWDUWVFHQDULR
5HDFKDEOHVWDWHDQDO\VLVRIWKH3HWULQHWVPRGHO 
Figure 8: Registration and start scenario
$FFRUGLQJWRWKHIRXUIXQFWLRQDOVFHQDULRVVHOHFWHGDQGWKHUHOHYDQWUHTXLUHPHQW
VSHFLILFDWLRQVRI&7&6WKHVWDWHVSDFHUHDFKDEOHJUDSKFDQEHJHQHUDWHGZLWKWKH
;0/IURPWKH&31PRGHOV6RPHRIWKRVHUHGXQGDQWVWDWHVDUHGHOHWHG$IWHU
VLPSOLILFDWLRQWKHVLPSOHVWVWDWHVFDQEHDWWDLQHGWKURXJKWKHHTXLYDOHQWPDUNHUV

DVVKRZQLQ)LJ


600 W. Zheng, N.W. Hu

attained through the equivalent markers, as shown in Fig.9.


)LJXUH7KHVWDWHGLDJUDPRIIRXUVFHQDULRV
Figure 9: The state diagram of four scenarios
7KHLQSXWWKHRXWSXWQRGHVRIIRXUVFHQDULRVDUHVKRZQLQ7DE
7DEOH'HVFULSWLRQRIWKHVFHQDULR
,QSXW 2XWSXW
1XPEHU 6FHQDULR
The input, the output nodes of four scenarios are shown QRGH in Tab.1.
QRGH 
)LJXUH7KHVWDWHGLDJUDPRIIRXUVFHQDULRV
5HJLVWUDWLRQ
  
7KHLQSXWWKHRXWSXWQRGHVRIIRXUVFHQDULRVDUHVKRZQLQ7DE
DQGVWDUW
Table 1: Description of the scenario
7DEOH'HVFULSWLRQRIWKHVFHQDULR
 5%&VZLWFK  
1XPEHU 6FHQDULR ,QSXWQRGH 2XWSXWQRGH
 $XWRPDWLFSDVVLQJ
5HJLVWUDWLRQDQGVWDUW
    
WKHSKDVHUHJLRQ
 5%&VZLWFK  
 $XWRPDWLFSDVVLQJWKHSKDVHUHJLRQ
/RJRXW     
 /RJRXW   


$VLVVKRZQLQ7DEOHWKHLQSXWQRGHDQGRXSXWQRGHRIVFHQHLVDQG
$VLVVKRZQLQ7DEOHWKHLQSXWQRGHDQGRXSXWQRGHRIVFHQHLVDQG
UHVSHFWLYHO\DQGVRRQ,QRUGHUWRHQVXUHWKDWDOOQRGHVDUHFRYHUHGEHWZHHQWZR
UHVSHFWLYHO\DQGVRRQ,QRUGHUWRHQVXUHWKDWDOOQRGHVDUHFRYHUHGEHWZHHQWZR
As is shown in Table 1, the input node and output node of scene 1 is 1 and 22 respectively and so
DGMDFHQWLQSXWQRGHVDQGRXWSXWQRGHVKDYHRYHUODSSHG
DGMDFHQWLQSXWQRGHVDQGRXWSXWQRGHVKDYHRYHUODSSHG
on. In order to ensure7KHWKHRUHWLFDODQDO\VLVRIWKHVWDWHGLDJUDP
that all nodes are covered, between two adjacent, input nodes and output
7KHWKHRUHWLFDODQDO\VLVRIWKHVWDWHGLDJUDP
nodes have overlapped. )URPDVLPSOLILHGVWDWHGLDJUDPRI)LJRQHRIWKHWHVWVHTXHQFHVLV³
)URPDVLPSOLILHGVWDWHGLDJUDPRI)LJRQHRIWKHWHVWVHTXHQFHVLV³
´$VVXPLQJWKDWWKHDQW$ILQGV³QRIRRG´
´$VVXPLQJWKDWWKHDQW$ILQGV³QRIRRG´
3. The theoretical LQQRGHGXULQJIRUDJLQJSURFHVVZKLFKPHDQVWKHQH[WDQWQHHGQRWJRLQWRWKHQRGH
analysis of the state diagram
LQQRGHGXULQJIRUDJLQJSURFHVVZKLFKPHDQVWKHQH[WDQWQHHGQRWJRLQWRWKHQRGH
From a simplified 7KHQDQW$JRHVEDFNWRWKHLQLWLDOSRLQWWRH[FKDQJHWKHLQIRUPDWLRQWRDQW%1RGH
state diagram of Fig.9, one of the test sequences is "1 2 3 11 13 14 16 22 23
7KHQDQW$JRHVEDFNWRWKHLQLWLDOSRLQWWRH[FKDQJHWKHLQIRUPDWLRQWRDQW%1RGH
24 25 26 29 30 32 33 LVQRIRRGDQGWKHQDQW%ZLOOJRWRQRGHDQGILQGVWKDWIRUNLQWKHURDG$QW%
LVQRIRRGDQGWKHQDQW%ZLOOJRWRQRGHDQGILQGVWKDWIRUNLQWKHURDG$QW%
34 36". Assuming that the ant A finds "no food" in node 3 during foraging
FRPHVWRQRGHILQGLQJWKDWWKHQH[WQRGHLVQRGHDQGWKHQUHWXUQWRWKHLQLWLDO
FRPHVWRQRGHILQGLQJWKDWWKHQH[WQRGHLVQRGHDQGWKHQUHWXUQWRWKHLQLWLDO
process, which means the next ant need not go into the node. Then ant A goes back to the
SRLQWDQGUHFRUGWKDWQRGHVKRXOGQRWJRXQWLOWKHDQWUHDFKHVWKHHQG$VVXPLQJ
SRLQWDQGUHFRUGWKDWQRGHVKRXOGQRWJRXQWLOWKHDQWUHDFKHVWKHHQG$VVXPLQJ
WKDWLQDFHUWDLQVWDWHQRGHQRGHQRGHDQGQRGHDUHGHDGDFFRUGLQJWRWKH
initial point to exchange the information to ant B. Node 3 is no food and then ant B will go to
WKDWLQDFHUWDLQVWDWHQRGHQRGHQRGHDQGQRGHDUHGHDGDFFRUGLQJWRWKH
DERYHSURFHVVZHNQRZWKDWWKHUHPDLQLQJWHVWVHTXHQFHVVXFKDV³
node 6 and finds thatDERYHSURFHVVZHNQRZWKDWWKHUHPDLQLQJWHVWVHTXHQFHVVXFKDV³
fork in the road. Ant B comes to node 7, finding that the next node is
´³
´³
node 3, and then return to the initial point and record that node 7 should not go, until the ant
´³
´³
´³
reaches the end. Assuming that in a certain state, node 3, node 15, node 17 and node 25 are
´³
´)URPWKHVHIRXUWHVWVHTXHQFHVLQRUGHUWRILQGWKHVKRUWHVWWHVWVHTXHQFHDIWHU
dead, according to´)URPWKHVHIRXUWHVWVHTXHQFHVLQRUGHUWRILQGWKHVKRUWHVWWHVWVHTXHQFHDIWHU
the above process, we know that the remaining 4 test sequences, such as "2
FRPSDULQJRQHE\RQHVHTXHQFH³
4 5 6 9 10 11 12 13FRPSDULQJRQHE\RQHVHTXHQFH³
´ZLOOEHLGHQWLILHGDQGWKLVWHVWVHTXHQFHFRQWDLQVWKHOHDVWWHVWFDVHV
14 16 22 23 24 27 28 29 30 32 33 34 36", "1 2 4 5 6 9 10 11 12 13 14 16 22
´ZLOOEHLGHQWLILHGDQGWKLVWHVWVHTXHQFHFRQWDLQVWKHOHDVWWHVWFDVHV
)URPWKHVLPSOLILHGVWDWHVSDFHUHDFKDEOHJUDSKWKHSURJUDPPD\XVHGWR
23 24 27 28 29 31 30JHQHUDWHWKHWHVWFDVHVDVVKRZQLQ7DEOH
32 33 34 36", "1 2 4 5 6 9 10 
11 12 13 14 16 22 23 24 27 28 29 31 30 32 33

35 34 36", "1 2 4 5 6 9 10 11 12 13 14 16 22 23 24 27 28 29 30 32 33 35 34 36". From these four
test sequences, in order

to find the shortest test sequence, after comparing one by one, sequence
"1 2 4 5 6 9 10 11 12 13 14 16 22 23 24 27 28 29 30 32 33 34 36" will be identified and this test
sequence contains the least test cases.
From the simplified state space reachable graph, the program may used to generate the test
cases, as shown in Table 2.

From the results, the scenario 1 generates test subsequence ¬(1 2 4 5 6 9 10 11 12 13 14 16 22);
test subsequence ­(22 23 24 27 28 29) is generated by scenario 2; test subsequence ®(29 31 30
32) and test subsequence ¯ (29 30 32) are for the scenario 3; test subsequence °(32 33 34 36)
and test subsequence ±(32 33 35 34 36) are for the scenario 4. Based on the improved ant colony
Automated Test Sequence Optimization Based on the
Maze Algorithm and Ant Colony Algorithm 601
7DEOH  7HVWVXEVHTXHQFHVRIWKHVFHQDULRV
7DEOH  7HVWVXEVHTXHQFHVRIWKHVFHQDULRV
6FHQDULRV *HQHUDWHGWHVWVXEVHTXHQFHV
6FHQDULRV *HQHUDWHGWHVWVXEVHTXHQFHV
 
Table  2: Test subsequences of the scenarios

 7DEOH  7HVWVXEVHTXHQFHVRIWKHVFHQDULRV

 
6FHQDULRV
 *HQHUDWHGWHVWVXEVHTXHQFHV

 
 
 

 

 
)URPWKHUHVXOWVWKHVFHQDULRJHQHUDWHVWHVWVXEVHTXHQFH
)URPWKHUHVXOWVWKHVFHQDULRJHQHUDWHVWHVWVXEVHTXHQFH ķ ķ 

 

 WHVWVXEVHTXHQFH
WHVWVXEVHTXHQFH ĸ 
ĸ LVJHQHUDWHGE\VFHQDULR
LVJHQHUDWHGE\VFHQDULR

WHVWVXEVHTXHQFH
WHVWVXEVHTXHQFH Ĺ DQGWHVWVXEVHTXHQFH
Ĺ  DQGWHVWVXEVHTXHQFH ĺĺ 
 DUHIRUWKH
DUHIRUWKH
)URPWKHUHVXOWVWKHVFHQDULRJHQHUDWHVWHVWVXEVHTXHQFH ķ 
VFHQDULRWHVWVXEVHTXHQFH Ļ
VFHQDULRWHVWVXEVHTXHQFH Ļ
 DQGWHVWVXEVHTXHQFH
DQGWHVWVXEVHTXHQFH ļ ļ


algorithm proposed in thisWHVWVXEVHTXHQFH
paper, the test 
ĸsubsequences LVJHQHUDWHGE\VFHQDULR
combinations by the scenarios are shown
 DUHIRUWKHVFHQDULR%DVHGRQWKHLPSURYHGDQWFRORQ\DOJRULWKPSURSRVHGLQ
 DUHIRUWKHVFHQDULR%DVHGRQWKHLPSURYHGDQWFRORQ\DOJRULWKPSURSRVHGLQ
WHVWVXEVHTXHQFH Ĺ  DQGWHVWVXEVHTXHQFH ĺ  DUHIRUWKH
in Tab.3: WKLVSDSHUWKHWHVWVXEVHTXHQFHVFRPELQDWLRQVE\WKHVFHQDULRVDUHVKRZQLQ7DE
WKLVSDSHUWKHWHVWVXEVHTXHQFHVFRPELQDWLRQVE\WKHVFHQDULRVDUHVKRZQLQ7DE
VFHQDULRWHVWVXEVHTXHQFH Ļ  DQGWHVWVXEVHTXHQFH ļ 

 DUHIRUWKHVFHQDULR%DVHGRQWKHLPSURYHGDQWFRORQ\DOJRULWKPSURSRVHGLQ
Table 3: The test subsequences combinations
      7DEOH  7KHWHVWVXEVHTXHQFHVFRPELQDWLRQV
      7DEOH  7KHWHVWVXEVHTXHQFHVFRPELQDWLRQV
WKLVSDSHUWKHWHVWVXEVHTXHQFHVFRPELQDWLRQVE\WKHVFHQDULRVDUHVKRZQLQ7DE
7KHQXPEHURI 7KHWHVWVXEVHTXHQFHV
7KHQXPEHURI
VXEVHTXHQFH
7KHWHVWVXEVHTXHQFHV
FRPELQDWLRQV
 VXEVHTXHQFH FRPELQDWLRQV
 ķĸ Ĺ Ļ
      7DEOH
  7KHWHVWVXEVHTXHQFHVFRPELQDWLRQV
ķĸ Ĺ Ļ
 ķĸĹļ
7KHQXPEHURI
 7KHWHVWVXEVHTXHQFHV
ķĸĹļ

VXEVHTXHQFH ķĸĺĻ
FRPELQDWLRQV
 ķĸĺĻ
 ķĸĺļ
ķĸ Ĺ Ļ
  ķĸĺļ
 ķĸĹļ
$IWHUWKRVHWHVWVHTXHQFHVLVRSWLPL]HGWKHILQDORSWLPL]DWLRQWHVWVHTXHQFHVDUH
 ķĸĺĻ
After those $IWHUWKRVHWHVWVHTXHQFHVLVRSWLPL]HGWKHILQDORSWLPL]DWLRQWHVWVHTXHQFHVDUH
test sequences is optimized,
JHQHUDWHGDQGVKRZQDV7DEOH   the final optimization test sequences are
ķĸĺļ generated
and shown JHQHUDWHGDQGVKRZQDV7DEOH
as Table 4.  

7DEOH2SWLPL]DWLRQRIWKHWHVWVHTXHQFHV 
$IWHUWKRVHWHVWVHTXHQFHVLVRSWLPL]HGWKHILQDORSWLPL]DWLRQWHVWVHTXHQFHVDUH
Table 4: Optimization of the test sequences
7KHQXPEHURI 7KHWHVWVXEVHTXHQFHV
7DEOH2SWLPL]DWLRQRIWKHWHVWVHTXHQFHV  
JHQHUDWHGDQGVKRZQDV7DEOH
VHTXHQFH

FRPELQDWLRQ
7KHWHVWVHTXHQFHV
7KHQXPEHURI 7KHWHVWVXEVHTXHQFHV 
7KHWHVWVHTXHQFHV 

VHTXHQFH
 FRPELQDWLRQ
ķĸĹĻ

7DEOH2SWLPL]DWLRQRIWKHWHVWVHTXHQFHV 

 
7KHQXPEHURI ķĸĹĻ
7KHWHVWVXEVHTXHQFHV 
7KHWHVWVHTXHQFHV 
 )URPWKHDIRUHPHQWLRQHGGDWDWKHH[SHULPHQWDOUHVXOWVFRQIRUPWRWKHWKHRUHWLFDO
VHTXHQFH FRPELQDWLRQ

DQDO\VLV%\WKHLPSURYHGDQWFRORQ\DOJRULWKPIRXUWHVWVHTXHQFHVDUHJHQHUDWHGDQG
 ķĸĹĻ
)URPWKHDIRUHPHQWLRQHGGDWDWKHH[SHULPHQWDOUHVXOWVFRQIRUPWRWKHWKHRUHWLFDO

From the RSWLPL]HGWRRQHHOLJLEOHFDVHVHTXHQFHZLWKWKHPLQLPXPUHGXQGDQF\7KHWHVW
aforementioned data, the experimental results conform to the theoretical analysis.
DQDO\VLV%\WKHLPSURYHGDQWFRORQ\DOJRULWKPIRXUWHVWVHTXHQFHVDUHJHQHUDWHGDQG

UHVXOWVDUHUHDODQGHIIHFWLYHZKLFKQRWRQO\VDYHVWLPHEXWDOVRLPSURYHWKHWHVW
By the improved ant colony algorithm, four test sequences are generated and optimized to one
)URPWKHDIRUHPHQWLRQHGGDWDWKHH[SHULPHQWDOUHVXOWVFRQIRUPWRWKHWKHRUHWLFDO
RSWLPL]HGWRRQHHOLJLEOHFDVHVHTXHQFHZLWKWKHPLQLPXPUHGXQGDQF\7KHWHVW
eligible caseHIILFLHQF\JUHDWO\
sequence with the minimum redundancy. The test results are real and effective,
DQDO\VLV%\WKHLPSURYHGDQWFRORQ\DOJRULWKPIRXUWHVWVHTXHQFHVDUHJHQHUDWHGDQG
UHVXOWVDUHUHDODQGHIIHFWLYHZKLFKQRWRQO\VDYHVWLPHEXWDOVRLPSURYHWKHWHVW
7HVWJHQHUDWLRQVRIWZDUHWRROIRUWKHDQWFRORQ\DOJRULWKP
which not only RSWLPL]HGWRRQHHOLJLEOHFDVHVHTXHQFHZLWKWKHPLQLPXPUHGXQGDQF\7KHWHVW
HIILFLHQF\JUHDWO\ but also improve the test efficiency greatly.
saves time
7KLVWHVWJHQHUDWLRQVRIWZDUHWRROLVDFKLHYHGE\&ODQJXDJH,WH[HFXWHVWKH
DQWUHVXOWVDUHUHDODQGHIIHFWLYHZKLFKQRWRQO\VDYHVWLPHEXWDOVRLPSURYHWKHWHVW
7HVWJHQHUDWLRQVRIWZDUHWRROIRUWKHDQWFRORQ\DOJRULWKP
FRORQ\ DOJRULWKP DQG JHQHUDWHV WKH WHVW VHTXHQFHV )LJ VKRZV WKH PDLQ
HIILFLHQF\JUHDWO\
7KLVWHVWJHQHUDWLRQVRIWZDUHWRROLVDFKLHYHGE\&ODQJXDJH,WH[HFXWHVWKH
3.4 TestLQWHUIDFHRIWKHVRIWZDUHDQGLWUHDGVWKH;0/PRGHOIURPWKH&31PRGHODQGVKRZV
generation software tool for the ant colony algorithm
DQW 7HVWJHQHUDWLRQVRIWZDUHWRROIRUWKHDQWFRORQ\DOJRULWKP
FRORQ\ DOJRULWKP DQG JHQHUDWHV WKH WHVW VHTXHQFHV )LJ VKRZV WKH PDLQ
WKHWHVWVHTXHQFHJHQHUDWLRQIURPVHYHUDOIXQFWLRQDOVFHQDULRV
This test 7KLVWHVWJHQHUDWLRQVRIWZDUHWRROLVDFKLHYHGE\&ODQJXDJH,WH[HFXWHVWKH
generation software tool is achieved by C++ language. It executes the ant colony
LQWHUIDFHRIWKHVRIWZDUHDQGLWUHDGVWKH;0/PRGHOIURPWKH&31PRGHODQGVKRZV
algorithm and DQW FRORQ\ DOJRULWKP
generates the testDQG JHQHUDWHV WKH
sequences. WHVW VHTXHQFHV
Fig.10 shows the)LJ
WKHWHVWVHTXHQFHJHQHUDWLRQIURPVHYHUDOIXQFWLRQDOVFHQDULRV  mainVKRZV WKH PDLQ
interface of the software
and it reads theLQWHUIDFHRIWKHVRIWZDUHDQGLWUHDGVWKH;0/PRGHOIURPWKH&31PRGHODQGVKRZV
XML model from the CPN model and shows the test sequence generation from
WKHWHVWVHTXHQFHJHQHUDWLRQIURPVHYHUDOIXQFWLRQDOVFHQDULRV
several functional scenarios. 
If the top right button "reads the XML file" of the main interface is pressed, Fig.11 will appear
and show the contents of the XML files to be read.

If natural number greater than 36 is input to the top left four boxes of the screen, Fig.12 presents
the optimized test sequences generation. 



3.5 Test generation method validation
From the rules of all modules functional requirements of CTCS-3 RBC test that are made
by the Ministry of Railways, the RBC test platform is designed and the platform structure is
shown in Fig.13.
In order to verify the practicality and feasibility of the test automated generation method, an
RBC functionality test platform is developed and the generated test cases and sequences are
602 W. Zheng, N.W. Hu


)LJXUH7KHPDLQLQWHUIDFHRIWKHWHVWJHQHUDWLRQVRIWZDUHWRRO 
Figure 10: The main interface of the test generation software tool
,I WKH WRS ULJKW EXWWRQ ³UHDGV WKH ;0/ ILOH´ RI WKH PDLQ LQWHUIDFH LV SUHVVHG
)LJXUH7KHPDLQLQWHUIDFHRIWKHWHVWJHQHUDWLRQVRIWZDUHWRRO
)LJZLOODSSHDUDQGVKRZWKHFRQWHQWVRIWKH;0/ILOHVWREHUHDG  
,I WKH WRS ULJKW EXWWRQ ³UHDGV WKH ;0/ ILOH´ RI WKH PDLQ LQWHUIDFH LV SUHVVHG
)LJZLOODSSHDUDQGVKRZWKHFRQWHQWVRIWKH;0/ILOHVWREHUHDG  


)LJXUH&RQWHQWVRIWKH;0/ILOHV  
 )LJXUH&RQWHQWVRIWKH;0/ILOHV 
 Figure 11: Contents of the XML files
,IQDWXUDOQXPEHUJUHDWHUWKDQLVLQSXWWRWKHWRSOHIWIRXUER[HVRIWKHVFUHHQ
,IQDWXUDOQXPEHUJUHDWHUWKDQLVLQSXWWRWKHWRSOHIWIRXUER[HVRIWKHVFUHHQ
)LJSUHVHQWVWKHRSWLPL]HGWHVWVHTXHQFHVJHQHUDWLRQ
)LJSUHVHQWVWKHRSWLPL]HGWHVWVHTXHQFHVJHQHUDWLRQ

 
 

)LJXUH7HVWVHTXHQFHRSWLPL]DWLRQJHQHUDWLRQLQWHUIDFH 
7HVWJHQHUDWLRQPHWKRGYDOLGDWLRQ
Figure 12: Test sequence optimization generation interface
)URPWKHUXOHVRIDOOPRGXOHVIXQFWLRQDOUHTXLUHPHQWVRI&7&65%&WHVWWKDW
DUHPDGHE\WKH0LQLVWU\RI5DLOZD\VWKH5%&WHVWSODWIRUPLVGHVLJQHGDQGWKH
SODWIRUPVWUXFWXUHLVVKRZQLQ)LJ

(TXLSPHQWXQGHUWHVW
,QWHUIDFHHTXLSPHQW
7HVWSODWIRUPPRGXOH

)LJXUH7HVWVHTXHQFHRSWLPL]DWLRQJHQHUDWLRQLQWHUIDFH 
Automated Test Sequence Optimization Based on the
7HVWJHQHUDWLRQPHWKRGYDOLGDWLRQ
Maze Algorithm and Ant Colony Algorithm
)URPWKHUXOHVRIDOOPRGXOHVIXQFWLRQDOUHTXLUHPHQWVRI&7&65%&WHVWWKDW 603
DUHPDGHE\WKH0LQLVWU\RI5DLOZD\VWKH5%&WHVWSODWIRUPLVGHVLJQHGDQGWKH
SODWIRUPVWUXFWXUHLVVKRZQLQ)LJ

(TXLSPHQWXQGHUWHVW
,QWHUIDFHHTXLSPHQW
7HVWSODWIRUPPRGXOH

Juridical recorder Local terminal

5%&XQGHUWHVW
Interface
ISDN server
server
CTC
interface

Neighbor RBC
TSRS interface CBI interface interface
0HVVDJH 0HVVDJH 0HVVDJH
0HVVDJH 0HVVDJH

Tracksidesafetyprotocoladapter 0HVVDJH
'DWD

TMS

TMGS TSRGS CBIGS NRBCGS CTCGS SC


)LJXUH)UDPHZRUNRIWKH5%&WHVWSODWIRUP 
 Figure 13: Framework of the RBC test platform
,QRUGHUWRYHULI\WKHSUDFWLFDOLW\DQGIHDVLELOLW\RIWKHWHVWDXWRPDWHGJHQHUDWLRQ
PHWKRGDQ5%&IXQFWLRQDOLW\WHVWSODWIRUPLVGHYHORSHGDQGWKHJHQHUDWHGWHVWFDVHV
injected to test.DQGVHTXHQFHVDUHLQMHFWHGWRWHVW 
7KLV5%&WHVWSODWIRUPFRQVLVWVRIVFHQDULRFRQWUROOHU
This RBC test platform consists of scenario controller (SC), 6&theWKHFHQWUDOL]HGWUDIILF
centralized traffic control gener-
FRQWUROJHQHUDWLRQVLPXODWRU &7&*6 WKHWUDLQPHVVDJHJHQHUDWLRQVLPXODWRU
ation simulator (CTCGS), the train message generation simulator
70*6 WKHFRPSXWHUEDVHGLQWHUORFNLQJJHQHUDWLRQVLPXODWRU &%,*6 WKH
(TMGS), the computer-based
interlocking generation simulator
1HLJKERULQJ5%& 15%&(CBIGS), the Neighboring
JHQHUDWLRQVLPXODWRU RBC (NRBC) generation simula-
15%&*6 WKHWHPSRUDU\VSHHG
tor (NRBCGS),UHVWULFWLRQJHQHUDWLRQVLPXODWRU
the temporary speed restriction 765*6 DQGWKHWUDLQPRYHPHQWVLPXODWRU
generation simulator (TSRGS), 706  and the train
movement simulator (TMS). Five subsystems (except

the SC and the TMS) only have message
interaction with the RBC under test, and six subsystems (except the SC) have no communication
with each other. The SC can control the whole test process and the data for these six subsystems
during the test process come from the SC and the SC can directly read the XML test cases and
sequences files to get the test data.

Figure 14: The control interface screen of the SC

The control interface screen of the SC is shown in Fig.14. During the test process, the XML
files has the distinguished characteristics, such as understandability, platform independence, the
formatted structure, and the ability of hierarchical data description [16] . /citeli and it contains
all the test data and can be directly read by the SC, which makes the test process automatically.
If a test begins, the involved subsystems and the optional test sequence should be selected first.
When the button "Finish" is pressed, the SC will load the XML configuration document and
distribute the data to the corresponding subsystems. Then, each subsystem begins to communi-
604 W. Zheng, N.W. Hu

cate with the RBC under test until the test process is an error or until the test is normally over.
The optimal test sequence with XML format generated by the proposed algorithm is applied in
the RBC test platform. Part of the key interaction interface data are shown in Tab.5, including
the interaction message from the operation scenario "registration and start", "RBC handover"
and "Logout"

Table 5: Test data of the RBC platform validation process


2SHUDWLRQVFHQDULR5HJLVWUDWLRQDQGVWDUW

'DWDBLG 7HVW6HTB,' 7LPH (YHQW 'LUHFWLRQ 0VJB,' 0HDQLQJRI0VJB,' 0VJ'DWDBELW


   5XQQLQJ 7UDLQė5%&  &RPPXQLFDWLRQEHJLQV %&%)
   5XQQLQJ 7UDLQĕ5%&  6\VWHPYHUVLRQ &)))))(
   5XQQLQJ 7UDLQė5%&  &RQILUPDWLRQ (%&
   5XQQLQJ 7UDLQė5%&  &RPPXQLFDWLRQVHWVXS )(&%)
   5XQQLQJ 7UDLQĕ5%&  *HQHUDOLQIRUPDWLRQ &()))))(
   5XQQLQJ 7UDLQė5%&  7UDLQGDWD &(%&
   5XQQLQJ 7UDLQĕ5%&  7UDLQGDWDFRQILUPDWLRQ (%)))))(
2SHUDWLRQVFHQDULR5%&KDQGRYHU
'DWDBLG 7HVW6HTB,' 7LPH (YHQW 'LUHFWLRQ 0VJB,' 0HDQLQJRI0VJB,' 0VJ'DWDBELW
   5XQQLQJ 7UDLQĕ5%&  0RYHPHQWDXWKRULW\ )(()
   5XQQLQJ 7UDLQė5%&  7UDLQORFDWLRQ &
   5XQQLQJ 15%&ė5%&  +DQGRYHUDQQRXQFHPHQW &&
   5XQQLQJ 15%&ĕ5%&  5HSO\ &'&&$&
   5XQQLQJ 15%&ė5%&  0RYHPHQWDXWKRULW\UHTXHVW &$&
   5XQQLQJ 15%&ė5%&  5HSO\ &'&&$&
   5XQQLQJ 15%&ė5%&  ,QIRUPDWLRQUHTXHVW ''%&&$&
2SHUDWLRQVFHQDULR/RJRXW
'DWDBLG 7HVW6HTB,' 7LPH (YHQW 'LUHFWLRQ 0VJB,' 0HDQLQJRI0VJB,' 0VJ'DWDBELW
   5XQQLQJ 7UDLQė5%&  &RPPXQLFDWLRQWHUPLQDWHV &('&%)
   5XQQLQJ 7UDLQĕ5%&  &RQILUPDWLRQ ('()
   5XQQLQJ 7UDLQĕ5%&  &RQILUPDWLRQ ('()

In Table 5, "Msg_ID" records the message ID, and "MsgData_bit" records the content of
messages. Taking operation scenario "registration and start" as the example, firstly, the train
send Message 155 to RBC, presenting "the communication begins"; Then the RBC send Message
32 to the train, informing the "system version" . After the train confirms the same system version
with Message 146, it sends Message 159 to RBC, meaning "the communication sets up". Then
the RBC sends general Message 24 to train, presenting the successful communication. Finally,
the train set train data Message 129 to RBC and after the RBC uses Message 8 to confirm
the train data, the train may start. Thus, the practicality and feasibility of the test automated
generation method are verified.

4 Conclusion

This paper has put forward a more efficient improved ant colony algorithm integrated with
the maze algorithm, which not only completes the automatic generation of test sequence but
also greatly improves the test efficiency. The RBC test platform is designed to validate the
effectiveness of the optimal test sequences. Although only four train operation scenarios are
employed as the example, the proposed algorithm can be applied on all the other operation
scenarios described in the high-speed railway system requirement specification. This approach
is able to effectively improve the test efficiency, lower the test difficulty, and achieve the goal of
test automation.
Automated Test Sequence Optimization Based on the
Maze Algorithm and Ant Colony Algorithm 605

Acknowledgment
This paper has been supported by the High-speed Railway United Fund of National Natural
Science Foundation of China(U1434209).

Bibliography
[1] System Requirements Specification of the CTCS-3 Train Control System(v1.0). The Min-
istry of Railways of The People’s Republic of China, Beijing: China Railway Publishing
House,2008. (in Chinese)

[2] Behrmann, G.; Larsen, K. G. et al (2001); Uppaal-present and future, Decision and Control,
Proceedings of the 40th IEEE Conference on, 3: 2881-2886.

[3] Samuel, P.; Joseph, A. T. (2008); Test Sequence Generation from UML Sequence Diagrams,
Ninth ACIS International Conference on Software Engineering, Artificial Intelligence, Net-
working, and Parallel/Distributed Computing, 879-887.

[4] Hessel, A.; Pettersson, P. (2004); A Test Case Generation Algorithm for Real-Time Systems,
Quality Software, 2004. QSIC 2004. Proceedings. Fourth International Conference on, 268-
273.

[5] Lee, J.D. et al (2007); Verification and Conformance Test Generation of Communication
Protocol for Railway Signaling Systems, Computer Standards and Interfaces, 29(3): 143-151.

[6] Zhao, X.; Li, K.; Tang, T.; Yuan, L. (2010); Study and Application of UML Based CTCS-3
Operational Scenarios Analysis Approach, Railway Signalling and Communication, 8(2): 4-8.

[7] Jaafar, M.F.; Selamat, M.H.; Ghani, A. (2006); TCML-an XML-based test case format,
Computing & Informatics, ICOCI’06, International Conference on, 1-4.

[8] Dorigo, M. (1992); (1992); Optimization, Learning and Natural Algorithms, Ph.D. Thesis,
Dip. Elettronica e Informazione, Politecnico di Milano, Italy.

[9] Wu, H.F.; Chen, X.Q. et al (2013); Improved Ant Colony Algorithm Based on Natural
Selection Strategy for Solving tsp Problem, Journal on Communications, 34(4): 165-170.

[10] Wang, J.; Wang J. (2008); An Improved Ant Colony Algorithm for Solving tsp Problem,
Computer Technology and Development, 18(2): 50-52.

[11] Jensen, K. (1994); An Introduction to the Theoretical Aspects of Colored Petri Nets,
Springer Berlin Heidelberg.

[12] Shaffer, C.A. (2011); Data Structures & Algorithm Analysis in C++, 3rd ed. New York,
NY, USA: Dover, 390-394.

[13] Hu, N.W.; Zheng, W. (2014); The Improved Ant Colony Algorithm Test Sequence Opti-
mization Based on the RBC Test Platform, Intelligent Transportation Systems (ITSC), 2014
IEEE 17th International Conference on, IEEE, 2014: 2261-2261

[14] Farooq, U.; Lam, C.P.; Li, H. (2008); Towards Automated Test Sequence Generation, Soft-
ware Engineering, 2008. ASWEC 2008. 19th Australian Conference on, IEEE, 2008: 441-450
606 W. Zheng, N.W. Hu

[15] *** Functional Requirements Specification of the CTCS-3 Train Control System (v1.0), The
Ministry of Railways of The People’s Republic of China, China Railway Publishing House,
Beijing, China, No. 113, 2008.

[16] Chawathe, S.S. (2004); Real-Time Traffic-Data Analysis, Intelligent Transportation Systems
Proceedings. The 7th International IEEE Conference on, IEEE, 112-117.

[17] Li, R.M.; Lu, H.P.; Qian, Z.; Shi, Q.X. (2005), Research of in the integrated transportation
information platform based on XML, Intelligent Transportation Systems, 2005. Proceedings,
IEEE, 498-503.

You might also like