Language menu for mobile

Articles

Bonus Bugs by Hans Buwalda

Hans Buwalda discusses “bonus bugs,” bugs caused by fixes or code changes and how to avoid them from the point of view of the developer, tester and manager.

Bonus bugs are the major rationale for regression testing in general and test automation in particular, since test automation is the best way to quickly retest an entire application after each round of code changes.

Since this is probably a 'bonus' you want to avoid, how do we prevent the bonus bugs from occurring, and how do we detect them when they have been introduced? I will give some notes here from the perspective of the developer, the tester and the manager respectively.

Let's first talk about the developer. A developer can do quite a lot to reduce the chances of bonus bugs. Today's systems are becoming more and more complex, and this complexity only increases over time as changes to the system are made. Any change can easily trigger a problem somewhere else, thus producing a bonus bug.

There is a lot written about commenting and documenting code, which I will not go into here, but whatever standard you adhere to (or are told to adhere to), make sure that somebody can easily "inherit" your code. It should take minimal energy for somebody to "decipher" and maintain the code you have written. Code should be written in small blocks each of which starts with a meaningful comment. For example is there something that you want the next person to know about the code (e.g. some technical pitfall that you had to work around), state it explicitly in the code comments.

Another good policy is to have code changes reviewed and approved by either a peer programmer, or even better by a supervising "architect" who understands how the system is built up and what consequences of system changes could be.

From the point of view of the tester, there are two main items to worry about: test design and level of automation.

Test design is one of the most underestimated topics in IT. Most tests that I encounter in companies and other organizations are "lame"; they simply follow the system requirements one by one and don't even attempt to combine several different parts of the system functionalities with each other in creative ways that could reveal unexpected problems, like bonus bugs. Even though requirement bases tests are useful, they have a low "ambition level" and it can pay out to allocate time and resources to make more aggressive tests.

A high level of test automation will greatly enhance your capability to catch the bonus bugs before they reach the release. To get to such a high level, simply buying a test tool will not be enough. A well thought-out method of test automation, such as keyword-driven testing, is essential, combined with training and coaching by experienced test automation experts.

Finally, a few words from the perspective of the manager: Here the recommendation is in fact quite simple: make a determination what bonus bugs can cost, and what it is worth to prevent them. This is a business estimate and decision: having bonus bugs can cost money; efforts to prevent them cost money too. Effects of bonus bugs (or any other kind of bugs) can typically be loss of time before or after system release, and/or decreased appreciation by end-users of you and your company. Preventing bonus bugs takes extra time and money to follow policies and procedures for development and testing, which can include reviews of code and setting up a high level of test automation.

By understanding how and why bonus bugs get introduced into applications, we can both prevent them from being introduced, and find them when they are. This takes a combined effort of the developers, testers, and managers, and it's a very important step in ensuring that your end-product satisfies your customers and other stakeholders.