Different Types of Specs

Our goal as developers is to write specs that maximize the values we’ve listed here—guiding the design, building confidence, and so on—while minimizing the time lost to writing, running, and fixing them.

Every spec has a job to do. These jobs fall into different categories: catching regressions in an application, guiding the design of a single class or method, and so on.

The software development community continually argues about how many of these categories there are, and their exact definitions. While these endless arguments and subcategories are fun to ponder, we recommend focusing on just a few different, well-defined types of specs. That way, you’ll end up intentionally picking what to write at any given moment, ...

Get Effective Testing with RSpec 3 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.