Switching to Test-Driven Development (TDD) on an existing project without tests presents special challenges. Code could be a tangled mess of dependencies that defeats the very concept of unit testing. Or somebody attempted TDD in the past and you have a test suite that needs to be fixed before any new tests can be written. This video describes techniques that you can use to bootstrap a test-driven process into your project.
It presents “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 include:
* Using Cucumber to perform black-box testing.
* Using RSpec to perform white-box testing.
* Using mocks to isolate legacy code.
* Safer refactoring.
* Measuring test coverage and other useful metrics.
Video Producer: Ruby Midwest Conference