为了提高大规模软件的测试效率,提出了基于禁忌搜索算法的测试用例自动生成方法。对软件测试要求及其目标进行了分析,依此对禁忌搜索算法的评价函数、邻域移动、禁忌表进行了改进,并设计了合理的赦免准则和终止准则。在此基础上构建了基于禁忌搜索算法测试用例生成的模型,产生测试用例来驱动插桩程序运行并求其评价值,采用禁忌搜索算法进行优化。通过生成三角形判断程序的测试用例实验,验证了该方法的准确性和有效性。
In order to improve the efficiency of large-scale software testing, automated test case generation based on improved tabu search algorithm is presented. Firstly, the requirements and goals of software testing are analyzed, and so fitting function, neighborhood and tabu list are improved. Aspiration criterion and termination criterion are designed at the same time. Then the test case generation model is constructed. Next, generate test cases to drive the instrumented program and compute their cost values. Finally, tabu search algorithm is used to optimize test cases. Moreover, the generator is implemented to the triangle classifier program. Experimental results show that the test case generator is efficient and effective.