Generating test data for both path coverage and fault detection using genetic algorithms

  • Authors:
  • Dunwei Gong;Yan Zhang

  • Affiliations:
  • School of Information and Electrical Engineering, China University of Mining and Technology, Xuzhou, China 221116;School of Information and Electrical Engineering, China University of Mining and Technology, Xuzhou, China 221116 and School of Technology, Mudanjiang Normal University, Mudanjiang, China 157012

  • Venue:
  • Frontiers of Computer Science: Selected Publications from Chinese Universities
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The aim of software testing is to find faults in a program under test, so generating test data that can expose the faults of a program is very important. To date, current studies on generating test data for path coverage do not perform well in detecting low probability faults on the covered path. The automatic generation of test data for both path coverage and fault detection using genetic algorithms is the focus of this study. To this end, the problem is first formulated as a bi-objective optimization problem with one constraint whose objectives are the number of faults detected in the traversed path and the risk level of these faults, and whose constraint is that the traversed path must be the target path. An evolutionary algorithmis employed to solve the formulatedmodel, and several types of fault detectionmethods are given. Finally, the proposed method is applied to several real-world programs, and compared with a random method and evolutionary optimization method in the following three aspects: the number of generations and the time consumption needed to generate desired test data, and the success rate of detecting faults. The experimental results confirm that the proposed method can effectively generate test data that not only traverse the target path but also detect faults lying in it.