摘要: 适应值函数的设计是决定测试数据生成质量和效率的关键,为此提出一种重叠路径结构,对程序路径进行描述,并设计基于遗传算法全路径比较的路径测试数据生成适应值函数。为测试数据生成算法定义生成时间期望的综合性能评价指标,以该指标与对照组算法进行比较实验。结果显示,该适应值函数能较好地平衡算法收敛性和消耗时间之间的矛盾。
关键词:
软件测试,
路径测试,
测试数据生成,
遗传算法,
适应值函数
Abstract: A structure of overlapped paths is proposed to extract the information of control flow and describe paths of a program. Two fitness functions are constructed to generate test data for path test based on genetic algorithms with whole path’s comparison. An indicator is defined to evaluate the synthesis performance of different fitness functions, and several other methods are selected for comparison with experiment. Results show that the two fitness functions balance the convergence and time consumption well.
Key words:
software test,
path test,
test data generation,
genetic algorithm,
fitness function
中图分类号:
曹洋, 胡春华, 陈少波, 李路明. 一种路径测试数据自动生成方法[J]. 计算机工程, 2011, 37(9): 25-28.
CAO Xiang, HU Chun-Hua, CHEN Shao-Bei, LI Lu-Meng. Data Automatic Generation Approach for Path Test[J]. Computer Engineering, 2011, 37(9): 25-28.