List of Common Bugs and Programming Practices to avoid them
By: Vipindeep V, Pankaj Jalote
Software bugs are common in practice. Although there are large variety of bugs possible,
some bugs occur more commonly and are frequently the cause of software failures. In this
report, we describe some of the common programming errors with suitable examples for them.
The aim of this compilation is to make programmers aware of these errors, so they can avoid
them. This is an initial compilation which, with feedback 1 , we hope to enhance in future and
make it more comprehensive. The report also lists some poor programming practices that are
often the cause of many types of bugs.
A software bug can be defined as that part of the code which would result in an error, fault or
malfunctioning of the program. Some bugs can be detected easily during development. But some
bugs will be found late in the development process. These are low probability errors which are
hard to detect and occur on very sparse set of inputs. According to IEEE standards, a ‘bug’ is an
incorrect step, instruction or data in a program. A failure is caused because of a bug and may alter
the external behavior of the program.
There have been many attempts to classify the bugs. Most of these represent the general classification
which is valid in the cycle of software development and evolution. The classification scheme
given in Orthogonal Defect Classification  defines eight categories of defects as - assignment,
checking, algorithm, interface, timing/serial, function documentation, and build/pack/merge. Boris
Beizer  has given an extensive bug taxonomy which classifies bugs based on the possible places
in various phases of development cycle. Software bugs cause an increase in the cost of development
both in terms of time and revenue. The basic challenge which a programmer faces is to minimize the
introduction of defects , detect and remove existing bugs early in the development process. The defects
detected early will cause much lesser damage than those which are detected later in the usage.
In this report we focus on commonly occurring defects and their impact with simple classification.
The seriousness of a bug can be ascertained based on the damage caused to the functioning
system. A general classification of bugs can be done based on the frequency of the occurrence of that
bug and severity of that bug.
The severity of bug is a subjective measure depending on the software and the system. However
we can broadly have following classes for severity:
• Catastrophic: Defects that can cause very serious effects (system may lose functioning, security
• Major: Defects that could cause serious consequences for the system like losing some important
• Minor: Defects that can cause small or negligible consequences for the system. Ex. Displaying
result in some different format.
• No Effect: These may not necessarily hamper the system performance, but they may give
slightly different interpretation and generally avoidable. Ex. simple typographic errors in
Goal of this TR:
In this TR we compile a list of bugs commonly found in programs. The compilation is based on
various published articles on the topic and users experience in programming. The aim is to educate
the programmers about frequent mistakes, so that they can avoid them. In addition, we also describe
some programming practices - both do’s and dont’s, that can in general help to reduce the incidence
... to read more articles, visit http://sqa.fyicenter.com/art/