Abstract:The generation of test data is an important part of achieving software test automation. In order to improve the quality and efficiency of test data generation in unit testing, a test data generation algorithm based on shuffled frog leaping algorithm is proposed. The algorithm introduces a dynamic threshold to control the moving step size of individuals, so as to balance the global exploration and local exploitation abilities. At the same time, the worst individual random jump strategy in the standard algorithm is transformed into learning from random individual to enhance the information exchange between populations to improve the algorithm′s global search capability. Apply the improved algorithm to test data generation. The experimental results show that the improved shuffled frog leaping algorithm is more stable than the standard shuffled frog leaping algorithm, cuckoo search algorithm and particle swarm optimization algorithm under the condition of changing population size. The improved shuffled frog leaping algorithm is better than the comparison algorithm in the evaluation index of the average number of iterations generated by the test data.