DEV Community

SomeOddCodeGuy
SomeOddCodeGuy

Posted on • Originally published at someoddcodeguy.dev

Heh... Oops. All Hail the Unit Tests.

Don't put off unit tests.

When I first started building Wilmer, I barely knew any Python, and of course I didn't have Wilmer to help me build it lol. So the early code was nothing shy of a disaster; coming from a C# background, I first structured it all wrong, then someone chastised me, so then I turned around and redid it "the python way" (it wasn't, but I tried), then I started just doing stuff in a hurry... and before I knew it, Wilmer was a bowl of spaghetti.
Since last April I've been refactoring all of it during whatever free time I could muster on my weekends. Total, clean, sweep from end to end since I now know far more about Python and DO have Wilmer to help.

Now that I've shredded most of it and put it back together, Im finally adding in the unit tests I always meant to have. And while adding them? I found this tiny, super hard to find, insidious little bug that had been plaguing me for almost TWO YEARS NOW. This minor annoyance that was driving me up the wall and I couldn't figure out what in the world was causing it, or if it was even in Wilmer.

Adding unit tests uncovered it. I knew better than to wait. It's not like I haven't been doing this for 13+ years. But as with everything in life, new and shiny always trumped out doing it right since I was always strapped for time.

So yea. Don't put off unit tests.

Top comments (0)