对离散粒子群优化算法进行改进,提出一种两两覆盖的组合测试数据生成算法。以一个粒子代表一个测试数据集,从整体上评价测试数据集对各个因素组合的覆盖情况,以测试数据中各因素离散值出现的次数为依据,随机产生粒子位置。实例分析表明,该算法与初始值无关,可有效生成测试数据且收敛速度快。
This paper improves the Discrete Particle Swarm Optimization(DPSO),presents a pairwise covering combinatorial test data generation algorithm.A particle represents a test set,fitness function is evaluated by the number of combination pair,and the position of the particle is produced by stochastic algorithm,which is randomly generated by the frequency of discrete values of all factors in test set.Example analysis shows that the algorithm has nothing to do with the initial value and can generate the most effective test data with fast convergence.