Test-Driven Development with Rails
with Jim Weirich and Joe O'Brien
Dates & Pricing
- March 22-24, 2010
- Edinburgh, Scotland

| £898 | Alumni and Groups of 3+ |
| £1125 | Early Bird (thru Feb 28) |
| £1350 | Regular |
| (Prices include VAT) | |
Testing is the cornerstone of building high-quality software, but it doesn't have to slow you down. Rather, testing can actually help you deliver new features quicker by eliminating debugging time, minimizing re-work, and reducing the cost of changing existing code.
So, how do you get started and continue practicing test-driven development when the pressure is on? A common mistake is to focus on the tools. And in the Rails community there's certainly no shortage of good testing tools. But the tools only get you so far. The long-term value is in learning the practices and techniques of test-driven development. That's what this course is all about: Building high-quality applications the red-green-refactor way!
In this course you'll learn test-driven development by actually doing it through a series of guided hands-on exercises. You'll come away from this course in the testing mindset with a solid foundation of the practices. You'll finally get TDD and have the experience to make it stick.
“Pragmatic Studios always rock! When you offered TDD as an option, I knew it would be an amazingly valuable time. Jim and Joe were fantastic as was networking with peers. Prag Studios have the best format.”
—Jae Hess
What Will I Learn?
Practices and Techniques You Can Apply Immediately
The Foundations
A solid foundation of principles and practices will help you get started
writing tests and keep writing (and running!) them when the pressure is on.
- Code with confidence in the Red/Green/Refactor cycle
- Reduce the cost (and fear) of change
- Capitalize on the testing investment through continuous integration
Rails Unit, Functional, and Integration Testing
Rails strives to make testing easy, but it assumes a certain style and
vocabulary. We'll show you what works best for us.
- Test Rails models, views, and controllers
- Validate the use cases of your application with integration tests that read like software requirements
- Identify the boundaries of unit, functional, and integration tests
- Learn time-saving helper methods and special assertions that come with Rails, and how to write your own
- Create fixtures of test data to keep tests decoupled and repeatable, and learn how to avoid fixture pitfalls
- Automate testing chores with Rake for better repeatability
Behavior-Driven Development
How we are testing is just as important as what we're testing,
and behavior-driven development has become very popular in the
Rails community.
- Create high-value and more maintainable tests that concentrate on behavior rather than state
- Understand the differences between state and behavior-based testing
- The pragmatics of TDD and BDD
Mocking and Stubbing
Once you're comfortable with the basics, it's time to learn
the advanced techniques that help you write more effective
tests.
- Isolate tests through mocking and stubbing for faster test cycles and improved application designs
- Refactor tests to remove dependencies that slow down the testing cycle
- Track and measure test effectiveness through code coverage and path coverage using Rcov
Tools of the Trade
We teach you the techniques that allow you to choose the tools that work for you.
- Write good tests with Test::Unit using assertions, test cases, test fixtures, and validation vs. verification
- Learn how to use different BDD tools: RSpec and Shoulda.
- Learn how to use Cucumber, Selenium, and Watir for acceptance testing
- Understand the strengths and weaknesses of each tool
- More tools, tips, and techniques used by the pros
Who’s It For?
Rails Developers. This is an intermediate course designed for Rails developers who are ready to begin doing more testing or take their current testing practices to the next level. It's not an introduction to Rails or Ruby. This course is a good fit for you if...
- You have experience working on at least one Rails application
- You are comfortable in Ruby
- You've struggled with testing in Rails including when to start, how to do it "the right way", and how to continue writing tests when the real world interferes
Who Teaches the Course?
Jim Weirich and Joe O'Brien. This course is taught by programmers for programmers. You'll learn directly from two experts on Ruby, Rails, and test-driven development.
Jim Weirich has been active in the software development world for over twenty-five years. Jim is very active in the Ruby community and has contributed to several Ruby projects including the Rake build system, the FlexMock mocking library, and the RubyGems package management software. Jim is the Chief Scientist for EdgeCase, LLC.
Joe O'Brien has spent his career as a developer, project manager, and everything in between. Before helping found EdgeCase, LLC, Joe was a developer with ThoughtWorks and spent much of his time working with large J2EE and .NET systems for Fortune 500 companies. He also co-founded the Columbus Ruby Brigade and helped organize the Chicago Area Ruby Users Group.
“The instructors were cheerful, passionate, and honest. I appreciate their effort to keep the class fun and interesting. They admitted to shortcomings and didn't try to push dogma. The atmosphere of the class was very conducive to asking questions.”
—Anthony Carlos
What Should I Bring?
Your Laptop. It wouldn't be a hands-on course if you didn't walk away having written some code. You'll be most productive on the laptop you use regularly. (On average, 60% of attendees bring Mac OS X, 30% bring Windows, and 10% bring Linux.)
A few weeks before the course, we'll send out detailed instructions for installing everything you'll need. During the course, you'll get hands-on experience working through prepared exercises, and experimenting on your own, too.
Your Registration Includes
- A continental breakfast, beverages, and a lunch each day
- A binder with all the printed material
- All the example source code to refer back to later
- Internet connectivity and power during the Studio
- An invitation to our alumni-only mailing list for help after the Studio
- Discounts on books, screencasts, and future training
