3. MOVING TO TDD
• Build tests before refactoring or upgrading
• Test-drive bug fixes
• Write tests for anything you worry about
• Continuous Integration is essential
• Remove unused (untested) code
4. RED – GREEN – REFACTOR
1. Write the test
2. Watch it fail
3. Make it pass
4. Make the code good, make sure it still passes
5. UNIT TEST FRAMEWORKS
• Test::Unit
• Shoulda
• Rspec
http://github.com/ultrasaurus/test-framework-comparison
6. INTEGRATION TEST
FRAMEWORKS
• Cucumber
• Webrat / Capybara
• Selenium
• Watir
• And more…
7. OUTSIDE IN TESTING
• Write an scenario with
Cucumber (1)
• Write a step definition
• Run and Watch it fail (2)
• Write a failing code example with
RSpec (3)
• Get the example to pass (4)
• Refactor (5)
• Repeat 3.1 – 3.3 until Cucumber
step is passing
• Repeat 2 – 3 until Cucumber
scenario is passing (6)
• Refactor (7)