C/ c++项目单元测试中测试数据生成的混合方法

Tran Nguyen Huong
{"title":"C/ c++项目单元测试中测试数据生成的混合方法","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":"{\"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}","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

摘要

近年来,从源代码自动生成测试数据在软件测试中获得了显著的普及。本文提出了一种为C/ c++项目的单元测试生成测试数据的方法——Hybrid。该方法结合了IBVGT和WCFT两种测试数据生成方法。在IBVGT方法中,对源代码进行分析,找到简单的条件。然后,基于这些条件,IBVGT生成边界值的测试数据,而无需解决测试路径约束。这使得该方法在生成测试数据时比BVTG方法更快。在混合方法中,在使用WCFT生成测试数据的同时,收集简单的条件来生成边界值测试数据。Hybrid生成的测试数据能够保证高源代码覆盖率和错误检测能力。此外,Hybrid能够找到不可行的执行路径和死代码。使用一些常用的单元函数进行的实验结果表明,athybrid在测试数据生成时间和边界值相关误差检测方面优于STCFG方法。IBVGT在测试数据生成时间上优于BVTG,而其边界值相关的错误检测能力取决于每个单元函数内部简单条件的个数。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
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.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信