{"title":"A Hybrid Method for Test Data Generation for Unit Testing of C/C++ Projects","authors":"Tran Nguyen Huong","doi":"10.25073/2588-1086/vnucsce.354","DOIUrl":null,"url":null,"abstract":"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.","PeriodicalId":416488,"journal":{"name":"VNU Journal of Science: Computer Science and Communication Engineering","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-12-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"VNU Journal of Science: Computer Science and Communication Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.25073/2588-1086/vnucsce.354","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
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.