O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test-Driven Exploration

Testing a legacy codebase starts in earnest when there is a change to make. Often the first order of business on a new project is to deal with a critical bug left by the previous team—something that must be accomplished while preserving existing behavior and that does not demand a dramatic refactoring of the application.

In this case, there are two goals to getting the code under test. You want to be able to tell when the bug has been fixed. This step involves a more or less standard TDD bug-fixing session with one or more failing tests isolating the bug. The tests should pass when the bug is fixed. Also, you must confirm that any existing correct behavior hasn’t been compromised. In a project that was TDD from the beginning ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required