测试数据自动生成方法是软件测试领域研究的热点.基于遗传算法的启发式搜索算法是一种路径覆盖生成测试数据的方法.文中提出了一种基于自适应随机测试(Adaptive Random Testing,ART)算法更新种群的方法,将ART融入遗传算法,优化选择操作,动态更新种群,从而增加种群进化过程中的个体多样性,提高了收敛速度,有效地减少了陷入局部最优.实验结果显示,与传统遗传算法生成测试数据的方法相比,改进的算法明显提高了路径覆盖率,减少了种群平均进化代数.
Method of Generating Test Data by Genetic Algorithm Based on ART Optimal Selection Strategy
Automatic generation of test data is a hot topic in the field of software testing.The heuristic search algorithm based on genetic algorithm is a method to generate test data by path coverage.In this paper,a method based on adaptive random testing(ART)to update population is proposed.ART is integrated into genetic algorithm to optimize the selection operation and dyna-mically update the population.As a result,the individual diversity in the process of population evolution is increased,the conver-gence speed is improved,and the falling into local optimum is effectively reduced.Experimental results show that the path cove-rage is significantly improved and the average number of generations is effectively reduced.
Software testingTest data generationGenetic algorithmPath coverageAdaptive random testing(ART)