Automatic Generation Method of Test Data for Software Structure Based on PSO
Yanli Zhang · Jisuanji gongcheng · 2008
It is an important task to generate test data automatically within the software testing process. The previous approaches of generating structural test data are mostly based on variant Genetic Algorithms(GA). These approaches have two shortcomings: the algorithms are too complex to use, and the parameters of the algorithms are not easy to be set by users. A novel approach for generating structural test data based on Particle Swarm Optimizer(PSO) is proposed. The approach employs the summation of branch-function as fitness function of PSO. Two triangle discrimination programs are used to experiment. The experimental results show that the approach is more efficient than GA based approach: when the number of particles of PSO is equal to the size of GA, the mean number of iteration of proposed approach is about 1/16 as many as that of GA-based approach.