How to avoid unnecessary testing