Loïc Faugeron Technical Blog

TDD: just do it! 26/02/2014

This article is part of a series on Tests in general and on how to practice them:

  1. Introduction
  2. Tools overview
  3. Test Driven Development
  4. TDD: just do it!
  5. spec BDD
  6. phpspec: a quick tour
  7. Behavior Driven Development: story BDD
  8. Behat: a quick tour
  9. Conclusion

The first two articles didn't require special skills whereas the last one needed you to be a little bit used to tests. Well the next ones will require you to be a little bit used to Test Driven Develoment (TDD), so this article is here to make you practice them!

I really mean it: reading articles on TDD might feel good, but the only thing to do to fully grasp them is to:

  1. start writting tests before any production code
  2. then write the code to quickly make them pass (write ugly code if needed)
  3. finally refactor the mess, without touching the tests

In other word: just do it! The learning curve is steep, so dive into it as soon as possible.

One of the best way to learn is to pair with someone who's used to it. If you don't have someone to pair with, you can always read this Extreme Programming Episode by Robert C. Martin and Robert S. Koss.

The next article will be about the next level: Behavior Driven Development (BDD).