Computational Intelligence - May 2017 - 47

Han Huang, Fangqing Liu, and Xiaoyan Zhuo
School of Software Engineering, South China University of Technology,
Guangzhou, China

Zhifeng Hao
School of Mathematics and Big Data, Foshan University, Foshan, China

every logic path of a given program should be covered (checked)
through testing. Path testing can significantly strengthen the process of identification of software bugs.The key is to find test cases
that can cover as many paths as possible (i.e., path coverage).
Automated test case generation for path coverage (ATCG-PC)
has attracted much research attention in the field of software
engineering since it was proposed [9].
The goal of ATCG-PC is to achieve path coverage by using
automated test case generation in a cost-efficient way. The cost
can be evaluated by the number of generated test cases and is
proportional to the computational effort of testing. It is known
[2], [3] that ATCG-PC can be modeled as an NP-complete
combinatorial optimization problem, which minimizes the
number of test cases while satisfying the path coverage requirement. Due to its NP-completeness, the ATCG-PC problem is
hard to solve. In particular, the difficulty in solving ATCG-PC
comes from two aspects. First, with regard to path coverage, the
relationship between the input (test case) and output (path) is
usually unknown, which means that it may require many
attempts before finding a test case suitable for covering a logic
path. Second, the relationship between the covered and uncovered paths is unclear, which means that it is difficult to figure
out uncovered paths with the covered ones. Intuitively, the process of test case generation (i.e., solving ATCG-PC) would be
efficient, if some heuristic information can be extracted from
the covered paths and used to guide generated test cases for
uncovered paths. However, due to the above-mentioned two
aspects, it is challenging to design an efficient algorithm for
ATCG-PC. This motivates our work.
Our study is summarized as follows.
1) We propose a self-adaptive fitness function and design a
modified differential evolution (DE) [4] algorithm for
ATCG-PC. The proposed self-adaptive fitness function
can reveal more information about the relationship
between the covered paths and uncovered paths.

Corresponding Author: Han Huang (E-mail: hhan@scut.edu.cn).

2) We conduct experimental analysis on eight benchmark
problems of ATCG-PC and verify that our proposed
algorithm can outperform the state-of-the-art solutions
for ATCG-PC.
The remainder of this paper is organized as follows. Section II
introduces the problem, followed by a brief review of ATCGPC. Section III presents the proposed self-adaptive fitness
function. Section IV introduces the modified DE algorithm.
Section V presents the results of the experiment. Section VI is
the conclusion.
II. Automated Test Case Generation

Given a system under test (SUT), software testing mainly aims
to detect as many faults as possible [5]. To measure the quality of
software testing, this study adopts path coverage as the adequacy
criteria, which will be defined first in this section. Then, based
on the path coverage, we formulate the optimization problem of
ATCG-PC in Subsection II.A. Furthermore, the related research
on ATCG-PC is briefly reviewed in Subsection II.B.
A. Problem Description

Given an SUT, we define the testing related concepts of path
and path coverage in Definition 1 and Definition 2, respectively according to [22].
Definition 1 (path): A path is a sequence of vertices, starting at some initial vertex and ending at some final vertex, where
each vertex is the branch condition of the tested program.
Definition 2 (path coverage): Path p is covered by test case x,
which means that p is generated by the execution of x.
Notice that, there may be a large number of candidate test
cases which need to be checked for a given SUT [7]. During
generation of test cases for path coverage, a tester needs to
select an optimal set of test cases at a reasonable cost and ensure
that the selected test cases meet certain coverage criteria (e.g.,
complete path coverage [22] meaning that 100% of paths are
covered by the test cases). Therefore, generating test cases for
path coverage can be modeled as a search or optimization
problem [6], which is to pick a minimal number of test cases

may 2017 | IEEE ComputatIonal IntEllIgEnCE magazInE

47



Table of Contents for the Digital Edition of Computational Intelligence - May 2017

Computational Intelligence - May 2017 - Cover1
Computational Intelligence - May 2017 - Cover2
Computational Intelligence - May 2017 - 1
Computational Intelligence - May 2017 - 2
Computational Intelligence - May 2017 - 3
Computational Intelligence - May 2017 - 4
Computational Intelligence - May 2017 - 5
Computational Intelligence - May 2017 - 6
Computational Intelligence - May 2017 - 7
Computational Intelligence - May 2017 - 8
Computational Intelligence - May 2017 - 9
Computational Intelligence - May 2017 - 10
Computational Intelligence - May 2017 - 11
Computational Intelligence - May 2017 - 12
Computational Intelligence - May 2017 - 13
Computational Intelligence - May 2017 - 14
Computational Intelligence - May 2017 - 15
Computational Intelligence - May 2017 - 16
Computational Intelligence - May 2017 - 17
Computational Intelligence - May 2017 - 18
Computational Intelligence - May 2017 - 19
Computational Intelligence - May 2017 - 20
Computational Intelligence - May 2017 - 21
Computational Intelligence - May 2017 - 22
Computational Intelligence - May 2017 - 23
Computational Intelligence - May 2017 - 24
Computational Intelligence - May 2017 - 25
Computational Intelligence - May 2017 - 26
Computational Intelligence - May 2017 - 27
Computational Intelligence - May 2017 - 28
Computational Intelligence - May 2017 - 29
Computational Intelligence - May 2017 - 30
Computational Intelligence - May 2017 - 31
Computational Intelligence - May 2017 - 32
Computational Intelligence - May 2017 - 33
Computational Intelligence - May 2017 - 34
Computational Intelligence - May 2017 - 35
Computational Intelligence - May 2017 - 36
Computational Intelligence - May 2017 - 37
Computational Intelligence - May 2017 - 38
Computational Intelligence - May 2017 - 39
Computational Intelligence - May 2017 - 40
Computational Intelligence - May 2017 - 41
Computational Intelligence - May 2017 - 42
Computational Intelligence - May 2017 - 43
Computational Intelligence - May 2017 - 44
Computational Intelligence - May 2017 - 45
Computational Intelligence - May 2017 - 46
Computational Intelligence - May 2017 - 47
Computational Intelligence - May 2017 - 48
Computational Intelligence - May 2017 - 49
Computational Intelligence - May 2017 - 50
Computational Intelligence - May 2017 - 51
Computational Intelligence - May 2017 - 52
Computational Intelligence - May 2017 - 53
Computational Intelligence - May 2017 - 54
Computational Intelligence - May 2017 - 55
Computational Intelligence - May 2017 - 56
Computational Intelligence - May 2017 - 57
Computational Intelligence - May 2017 - 58
Computational Intelligence - May 2017 - 59
Computational Intelligence - May 2017 - 60
Computational Intelligence - May 2017 - 61
Computational Intelligence - May 2017 - 62
Computational Intelligence - May 2017 - 63
Computational Intelligence - May 2017 - 64
Computational Intelligence - May 2017 - 65
Computational Intelligence - May 2017 - 66
Computational Intelligence - May 2017 - 67
Computational Intelligence - May 2017 - 68
Computational Intelligence - May 2017 - 69
Computational Intelligence - May 2017 - 70
Computational Intelligence - May 2017 - 71
Computational Intelligence - May 2017 - 72
Computational Intelligence - May 2017 - Cover3
Computational Intelligence - May 2017 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202311
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202308
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202305
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202302
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202211
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202208
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202205
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202202
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202111
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202108
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202105
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202102
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202011
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202008
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202005
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202002
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201911
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201908
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201905
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201902
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201811
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201808
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201805
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201802
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter12
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall12
https://www.nxtbookmedia.com