An integrated testing criterion is proposed that extends traditional criteria to be effective to reveal domain errors. The method requires many fewer test cases and is applicable for any kind of predicates. An automated test data generation algorithm is developed to satisfy the criterion. This is the first integrated algorithm that unites path selection and test data generation. The method is based on function minimization and is extended to find required test cases corresponding to ON-OFF points very quickly. In this way the algorithm is dynamic and thus can be used in practice.