Test-driven programming workflows


Have you seen the last idea by Kent Beck?

Do you understand it?

TCR? Must we stop doing TDD?

Those are the questions that a friend of mine asked me in a restaurant.

I find it difficult to explain certain things without a drawing and, in this case, the last idea by Kent Beck was a new thing for me as well.

So, I started drawing on the paper tablecloth.

Oh! Wait! It reminds me Taking Baby Steps by Adrian Bolboaca

After a few minutes:

We are used to seeing the TDD diagram with the 3 steps (RED, GREEN and REFACTOR), but different things can happen between those steps

I think it would be a good idea to have these workflows in a digital format

A few days later:

Oh! We read too quickly. TCR was formulated by Oddmund Strømme…

It comes from the idea of “test && commit” by Kent Beck

The goal

The goal is to see the differences between test-driven programming workflows clearly:

Recently I added 3 further workflows. They come from the idea of TCR, but trying not to miss the red step:

The result

The diagrams to see the differences between them:

And I recorded this short video to explain the diagram, because it’s invisible for some people with disabilities:

The video doesn’t have one detail between writing the test code and writing just enough code to pass the test, which is included in the last version of the diagram. With TDD without constraints and Taking Baby Steps constraint, we check the result of running tests after writing the test code:

  • RED: go to the next step, writing just enough code to pass the test
  • GREEN: rethink the test

However, the result of running tests is not checked with TCR, between writing the test code and writing just enough code to pass the test.

Further knowledge

Acknowledgments

Thanks Software Crafters Community for all the received feedback. Special thanks to Dave Schinkel, Fran Reyes, Rémy Sanlaville, Xavier Detant and Jeff Grigg.