TDD and the Creative Process

As described in my previous post, I decided to try TDD to get out of my “writer’s block“. Good thing is, that I did get out of the “block” and in one and a half weeks managed to finish implementing a visual programming interpreter.

The “bad” thing is that I stopped doing TDD. After a couple of days into TDD, I finally understood what was the solution to the problem that I was trying to solve. As you can expect, writing an interpreter is not an easy task, specially since the language I am working gives great importance to parallelism, and parallel programming is never easy. After I had my “eureka” moment, I started coding furiously, but still doing tests for everything. But since the tests started to become harder and harder to write and I felt that I was loosing my “inertia”. So I decided to drop it and just code.

This experience has given me a lot to think about, specifically about how the Creative Process works. I think that software development (when creating new products, not just implementing a requirement that is completely understood) is a creative endeavour, just like painting, writing or sculpting. And my gut feeling is that if you don’t act on the “muse” you have, it just leaves and then you are stuck again with an idea but no specific direction where to start from. And TDD takes so much time and effort that the “muse” vanishes.

My conclusion: TDD is great. Instead of just coding around with no direction, it gave me a very structured way to think on the problem I was trying to solve. This made me think better and was (probably) the cause of me finding a solution. But after a solution is found, it must be coded as fast as possible so the idea does not go away. After this, write your tests (you MUST write the tests, no matter what). Furthermore, when doing new and innovative things, plan like Fred Brooks said: “The management question, therefore, is not whether to build a pilot system and throw it away. You will do that. […] Hence plan to throw one away; you will, anyhow”. Use your muse on your pilot system (the one you will be throwing away). On the second system, do TDD. And if you haven’t read Brooks “The Mythical Man-Month“, do so now. It is impressive how many of what he wrote 30+ years ago is still relevant to the software development industry (IMHO).

Enhanced by Zemanta

Leave a Reply

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