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.
Test Your Legacy Rails Code
Version: 1.0 (506) by Coby Randquist on 2013-04-27