TDD steps:

  1. Write a test that describes some shortcoming or missing feature in the code.
  2. Run the tests.
  3. Write just enough code to make this test pass.
  4. Run the tests again.
  5. Refactor.
  6. Write a test to define a new feature and start the process all over again.

Always remember:

  1. Code doesn't exist yet until it's tested.
  2. Run tests religiously.

See more: