Evolutionary Test Data Generation for Automatic Defect Detection in Teaching Environments
摘要
In the process of automated program defect detection in software, the importance of different statements without test data coverage is often neglected when test data are generated via a genetic algorithm (GA), which affects the efficiency of generating target data and the performance of defect detection. In this paper, the program key statements are defined first, and then, the importance of the key statements and their calculation methods are proposed. On this basis, the fitness function of the GA is given to increase the fitness of individuals corresponding to the data covering high statement importance. The goal is to improve their probability of being retained during evolution and generate the target data quickly. Finally, the proposed method is tested on benchmarks and industrial programs and compared with existing methods. The results show that the proposed method can generate data efficiently and improve the efficiency of defect detection compared with existing methods. In addition, this method is suitable for automatic defect detection in the program writing process and can provide support for intelligent programming teaching.