When to Test
When should you test? Simply put: All the time. Don't wait to test until late in the development cycle unless you like missed deadlines. Doing so is a sure way to completely blow a schedule. And don't regard testing as a separate step in the development cycle. It's not. Instead, test all the time. Test each piece of code as you write it, preferably with an automated test harness that has itself been thoroughly tested.
One of the best times to write tests is prior to coding. When you sit down to begin adding a feature, write its test first. This may seem a little backward, but it isn't. Writing the test first forces you to articulate what the new code is supposed to do before you write it. It's likely that the test may evolve a bit ...
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