从计算资源优化、多路径适应度评价和测试路径间信息交换三个方面,对多路径粒子群优化测试用例自动生成的一般方法进行了分析。针对软件结构性测试多路径粒子群优化多路径覆盖中存在的问题,提出多路径粒子群优化自动测试用例生成算法。定义了多路径适应度函数,以解决多路径环境下的测试用例适应度测量问题;提出适应度决策矩阵,使测试用例可以在待测路径间交换信息和优化计算资源,并引导测试种群实现对多路径的覆盖。实验表明,所提算法节约了多路径粒子群优化多路径测试用例生成的计算资源,提高了算法的路径覆盖率。
The general method of multi-path Particle Swarm Optimization(PSO) test case generation algorithm was analyzed from the perspectives of the computing resource optimization,the multi-path fitness evaluation,and the information sharing among the testing paths.To deal with the problems existing in PSO multi-path covering optimization on software testing,Multi-Path oriented PSO automatic test case generation algorithm(MPPSO) was proposed.In MPPSO,the multi-path fitness function was defined to solve the test case fitness on the multi-path environment and the fitness decision matrix was proposed to make the test case optimize computing resource and exchange information between test paths.The example results showed that MPPSO reduced the resource consumption in computing and improved the multipath coverage.