Fixing bugs as a chance and challenge

I love codingWhenever we develop software, we introduce some bugs. There is no exception (almost). I often find people don’t want to fix bugs, but only want to develop new features. As developers we like to be creative, to be innovative. We like to be challenged. And many of us think that fixing bugs is  boring.

I don’t agree with this approach. When I started working on my current project I had been working on bug fixing for month or two. It was phase of our project called stabilization. You may think that this phase is not needed in lifecycle of an agile project, but in this particular case it was necessary (I will write about this in next posts).

This period gave me great opportunity to learn what is what in this project. With each bug I was gaining business knowledge and I was learning architecture of our system. Now people come to me and ask how is this possible that I know so much about project?

And my answer to this question is really simple – Do bug fixing!

But you should do it wisely. Here are some of my advices:

  1. Find root cause of problems.
    It can happen that you seen some exception in logs, lets say NullPointerException. First thought in your mind could be to add null check, commit and put defect to Pending Test status. This is not the way you should go. First of all adding null checks is BAD – it means that your design is broken. Moreover your null check can fix this particular place in code, but application will brake is some other, not directly connected.

    Look for root cause of this issue. Check why you are getting null here. Maybe you are reading some value from web services and it was null, maybe you are parsing some message and format has changed, maybe your configuration has changed, and somebody had disabled some feature. This part of investigation can be most challenging.

  2. Understand the flow of your application.

    During your investigation try to get better understanding of data flow, business rules, etc. If you don’t know enough to understand the code ask more experienced developers or analysts. If you just simply find a root cause quickly, fix it and don’t think about it any more you will never be an expert. You will be able only to fix issues, but not to fix design.

  3. Go through all layers

    I sometimes find people debugging only one layer of application instead of looking deeper. Remember that in big applications root cause of issue can be found in most unexpected places. For example you are checking why data is missing in XML send to web service and the root cause can be found in Javascript parsing user input on the web page. Go through all layers of application.

  4. Get better understanding of what is not working

    When you see bug report try to understand what is not working correctly and ask how it should work. Look for some documentation or maybe analysts to find story which describes correct behavior. After getting better understanding of problem ask yourself if this is really a bug or maybe author of the story had something else in mind and there is some misunderstanding in implementation. It is also possible, that bug is something that has influence on user experience. Maybe during fixing it you could somehow improve it?

    Bug fixing

    Bug fixing by Geek and Poke

In my opinion bug fixing can be a really good chance to get experience and better knowledge. Don’t miss that opportunity!