摘要:
为了有效提高满足路径覆盖的测试数据质量, 提出一种利用相似路径间启发信息的引导测试数据生成策略.首先, 对初始测试数据与路径节点间的覆盖情况进行分析, 区分出难易覆盖路径;其次, 设计了一种路径相似度的计算方法, 分析得出路径相关启发信息, 并将该启发信息用于遗传算法寻优过程中;然后, 构造带有权重影响因子的适应度评价函数, 结合保留精英个体思想, 设计自适应遗传算子并定向引导个体交叉变异;最后, 将该策略应用于多个基准程序和工业程序, 并与Ahmed方法、多路径覆盖方法和EGA方法比较.仿真实验结果表明, 该策略在运行时间、路径覆盖率和已有测试数据的利用率上均有优势.%In order to effectively improve the quality of the test data that satisfies the path coverage, a guided test data generation strategy based on heuristic information between similar paths is proposed.Firstly, the difficult coverage paths were distinguished by analyzing the coverage between the initial test data and the path nodes.Secondly, apath similarity calculation method was designed to get path-related heuristic information, and the heuristic information was used for genetic algorithm optimization.Thirdly, a fitness evaluation function with the weight impact factor was constructed.In combination with the individual idea of retaining elites, the adaptive genetic operator was design, and the individual crossvariation was guided directionally.Finally, this strategy was applied in multiple benchmarks and industrial processes, and compared with Ahmed method, multipath coverage method and EGA method.The simulation results showed that the strategy had great advantages in running time, path coverage and utilization of existing test data.