Be Complete

There is an assumption that a suite of tests tells the whole story and is a complete specification. If you don’t specify a test for a behavior, that behavior is assumed to be false. Anything that’s not part of a test suite is assumed not to exist. So you have to have a complete set of tests to cover all the behavior in your system. If you’re really practicing test-first development, you’ll have that complete set of tests. Always write a test to create behavior.

And because you’re creating testable code as you’re writing it, you’ll see a dramatic positive increase in the overall quality of the finished product. There’s a tight correlation between testability and code quality, but please don’t put on your QA hat.

It’s very enticing ...

Get Beyond Legacy Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.