摘要
针对路径测试中的软件测试用例生成的问题,提出了一种基于改进PSO算法的软件测试用例生成方法;首先,采用分值函数叠加方法来构造PSO算法中的适应度函数,并对粒子位置更新策略进行改进;接着,构建算法的控制流程图并进行目标路径选择;然后,利用程序插装收集个体的适应度值;最后,测试数据生成程序执行,得到合适的测试数据;通过在三角形分类判别案例程序上的实验结果表明,提出的软件测试用例生成方法能够生成更合适的测试用例,且有效减少了生成所需时间。
For the issue that software test case generation in path test,this paper presents a software test case generation method based on improved PSO algorithm.Firstly,the fitness function in PSO algorithm is constructed by using the superposition of the score function,and the particle location updating strategy is improved.Then the control flow chart of the algorithm is built and the target path is chosen.After that we use the program to collect individual fitness values.Finally,the test data generation program is executed and the appropriate test data is obtained.The experimental results on the triangle classification case show that the proposed software test case generation method can generate more suitable test cases and reduce the generation time effectively.
作者
张倩宜
李妍
Zhang Qianyi;Li Yan(State Grid Tianjin Electric Power Company Information&Telecommunication Branch,TianJin 300010,China)
出处
《计算机测量与控制》
2018年第3期50-53,共4页
Computer Measurement &Control
基金
国网天津市电力公司2017年科技项目(KJ17-1-16)