Check out a free preview of the full The Psychology of Code Testability course:
The "Writing Unit Tests That Withstand Changes to the Code" 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:
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. Misko shows how if you approach unit testing after the fact you will write completely different tests than if you write them beforehand.