Tran Nguyen Huong, Do Minh Kha, Hoang -Viet Tran, Pham Ngoc Hung

Main Article Content

Abstract

In recent years, automated test data generation from source code has gained a significant popularity in software testing. This paper proposes a method, named Hybrid, to generate test data for unit testing C/C++ projects. The method is a combination of two test data generation methods named IIBVTG and WCFT. In IBVTG method, the source code is analyzed to find simple conditions. Then, bases on these conditions, IBVTG generates test data for boundary values without having to solve test paths constraints. This makes the method faster than BVTG method when generating test data. In Hybrid method, while generating test data using WCFT, simple conditions are collected for boundary values test data generation. Test data generated by Hybrid are able to ensure both high source code coverage and error detection ability. In addition, Hybrid is capable of finding infeasible execution paths and dead code. Experimental results with some popular unit functions show that Hybrid outperforms STCFG method in terms of test data generation time and boundary values related error detection. IBVTG is superior to BVTG in term of test data generation time whilst its boundary values related error detection ability depends on the number of simple conditions inside each unit function.


Keywords: Unit testing, test data generation, concolic testing, weighted CFG, boundary value analysis.