background image
| Bugs with Pointers and Memory >>


| Bugs with Pointers and Memory >>
List of Common Bugs and
Programming Practices to avoid them
Vipindeep V, Pankaj Jalote
Indian Institute of Technology, Kanpur
{vvdeep, jalote}
March 30, 2005
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
, 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 classi-
fication which is valid in the cycle of software development and evolution. The classification scheme
given in Orthogonal Defect Classification [9] defines eight categories of defects as - assignment,
checking, algorithm, interface, timing/serial, function documentation, and build/pack/merge. Boris
Beizer [5] 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 de-
fects 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
concerns etc.)
Major: Defects that could cause serious consequences for the system like losing some important
Suggestions to enhance the list of common bugs and programming practices can be sent to
Suggestions included will be suitably credited.