You’re patting yourself on the back, proud of the code you’ve just written for a cool new feature. You’re itching to add it to your organization’s repository and see customers use it as soon as possible, but you can’t. You now need to write a bunch of unit tests that meet your organization-mandated “code coverage” level. You begrudgingly sit down and start to hammer out the tests, thinking, why? “I’ve already written the code, why do I have to go through this bureaucracy?”
In this post, I’ll discuss what unit tests are useful for, why they can seem so annoying to write, and how to write them more effectively.
