One benefit that is generally not talked about when discussing testing is the following. The feeling of productivity because you are writing lots of code.
Think about that for a moment. Ask any developer who wants to develop why they became a developer. One of the first things that comes up is “I enjoy writing code”. This is one of the things that I personally enjoy doing. Writing code, any code especially when its solving my current problem makes me feel productive. It makes me feel like I’m getting somewhere. Its empowering.
Now think about how test driven development or indeed any testing methodology fits into this. You write a test, you write a method to pass the test. You write another test, you modify the method. You write another test, you modify the method. Lather rinse repeat. After you have met all your requirements you have quite a bit of code.
Now why is this important? Well firstly you feel like you have done a lot because you have a lot of code. Secondly it plugs straight into the part of the brain that likes rewards. Its the same way that any game becomes addictive. You begin with a specific goal. To reach it you take small steps and each one rewards you as you get there. When you finally make the last hurdle you can look at each of the steps you took, and you feel a great deal of accomplishment.
The above for me is what keeps me turning back to test driven development. I love the feeling of success each time I run the tests and everything comes back fine. I love being able to finish off a method knowing its as good as I can make it. Finally I love having a lot of code which while the user will never see it at least makes me feel like I’m getting somewhere.
What are your feelings about this? I would love to hear your experiences with software testing.