Check out a free preview of the full The Psychology of Code Testability course:
The "Testing Examples" Lesson is part of the full, The Psychology of Code Testability course featured in this preview video. Here's what you'd learn in this lesson:

Testing after the fact means you assume the code works, then try it out. The problem is largely insoluble. Can you write the test before the code? If you write the test first, it will probably be able to survive changes to the code. If you know what the tests are actually trying to achieve - the stories of the tests - you’ll be able to write code that can be tested by it.

Get Unlimited Access Now