A Hybrid Method for Test Data Generation for Unit Testing of C/C++ Projects

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