针对字符串测试数据自动生成,讨论了字符串间的距离,将不满足路径条件的字符串谓词表示成一个实值目标函数;利用快速下降搜索算法实施目标函数极小化,实现了基于搜索的面向路径字符串测试数据自动生成方法;探讨了其测试数据生成效率与初始输入、路径处理顺序之间的关系,并与遗传算法等几种算法进行了比较.实验结果表明:该方法是一种更经济有效的测试数据生成方法.
Aiming at the automatic test generation for character string data, this paper defines the distance between two strings. A real-valued objective function is constructed with respect to the string predicate which does not meet a given path condition, and its minimum is computed by using a speedy descent search algorithm. As a result, path-oriented string test data can be automatically generated. In addition, this paper investigates the relations among test generation effectiveness and original inputs as well as path orders processed, and the test generation effectiveness is compared with other three algorithms such as the genetic algorithm. The experimental results illustrated that this approach is more economical and effective.