What are the advantages of designing tests early in the life cycle?

It helps you to prevent defects in the code.