Why are there bugs in software?

If you have ever used a computer you have probably encountered a bug in a program. Bugs range from annoying to catastrophic, rendering the program completely useless. Why are there bugs? They are clearly mistakes, so why are they called bugs?

The term “bug” came about in the days of the earliest computers. This was before the era of the transistor. Computers then were built using vacuum tubes and relays. (If you don’t know what a vacuum tube is, ask your mother!) Computers in those days were very slow and very expensive. Use of them was carefully tracked for budgeting purposes and breakdowns were common. One such failure was due to a moth that had gotten itself stuck between the contacts of a relay. The engineer who fixed it logged the failure as “Bug in computer”. To this day program problems are called bugs, even though there are no insects involved.

The big question is “Why are there bugs at all? Don’t they test the software?” Of course they test. In fact, at least 50% of the time spent on a software project is testing and debugging. All but the smallest software publishers have people on staff who do nothing but testing. In spite of this, there are always bugs. How can this be?

One reason is the very nature of programs. In a very simple program, one that makes only 8 yes or no decisions, there are 256 possible outcomes. Most programs being written today make hundreds of thousands of decisions, and there is simply not enough time to test every possible path. Because of this complexity, a lot of effort has gone into improving the programming process. Writing software is a combination of rules and art. A good programmer tries to be both disciplined and creative. That’s why they usually command a high salary. Such people are scarce, and that has led to a majority of them being mediocre. Companies that try to save money by hiring the cheapest programmers they can find often wind up paying much more in dealing with the inevitable bugs.

The bug fixing process is also perilous. An old programmer’s joke says “I had 99 bugs in my program. I fixed one and now I have 117 bugs in my program.” This is again due to complexity. Fixing a bug often has the unintended effect of creating new bugs. This is especially true for programs that have grown over time to be many millions of lines of code. Microsoft Windows, for example, is now so large that it is thought that there is no longer any person who understands it in entirety.

In practice, programming is not unlike quilting. Precision is critically important. A small mistake in one seam can lead to squares that don’t match. Of course a programmer can fix mistakes with keystrokes, where quilting problems may involve multiple attacks with a seam ripper. Eventually the quilter says “Don’t worry, it will quilt out.” For the programmer this comes from management who says “Stop debugging and ship it!” As long as human beings are creating, there will be imperfections. This truth is evident in the exquisitely beautiful Amish quilts, where the artists will make at least one deliberate mistake in a quilt to underscore the frailty of humans.

Once we accept the inevitability of bugs in our software, we have to develop a strategy for dealing with them. Software updates are a large part of that. Updates are released as often to fix bugs as they are to introduce new features. Some publishers will release an update with no mention of bugs being fixed, but the fixes are there. If the problems being fixed are many, there are probably new bugs in the update as well. At some point, in any large software program, the number of bugs becomes constant, due to new bugs being introduced while fixing old bugs. This should not deter you from installing updates. In fact, before looking for help with a problem, you should always first check to see if there are one or more updates available. Installing updates may fix your problem, but if not you have eliminated what is usually the first thing suggested by technical support personnel.

The cornerstone of your bug strategy should be backup. Keeping copies of  tax records, grandchild photos, and other irreplaceable items is critical. External storage is less expensive than ever, and there are numerous “cloud” options as well. We recommend following the 3-2-1 backup strategy. It’s the best way to ensure that you have protection from loss, whether it comes from software bugs or hardware failures.

With software or sewing, sometimes things just don’t work out the way we want them to. If someone points out a flaw in something you’ve made, just smile sweetly and tell them it’s intentional, to prove you are human!