Abstract:It is a novel research direction in the field of software testing to generate test data using genetic algorithms for complex software. Traditional techniques of test data generation based on genetic algorithms need to run a program using each test datum as an input, so as to obtain its fitness value and as a result, they consume a large amount of executing time. In order to reduce the time consumption of running a program, this paper proposes a method of test data generation for path coverage based on neural networks. First, a neural network is trained using a certain amount of samples to simulate an individual's fitness value. Then, when generating test data by the genetic algorithm, an individual's fitness value is roughly estimated using the trained neural network. Finally, for individuals with good estimated fitness values, their precise fitness value are calculated by running the program. The experimental results show that this method can effectively reduce the time consumption of running a program, therefore improve the efficiency of test data generation.