Test Data Generation of Path Coverage Based on Negative Selection Genetic Algorithm
XIA Chun-yan1, ZHANG Yan1, WAN Li2, SONG Yan1, XIAO Nan1, GUO Bing1
1. School of Computer and Information Technology, Mudanjiang Normal University, Mudanjiang, Heilongjiang 157012, China;
2. Tianjin University Division of Intelligence and Computing, Tianjin University, Tianjin 300350, China
Abstract:Path coverage is one of the most important testing methods in the field of software testing.It is a challenging problem to find a set of test data to satisfy the path coverage in the search space.Therefore,automatically generating test data is a key issue in software testing.In this paper,a generation method of test data based on the negative selection genetic algorithm is proposed.The negative selection strategy is integrated into the genetic algorithm,and the population data of the genetic algorithm is dynamically optimized,and the test data covering the target path is automatically generated.The experimental results show that compared with the random method and the genetic algorithm,the proposed method can improve the path coverage and reduce the generation of redundant test data.
[1] Mei Jia,Wang Sheng-yuan.An improved genetic algorithm for test cases generation oriented paths[J].Chinese Journal of Electronics,2014,23(3):494-498.
[2] Omur Sa-hin,Bahriye Akay.Comparisons of metaheuristic algorithms and fitness functions on software test data generation[J].Applied Soft Computing,2016,49:1202-1214.
[3] Ghiduk A S.Automatic generation of basis test paths using variable length genetic algorithm[J].Information Processing Letters,2014,114(6):304-316.
[4] 夏春艳,张岩,宋丽.基于节点概率的路径覆盖测试数据进化生成[J].软件学报,2016,27(4):802-813. XIA Chun-yan,ZHANG Yan,SONG Li.Evolutionary generation of test data for paths coverage based on node probability[J].Journal of Software,2016,27(4):802-813.(in Chinese)
[5] 单锦辉,王戟,齐治昌.面向路径的测试数据自动生成方法述评[J].电子学报,2004,32(1):109-113. SHAN Jin-hui,WANG Ji,QI Zhi-chang.Survey on path-wise auto-matic generation of test data[J].Acta Electronica Sinica,2004,32(1):109-113.(in Chinese)
[6] 吴川,巩敦卫,姚香娟.基于分支覆盖的回归测试路径选择[J].软件学报,2016,27(4):839-854. WU Chuan,GONG Dun-wei,YAO Xiang-juan.Selection of paths for regression testing based on branch coverage[J].Journal of Software,2016,27(4):839-854.(in Chinese)
[7] 杨波,吴际,刘超.基于变量影响分析与数据变异的回归测试用例生成[J].计算机学报,2016,39(11):2372-2387. YANG Bo,WU Ji,LIU Chao.An approach of regression test case generation based on variable impact analysis and data mutation[J].Chinese Journal of Computers,2016,39(11):2372-2387.(in Chinese)
[8] Chang-ai Sun,Fei-fei Xue,Huai Liu,Xiang-yu Zhang.A path-aware approach to mutant reduction in mutation testing[J].Information and Software Technology,2017,81:65-81.
[9] Pedro Reales Mateo,Macario Polo Usaola.Reducing mutation costs through uncovered mutants[J].Software Testing,Verification and Reliability,2015,25:464-489.
[10] 张功杰,巩敦卫,姚香娟.基于统计占优分析的变异测试[J].软件学报,2015,26(10):2504-2520. ZHANG Gong-jie,GONG Dun-wei,YAO Xiang-juan.Mutation testing based on statistical dominance analysis[J].Journal of Software,2015,26(10):2504-2520.(in Chinese)
[11] Gwan Hwan Hwang,Heng-yi Lin,Shao-yan Lin,Che-sheng Lin.Statement-coverage testing for concurrent programs in reachability testing[J].Journal of Information Science and Engineering,2014,30:1095-1113.
[12] Tian Tian,Dun-wei Gong.Test data generation for path coverage of message-passing parallel programs based on co-evolutionary genetic algorithms[J].Automated Software Engineering,2016,23:469-500.
[13] Ali Shahbazi,James Miller.Black-box string test case generation through a multi-objective optimization[J].IEEE Transactions on Software Engineering,2016,42(4):361-378.
[14] Yeresime Suresh,Santanu Ku Rath.A genetic algorithm based approach for test data generation in basis path testing[J].The International Journal of Soft Computing and Software Engineering,2013,3(3):326-332.
[15] 张岩,巩敦卫.基于搜索空间自动缩减的路径覆盖测试数据进化生成[J].电子学报,2012,40(5):1011-1016. ZHANG Yan,GONG Dun-wei.Evolutionary generation of test data for path coverage based on automatic reduction of search space[J].Acta Electronica Sinica,2012,40(5):1011-1016.(in Chinese)
[16] 姚香娟,巩敦卫.基于路径比较的变异测试方法[J].电子学报,2012,40(1):103-107. YAO Xiang-juan,GONG Dun-wei.Mutation testing based on comparison of paths[J].Acta Electronica Sinica,2012,40(1):103-107.(in Chinese)
[17] Mohi-Aldeen S M,Mohamad R,Deris S.Application of negative selection algorithm(NSA) for test data generation of path testing[J].Applied Soft Computing,2016,49:1118-1128.
[18] 周明,孙树栋.遗传算法原理与应用[M].北京:国防工业出版社,1999.
[19] 张岩,巩敦卫.基于稀有数据拓扑的路径覆盖测试数据进化生成方法[J].计算机学报,2013,36(12):2429-2440. ZHANG Yan,GONG Dun-wei.Evolutionary generation of test data for paths coverage based on scarce data capturing[J].Chinese Journal of Computers,2013,36(12):2429-2440.(in Chinese)