[关键词]
[摘要]
结构性测试是标识测试用例的基本方法之一.由于程序语言的复杂性以及被测程序的多样性,自动生成结构测试数据的一种有效方法是根据程序运行结果指导生成过程,通过不断迭代,生成符合要求的测试数据集.提出一种基于Messy GA的结构测试数据自动生成方法,将测试覆盖率表示为测试输入集X的函数F(X),并利用Messy GA不需要染色体模式排列的先验知识即可进行优化求解的性质对F(X)进行迭代寻优,进一步提高了搜索的并行性,并最终提高测试覆盖率.对一组标准测试程序和若干实际应用程序的实验结果表明,较之现有基于遗传算法的生成方法,该方法能够以更高的效率生成更高质量的测试数据,并适用于较大规模的程序.
[Key word]
[Abstract]
Structural testing is one of the basic approaches for identifying test cases. Because of complexity of programming languages and variety of applications, an efficient approach to automated generation of structural test data is to breed search iteratively by profiling of program execution. Based on Messy GA, an automated approach for generating such data is proposed in this paper by solving F(X), a test coverage function of test data set. It utilizes Messy GA’s prominent feature that can optimize complicated problems without prior knowledge about schema arrangement in chromosomes, so that it can improve concurrency level of searching and test coverage. Compared with other approaches based on GA, the experimental results for several typical programs and real-world applications show that it can generate higher quality test data more efficiently, and can be applied to larger applications.
[中图分类号]
[基金项目]
Supported by the National Hi-Tech Research and Development Program of China under Grant No.2004AA1Z2100 (国家高技术研究发展计划(863)); the Program of the Chinese Academy of Sciences for One Hundred Talents under Grant No.BCK35873 (中国科学院百人计划)