Bug Fixing Is Actually Fun!
You heard me right. And
I am not fooling around, there’s no one behind my back forcing these words out
my mouth. Bug fixing is actually fun.
In my work I prefer
tasks needing bug fixes rather than creating a new feature in our project. New
features demand too much time analyzing what needs to be done, what alterations
to be performed on the database, unit tests to write, and ensuring the design
meets the company’s standards. Bug fixing on the other hand is like a game of
cat and mice. And you get to play the role of the cat, which is kinda exciting.
At first it’s scary, like
searching for a needle in a haystack of codes, but done right, you’ll be able
to get the hang of it. First of course, you need to replicate the scenario
reported, need to see the error yourself. Then read the error message. What
exception was thrown? Where? Which file? In my experience, I always see
NullPointerException as the number one culprit. Others were
ConcurrentModificationException, and other Runtime-related errors. Go to the line
of code that was reported. Often times, the line number shown from the log wasn’t
always the culprit. In such case, I like to spread little crumbs of logger to
log between each process and see which one of my little evil crumbs would not
get printed. Then I’ll do the necessary fixes to let it work again and spare
the whole team the headache.
Funny and challenging
it might seem, you wouldn’t want of course to fix thousands of bugs in your
project in the long run. Better to practice writing clean codes and study bug-preventive measures. If dealing with a
huge codebase, have your codes be analyzed by code inspectors like Sonarqube or
Codacy. These platforms continuously scan your project for any code smells,
vulnerabilities, or possible bugs just hiding in plain sight. The warnings and red-marked results might annoy you at first but trust me, it can really save your ass a great deal of fixing.
You wouldn’t want
your hard-earned project go downhill with just a simple bug right? Then do the necessary steps needed. Don't whine around and tear you hair, instead smash
those bugs all the way!
Happy coding!
Comments
Post a Comment