
Improvements of Directed Automated Random Testing
in Test Data Generation for C++ Projects
Duc-Anh Nguyen
*
, Tran Nguyen Huong
†
, Hieu Vo Dinh
‡
and Pham Ngoc Hung
§
VNU University of Engineering and Technology
Hanoi, Vietnam
*
nguyenducanh@vnu.edu.vn
†
17028005@vnu.edu.vn
‡
hieuvd@vnu.edu.vn
§
hungpn@vnu.edu.vn
Received 21 July 2018
Revised 26 August 2018
Accepted 8 February 2019
This paper improves the breadth-¯rst search strategy in directed automated random testing
(DART) to generate a fewer number of test data while gaining higher branch coverage, namely
Static DART or SDART for short. In addition, the paper extends the test data compilation
mechanism in DART, which currently only supports the projects written in C, to generate test
data for C++ projects. The main idea of SDART is when it is less likely to increase code
coverage with the current path selection strategies, the static test data generation will be
applied with the expectation that more branches are covered earlier. Furthermore, in order to
extend the test data compilation of DART for C++ context, the paper suggests a general test
driver technique for C++ which supports various types of parameters including basic types,
arrays, pointers, and derived types. Currently, an experimental tool has been implemented
based on the proposal in order to demonstrate its e±cacy in practice. The results have shown
that SDART achieves higher branch coverage with a fewer number of test data in comparison
with that of DART in practice.
Keywords: Directed automated random testing; concolic testing; test data compilation; test
data generation; control °ow graph; C++; SMT-Solver.
1. Introduction
Unit testing has been considered an important phase to ensure the high quality of
software, especially for the system software written in C++ due to the painstaking
requirements of quality. Two well-known approaches for unit testing are black-box
testing and white-box testing [22]. Black-box testing only focuses on the correctness
of input and output without considerations about its source code. In contrast,
§
Corresponding author.
International Journal of Software Engineering
and Knowledge Engineering
Vol. 29, No. 9 (2019) 1279–1312
#
.
cWorld Scienti¯c Publishing Company
DOI: 10.1142/S0218194019500402
1279