Abstract:
As a testing strategy to evaluate the completude of test cases, mutation testing has been identified as a “fault-oriented” technique for unit testing, which is mainly used to generate complete test cases. By applying mutation operators to simulate software defects, mutation testing generates mutants and constructs a test suit to kill them. Test data generation for the test suit constructing includes random method, path-wise method and goal-oriented test data generators. Among them, the path-wise technique of test data generation is a high-efficiency technique for test cases generation, implements test data generation by building and solving constraint systems. However, most of path-wise generation techniques only take the control dependence among statements into consideration, viz, build constraint system by analyzing the control flow graph but neglecting the data dependence among statements. Considering both of them, a new domain reduction method named domain reduction approach with data dependence (DRD) is proposed to improve the test data generation technique of domain reduction. Using path with data dependence, DRD combines the constraint-based test data generation technique with the chaining approach for test data generation to build constraint system. As an automation technology for test data generation, DRD solves the constraint system by domain reduction technique and verifies test data with back substitution method. Experimental results showed that this method improves the successful rate and execution efficiency of test data generation in mutation testing at a large extent.