The old saying goes, "if you want to create zero bug/defect software, don’t write any code." It’s a true statement. I could go on and on about what causes software bugs, but in my experience it all comes down to one factor. We’re human, we make mistakes. The best thing we can do is to squash that bug as soon as we see it.

The most common cause of bugs in software actually happens long before a single line of code is written. Gathering proper requirements and specifications is one of the most challenging aspects to software development. Documentation isn't glamorous work, but very important. If a requirement is unclear, a programmer will write unclear code, QA will attempt to test unclear functionality and the client will be unclear what their system does. Even worse, maintaining that code becomes unclear and very expensive.

When in the maintenance cycle of software development, you are likely to run across bugs as you work. The decision to fix that bug may be difficult, but should always be addressed. Even in legacy code, fixing a bug when you see it will cost less than waiting for a better time to address. That bug may be masking other, more detrimental issues. That bug may be creating duplicate or additional work. It will also lead to inaccurate estimates when making upgrades to the system. If a bug cannot be addressed, add some comments to the code so the next developer doesn't create even more bugs.    

It all comes down to communication. The best thing you can do is be upfront and honest! Saying you don’t understand is not a bad thing. It actually leads to exceptional work. While we are all passionate about delivering our hard work quickly, in the long run spending a little more time before you write a single line of code can boost the overall quality of your delivery and makes for much happier coders.

Code on my friends!