A good testing strategy incorporates both defect prevention and defect detection. Defect prevention is the most important. Finding a defect after the code has been written is wasteful. Preventing defects by thinking about and writing tests before the production code is always the best strategy. When it comes to finding defects, the faster they are found, the shorter the feedback loop, and the sooner measures can be taken to prevent them in the future.




