All human beings go through five phases psychologically before accepting any kind of loss - denial, anger, bargaining, depression and acceptance. Similarly, all developers go through five phases on the unit-testing journey before achieving nirvana - ignorance, hesitance, enthusiasm, fanaticism, and pragmatism. This hilarious post by Said Aspen, will make you “reflect on your relationship with software unit testing.” Read it to tickle your funny bone.
You start with being a unit testing ignorant. You have real code to attend to and you are proud that you are not wasting your time on this irrelevant stuff. In the next phase, enters a villain who forces you to write unit tests. And you write them just for the sake of getting them out of your way. This is you going through unit testing hesitant phase. Then something unimaginable happens.
“You realize that it’s not all that bad. You get a warm and fuzzy feeling, deep down in the gut of your programmer-soul, when you see that green bar slowly crawl up to 100%.” You turn into an enthusiast, you even start convincing others to write tests. But all good feelings don’t last too long. The dark phase arrives and you find yourself researching testing frameworks & best practices. You are a fanatic who tells your manager why some of these should be adopted. You are writing more test code that production code. Finally you realize and you admit that you have a problem, “your testing journey has come full circle, returning to where you started; at the notion that delivering features and production code is your main objective.”
5 mins read