Okay, Funny Man, What Makes a Good Set of Model Tests?

There are a lot of different, sometimes conflicting, goals for tests. It’s hard to know where to start your TDD process, how many tests to write, and when you are done. The classic description of the process—write a simple test, make it pass, then refactor—doesn’t provide a lot of affirmative guidance or direction for the larger process of adding a feature.

A TDD Metaprocess

Here’s a metaprocess that reflects how I write a new business logic feature. (I handle view logic a little differently.) This process is more of a guideline than a hard-and-fast checklist. As the logic we are working on gets more complex, and the less we know about the implementation when we start, the closer ...

Get Rails 4 Test Prescriptions 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.