I'm helping my friend Mayur with TDD and he has his frustrating moments as is evident from his tweet
Red/Green Refactoring is giving me only Red... No Green :(— Tendulkar (@mayur_tendulkar) March 19, 2014
This has happened with me when I was learning TDD. This happens with everyone. Key is not getting demoralised and keep going. I did not know this in the beginning and I gave up. Then came back again. I wanted to share this experience in best way possible and I came up with follwing - My TDD Happiness Graph
Take a moment and look at the graph. There are few interesting things in there
- It takes time to master the art of TDD (I am no way close to mastering the art yet).
- In the beginning you would have lot of "turn off" moments with TDD. More experienced you are, more "turn off" you would have
- The real kick start to my TDD learning was when I paired with someone who knew how to test drive my code
- I have indicated that my happiness took a dip with dependency injection (DI). That may be misleading and hence clarification. TDD makes it easy to inject dependencies and mock them during tests. This made life so easy that I made mistake of applying DI without giving consideration SOLID and code maintenance. Overtime I learned how to tame DI but it is worth mentioning mistakes I made
- In the end, I have shown as having reached "TDD heaven". I do not know what this means, it just something came to my mind. This is a state where every time you code or think about code, you start with tests. Things like SOLID automatically follow or at least TDD makes it easy to refactor your code (brutally if needed) in order to achieve SOLID.
I was finding it difficult to make Visio and blogger work nicely with each other but I failed. If you are seeing the image blurred then a high resolution version is available here