• Engine Yard
  • LivingSocial
  • VMware
  • Heroku
  • Rackspace Hosting
  • Blue Box Group
  • JetBrains
  • New Relic
  • Percona
  • Pivotal Labs
  • Rails Dog
  • WyeWorks
  • Chargify

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at RailsConf, contact Yvonne Romaine at yromaine@oreilly.com.

Download the RailsConf Sponsor/Exhibitor Prospectus

Contact Us

View a complete list of RailsConf contacts.

Test Your Legacy Code

Noel Rappin (Obtiva)
General
Location: Ballroom IV
Average rating: ****.
(4.08, 26 ratings)

Everybody wants to do test-driven development, but switching to TDD or BDD on an existing project that doesn’t have tests presents special challenges. Often, the current code is a tangled mess of dependencies that defeats the very concept of unit testing. Worse, if somebody has attempted TDD in the past, you might have a test suite that needs to be fixed before any new tests can be written.

Don’t give up. Adding test-coverage and TDD to your application will make it easier.

This session will describe techniques that you can use to bootstrap a test-driven process into your project. You’ll see how to use “black-box” techniques that don’t depend on the structure of the code and “white-box” techniques that interact with the code more directly.

Topics covered will include:

  • Using Cucumber to perform black-box testing.
  • Using RSpec to perform white-box testing.
  • Using mocks to isolate legacy code.
  • Safer refactoring by finding seams, or ways to update code without changing existing behavior
  • Measuring test coverage and other useful metrics

At the end of this session you will be ready to attack the most monstrous of code bases with TDD.

Photo of Noel Rappin

Noel Rappin

Obtiva

Noel Rappin is a Senior Consultant at Obtiva. He is the author of "Rails Test Prescriptions: from the Pragmatic Bookshelf and “Professional Ruby on Rails” from Wrox. He has over a decade of experience in web application development. Noel is the co-author of “wxPython in Action” and O’Reilly’s “Jython Essentials”, and and has presented at RailsConf and WindyCity Rails.

Comments on this page are now closed.

Comments

Dustin McCraw
05/23/2011 11:59pm EDT

Very funny. I could tell he know his stuff. Great high level overview of testing. Would be great if accompanied by smaller more specific code examples.