Parallel software Testing Sequence Generation
Method Based on State Pruning
1
st
Tao Sun
College of Computer Science
Inner Mongolia University
Hohhot, China
cssunt@imu.edu.cn
2
nd
Ting Zhang
College of Computer Science
Inner Mongolia University
Hohhot, China
m15561836616@163.com
3
rd
Xin Guo
College of Computer Science
Inner Mongolia University
Hohhot, China
guoxin_2017@163.com
Abstract—Testing for parallel software system is very
difficult, because the number of states and execution sequences
expands significantly caused by parallel behaviors. In this paper,
a test sequences generation method based on Coloured Petri Net
(CPN) is proposed, target at full coverage of occurrences in
different orders to all behaviors under testing, and generating
non-redundant test sequences. Firstly, test objective is described
as segments of behaviors under testing, and the coverage
criterion is defined as occurrences in different orders to all
behavior under testing should be covered. Secondly, the
Projection operation is defined to get the state space subgraph
for each segment of behavior under testing, and all occurrences
of behaviors in the segment are in the subgraph, so that test
sequences could be got in the state space subgraph but not the
full state space of the system model, the efficiency has improved
to some extent. However, the state space subgraph is always big
caused by complex parallel behaviors including behaviors under
testing and other behaviors. Then State Node Pruning operation
and Arc Pruning operation are performed in the subgraph to
greatly reduce the scale of subgraph, and all states caused by
other behaviors are pruned. The simplified subgraph still covers
the occurrences in different orders to all behaviors under testing.
So test sequences can be generated in the simplified subgraph.
Finally, the FullPath operation defines the generation of all test
sequences in the subgraph after simplification. By acquiring all
sequences of each simplified subgraph and any sequence between
adjacent subgraphs, the test sequence that covers all behaviors
under testing is generated, and these test sequences do not
include any redundant sequences. The experimental results show
that this method is effective and efficient.
Keywords—Parallel Software, Coloured Petri Net (CPN),
Behavior Under Test, Testing Sequence
I. INTRODUCTION
Parallel software has become the mainstream of today's
software, many distributed and multithreaded have the
characteristics of parallel software. However, due to the
complicated execution process of parallel software, the number
of system states becomes huge. This phenomenon makes it
difficult to ensure the correctness of parallel software.
This paper argues model-based testing for parallel software
based on Coloured Petri Net (CPN). CPN is very suitable for
parallel behaviors modeling, because it is reflected in the
modeling process that the behavior of the system can be
visualized through the description of place, transition, token,
etc, and what’s more, CPN Tools supports automatic
simulation execution, analyzes the correctness of model
execution and can automatically calculate the state space.
However, the number of states in parallel software system state
space graph is still very large, so traditional testing methods on
CPN could not work well because of the large number of
states. There are some researches addressing on software
testing based on CPN, however, few of them are for parallel
software, so their testing effect for parallel software is not very
good. In [1], the literature gives a relatively simple test case
generation method, which directly calculates the state
reachable tree of system model and generates test sequences
based on traversal of tree. In [2], the literature is based on a
simple CPN model, constructs a causal relationship net which
is made up of key transitions, and extracts test input and output
to form a complete test case. In [3], the literature shows
sequence coverage criteria (branch coverage, edge cover, etc)
and parallel coverage criteria (interleaving node or edge
coverage, etc), and test sequences are generated from random
walk algorithm on the state space of CPN model. In [4], the
literature proposed a test sequence generation method target at
full covering sequence of linear behaviors under testing,
however, the method has limitation because behaviors under
testing must be linear. Overall, these methods are based on
simply searching or traversal for the state space of CPN
models. But state spaces of parallel software systems are often
large, so these methods will generate many redundant test
sequences, and the testing efficiency is low.
Based on the CPN modeling language, this paper builds a
control flow model for software requirements. The modeler
needs to point out the behaviors under testing and the related
behavior in the model, and determine the initial marking of the
model. About the work of determining the initial marking of
the model, our research group has made relevant research [5].
The test sequence generation method proposed in this paper is
based on these prerequisites. In order to solve the problem of
parallel software testing, this paper proposes a parallel software
test case generation algorithm based on state pruning. This
method realizes a test sequence with full coverage and no
redundant test sequence for the behaviors under testing.
In this paper, the CPN model established according to the
parallel software specification is called the system model. In
order to clarify the test target of this test, defining the test target
This work was supported by National Natural Science Foundation of
China under Grant No.61562064, No.61462066 and No.61661041.
446
2018 IEEE Intl Conf on Parallel & Distributed Processing with Applications, Ubiquitous Computing & Communications, Big
Data & Cloud Computing, Social Computing & Networking, Sustainable Computing & Communications
978-1-7281-1141-4/18/$31.00 ©2018 IEEE
DOI 10.1109/ISPA-IUCC-BDCloud-SocialCom-SustainCom.2018.00074