To Bug Is Human, To Debug Divine

Debugging is a pretty tiring job. More so if you do not exactly know where you have erred. I spent half the day today debugging my code. Hopefully, it does not have any more bugs.

A day earlier I thought I was done with my BTP coding. I tested the code for small inputs, and the results were as expected. Happy with my work, I wrote a script to let it run a few times on inputs generated following the poisson distribution. When I woke up the next day I was shocked to see the results. They were nothing like what I had imagined. The results had deviated highly from what was expected by theory. Damn! A day’s hard work gone waste.

I sat down to remove any bugs. To elp in the debugging process, I had generated 4 log files – log.xml, run.data, plot.data, miss.data. Poring over these log files and simultaneously running the gdb was a strenous work. I had no idea where the errors were being reported. The aberration becomes observable only after my code has executed for some 10,000 times. It was simply impossible to dry run the code for so long and zero-in on the bug.

I tried a smaller random input, hoping to catch the bug. Luckily enough, this data set produced the error. The deviation was not too obvious, but a hard look at the log files, and I could narrow down the error to a few functions in my code. However, to find the bug, I had to eventually dry run the code for this smaller data set. This took another hour.

All’s well that ends well. I have rectified the error. Basically, I was forgetting to reinitialize an important parameter on the occurance of a particular event. With that done I am hoping to get good results when I wake up tomorrow morning. A good night’s rest is what I deserve. *A pat on my back*. :)

You might also like to read

0 Response to “To Bug Is Human, To Debug Divine”


  • No Comments

Leave a Reply

Comment moderation is enabled. Your comment may take some time to appear.




Theme Tweaker by Unreal