Test Driven Development

Ruby on Rails / Testing

Test-driven development is a general approach to creating software. You may hear about red-green-refactor cycle which is the essence of TDD.

Originally, TDD was a part of extreme programming but it’s now a separated programming technique. Knowledge of this technique is a very common requirement of job offers for software developers.

We can just fit the essence of TDD in three repeatable steps:

  1. Write a test for non-existing code and let it fail
  2. Write a code for created test and make it pass
  3. Refactor code to meet your expectations

and then just repeat with every next class you will be working on.

At the end credits for the author: test-driven development was created by Kent Beck