The TDD Tetrahedron, version 2.0

The TDD Tetrahedron, or if you wish, pyramid, has reached 2.0. Like cars, the new model is bigger and comes with new technology.

By pure coincidence, I ran into somebody willing to print this. So here it is, the version 2.0 of the TDD Tetrahedron. The new version has sides of 100 mm and it is made of plastic.

What’s it for?

Well, if you didn’t use the older version, you may be wondering what’s so great about this. It is all about mental focus.

Normally, when you program, you come up with impulses and insights all the time. The risk is that you start writing some tests before all code has passed at the same time as you add some code without tests to back it. On top of that, you may find some refactoring that is tempting.

With the TDD Tetrahedron sitting on your desk, you are more focused on doing one thing at the time.

  1. Start with putting the tetrahedron in front of you. The red side with the text “Write a failing test” should be facing you. Do as it says and write a failing test.
  2. When you have a test, turn the tetrahedron clockwise so that the green side faces you. Write enough code to make the test pass.
  3. As all tests passes, again turn the tetrahedron clockwise, this time with the yellow side facing you. Consider refactoring. All code is now under test so refactoring is supported.
  4. With no more refactoring to do, turn again clockwise and you have made a full TDD iteration.

How do I get one?

Check our web for “Books and Products”.

2 responses on “The TDD Tetrahedron, version 2.0

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.