Abstract:
Predicates of character string are widely used in programs. A problem that needs further research is how to automatically generate test data of string predicates. Described in this paper are a dynamic generation algorithm of predicate slices with respect to given predicates on path Path, and an approach of automatic generation of string test data based on predicate slice, and a distance between two strings are defined. The predicate slice of a given predicate is created by using DUC (Definition
Use
Control) expression of a program. According to an input of the program, the values of variables in the predicate are computed by executing the slice. Each character of string in the predicate is processed with function minimization. Thus, ON-OFF test points of the predicate border are dynamically determined. Experimental results show that the approach is effective.