Write Good Tests

Most developers I’ve met assume they know what a good test is and how to write one, but in my experience few developers really understand how to write good unit tests. As with most things, these are skills that have to be learned.

Many managers—and developers—have strange notions about what TDD really is. Much of that confusion stems from how they talk about TDD. There are many different ways of doing test-driven development and I’m a proponent of test-first development, where developers write a test for a small bit of functionality and then make the test pass by implementing that small bit of functionality. It’s the ping-ponging back and forth between taking the perspective of your test (outside-in) and taking the perspective ...

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.