Chapter 16Testing Legacy Code

You won’t always get to start from scratch.

There’s a strong possibility that you’ll need to bring your testing skills to bear on a codebase that already exists. A codebase that—gasp—may not have a complete or accurate test suite to guide you.

Not all that long ago, there were no Rails legacy projects. Now there are Rails codebases that are old enough to attend kindergarten and beyond. These codebases tend to be large, and almost by definition they aren’t using the latest tools. All the advice in this book so far is well and good, but what if you’re not starting your TDD experience with a new application? How does testing change when you’re dealing with a legacy codebase?

Entire books have been ...

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.