Abstract:Path coverage testing is one of the most important software testing methods. This paper presents a process of using genetic algorithms to generate path coverage test data. When an individual traverses the node that might be contained in the unteachable paths(which are determined based on the correlation of conditional statements), the higher the probability the node exists in the unreachable paths, the higher degree of traversing the individual has; and, the individual with higher degree of traversing should be protected. The fitness function of genetic algorithms is designed based on the individual traversing degree, so the efficiency of generating test data is improved. The proposed method is applied to benchmark and industrial programs, and is compared with other methods. The experimental results show that the proposed method is efficient in generating test data for path coverage.