Synopses & Reviews
Your Ruby on Rails application is sick. It's got bugs. Nobody remembers what that tricky piece of code was supposed to do, and nobody can tell what it actually does. Deadlines are looming, but every time you make the slightest change to the code, something else breaks.
You need Test-Driven Development (TDD), a proven process for improving the design, maintainability, and long-term viability of software. In TDD, the tests come first, and then code is written to match the expectation of the test. Using TDD means writing better code faster.
Ruby on Rails has unparalleled support for TDD. In addition to the tools that Rails has built-in, a large and thriving testing community adds new tools at an accelerating rate. Rails Test Prescriptions is your guide to the entire Rails testing ecosystem.
Containing both practical code examples and discussion of why testing works, this book starts with the most basic features delivered as part of core Ruby on Rails. Once you've integrated those features into your coding practice, you'll want to use popular third-party testing tools such as RSpec, Shoulda, Cucumber, Factory Girl, and Rcov. Rails Test Prescriptions will show you how to use these tools and when they are appropriate. Rails Test Prescriptions will cover both the current Rails 2.3.x version as well as the initial 3.0 release.
If you are a Rails programmer who tests code, this book is an invaluable guide to the latest in available testing tools. If you are a Rails programmer who doesn't test code, then start testing immediately: this book can help.
"Using the approaches described by Dave and Andy you can reduce greatly the number of defects you put into your code. The result will be faster development of better programs. Try these techniques"—Ron Jeffries, www.XProgramming.com
"Andy and Dave have created an excellent, practical and (of course) very pragmatic guide to unit-testing, illustrated with plenty of examples using the latest version of NUnit."—Charlie Poole, NUnit framework developer
"The Pragmatic Programmers have done it again with this highly useful guide. Aimed directly at C# programmers using the most popular unit-testing package for the language, it goes beyond the basics to show what you should test and how you should test it. Recommended for all .NET developers."—Mike Gunderloy, Contributing Editor, ADT Magazine
The NIST estimates that poor testing costs the US economy $60 billion annually. This book gives teams straightforward and proven ways to introduce unit testing into their process, resulting in higher quality and fewer bugs.
All over the world, software teams are using unit testing both to verify their code and as a way of helping them design better code. This book is unique in the way it covers two aspects: showing developers both how to test and helping them determine what to test.
New in the second edition:
- Updated for NUnit 2.4 (.NET 2.0 and Visual Studio 2005)
- More assert methods
- New String and Collection assertion support
- Better support for multiple-platform development
- Higher-level setup and teardown fixtures
- Whole new chapter on extending NUnit
- and more!
This guide gives teams straightforward and proven ways to introduce unit testing into their process, resulting in higher quality and fewer bugs. It shows developers how to test and what to test.
About the Author
Andy Hunt is a programmer turned consultant, author and publisher. He co-authored the best-selling book “The Pragmatic Programmer”, was one of the 17 founders of the Agile Alliance, and co-founded the Pragmatic Bookshelf, publishing award-winning and critically acclaimed books for software developers.
Dave Thomas, as one of the authors of the Agile Manifesto, understands agility. As the author of "Programming Ruby," he understands Ruby. And, as an active Rails developer, he knows Rails.