Software reliability is mission critical for many domains including aerospace, military, finance, and telecom. These industries cannot tolerate errors or glitches and, some of them require 99.9999% up-time. Ensuring software reliability has many elements. Let’s take a look at some common defects that can cause software to crash.
1. Array Bounds.
In C++, int a[3] contains 3 variables as a[0], a[1], a[2] , but if a programmer uses a[3], the system will not found this variable.
2. Null pointer.
Have you seen a blue screen as 0x00000000? This information is usually caused by a null pointer because a software program cannot find an address in memory and redirects to 0x00000000. Here is a simple sample that can cause a null pointer error.
Object obj = null;
obj.equals(“123”);

But we can modify it to:

Object obj = new Object();
obj.equals(“123”)

This corrects the issue because ‘null’ is not assigned to the object.

3. Endless loop.
This is an algorithmic issue where a software program runs in a loop forever resulting in a system. For example:

for(i=0;1;i++)

What is wrong with this? The programmer made a sloppy mistake, it should be:

for(i=0;i=1;i++)

Software reliability of course depends on many factors. I’ve just listed a few simple examples. These types of errors can be very complex and trying to find all of them is a huge task. We usually use some whitebox testing tools to do static scanning, such as Findbugs and Sonar. These tools generate a report which can point to these errors but in most cases, one tool cannot find all errors so we use several tools. So, when choosing whitebox testing tools, you need to figure out their strengths and weaknesses in terms of types of errors and in what type of environment they are most suited for.