Optimizing auto testing