HOW UNIT TESTING USED TO SCARE ME

Sometimes the journey in software engineering can be a bitter-sweet one. Starting out, I only wanted to do the logic. It was great fun for me and pushed me to learn. Introducing bugs and throwing the code into an endless loop help me improve, shorten and clean my code. Then there was the exception messages; I got really creative and at times naughty with these. They would've loved me at Tesla with my messaging, though I am not so sure about the rest. I've since gotten back to more professional messages when errors occur.

But there was one thing I didn't want to face. Unit Testing. Something just didn't sit well with me when I heard someone mention unit testing. I think it's because I once saw someone smash their machine while unit testing, because they couldn't find what was wrong. I can't really remember all the details, besides the laptop missing my head by a few inches. I didn't want to ask what I had done at that moment. It was only a couple of days later that the person explained to me that they were testing their code and somehow something wasn't working. The logic was apparently correct but somehow the computer "was being stupid". So i reminded the person of how he always told me "computers are not stupid. It is the person in front of it that is". Long story short, me and him don't talk anymore.

But the fear of testing stayed with me. It became a dreadful word to me. If I could find someone to do it, I wouldn't hesitate to give them my code so they could be the one to break their machine. I often tried to make sure I was not in the room as well. But I decided if I was to be a great developer, I needed to know the ins and out of everything. So I started out very small. Unit testing small programs which had less chances of errors. And that also trained my mind for possible scenarios to test. I was determined to conquer my fear. I started with simple things like calculations and changing inputs and then to forms and files. I am not the best nor am I close, but I am much eager to learn now. It actually gets you thinking a lot more harder than when you write the logic. I am dipping my feet into more complex code and hoping I don't break my machine.

Wish me luck that I never have to smash my machine one day.

Happy Coding
Mbuelo Ramafamba

Comments

Popular Posts