FIRS[T]: [T]imely
You can write unit tests at virtually any time. You could dredge up code in any old portion of your system and start tacking on unit tests to it. But you’re better off focusing on writing unit tests in a timely fashion.
Unit testing is a good habit. With most good habits that you’ve not yet completely ingrained, such as brushing your teeth, it’s easy to procrastinate and make excuses why you can skip the practice “just this once.” Your dentist might love your funding his or her practice, but you’re going to hate the time it takes to scrape away the tartar that’s built up.
Likewise, the more you defer probing at your code with unit tests, the more plaque buildup (cruft) and cavities (defects) you’ll need to deal with. Also, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access