Tuesday, January 29, 2008

Importance of Software Testing

Welcome back, friends!

I was planning to write this introductory blog earlier but got bogged down by various pressing issues. Anyways, I am here and shall try to post a new blog quite frequently now onwards.

Today, we shall get introduced to testing and understand the significance of this activity.
Please feel free to post your questions. Also, I shall be eager to receive your bouquets/brickbats. So, let's go ....

Let us start with an understanding of the term 'Testing'. What does testing really mean?
What do we mean when we say that we need to test something? How does a person test something or someone?

The first thing that comes to my mind when I think of testing is the numerous tests / exams that I have appeared in throughout my school and college years. Are those tests related in any manner to the 'Testing' that we are talking about? Think over it! My answer is a resounding 'Yes'. Those exams were meant to test our understanding of the material taught to us during the corresponding period and helped the examiner evaluate if we were fit to be promoted to the next grade.

Let us now think of something else. What process do you follow when you purchase a
high-value item (say a laptop or a plasma TV)? And, what do you do when you purchase an everyday item (say, a pencil or a toothbrush)? You might be inclined to say that you do not follow any process in either case. But think over it again! When going in for purchase of a laptop, don't u first make sure that the item is in a perfect working condition? Don't you ask the shopkeeper to first verify proper functionality before packing it for you? This is an example of a UAT (User Acceptance Test) that we shall talk about later. Even though the laptop (as well as all of its components) has been tested many times over in the labs where it was manufactured, we still make sure that the product works in front of our eyes before agreeing to purchase it. Now, think about the steps that you follow when you purchase a pencil. Do you really follow any steps in this case? I, for one, don't. As long as the shopkeeper provides me the pencil that I have asked for, I really do not care much. Why this difference in behavior? Simply because in this case, we do not consider testing the pencil (e.g., sharpening it and writing with it) worthwhile enough. We accept the risk that the pencil might turn out to be a defective piece and that we might have to forego the money spent on purchasing it. This behavior is an example of Risk Management. We shall also talk about it when we discuss software test management.

So now we understand that testing is as much a part of our everyday life as it is a specialized software engineering activity. The only difference between the two is that the testing conducted in everyday life is performed in an ad-hoc manner and usually does not get documented. On the other hand, testing of any software product is well-documented as well as planned for.

Let us now understand as to why software testing is required. Why can we just not avoid it? Would it not be nice if we did not have to test any software at all? Well, let us see!
Firstly, the software development team is also composed of human beings and 'To err is
human', thus any software product, irrespective of the competence level of the team developing it, can not be assumed to be free of defects. In order to remove those defects, we first need to identify them, right? That is exactly why testing is required. If we miss out on defects in any product (Always remember that testing can never ensure the absence of defects), what would happen? Would it have really serious consequences? Let us see!

Have you even seen anyone undergoing treatment for cancer? What happens there? A controlled amount of radiation is focused on the cancerous tissue in order to burn out the malignant cells. Right? What would happen if the amount of radiation is too huge? Healthy tissues in the body of the patient might get destroyed as well. On the other hand, what would happen if the amount of radiation is too less? The malignant cells might not get destroyed fully, thus not fully curing the patient of the disease. Let us consider another example. Have you ever traveled by air? How does the pilot charter the aircraft through dense clouds and high mountains? He is guided in these activities by the instrument panel in front of him. Further, these instruments are controlled by complex software embedded in them. So, we know that there are a variety of applications, which are controlled through software, and whose improper functioning can lead to huge losses of life/property. It is precisely to prevent losses like these that it is mandatory to test software. Let us consider another example. How about a banking product? Let us suppose that a bank is supposed to pay interest @ 5% per annum to all its customers, who have opened savings accounts with it. Now, what would happen if this software was not tested and the interest rate was inadvertently specified to be 50% per annum? Individual account holders might make a fortune for a while but the bank will soon go bankrupt. Now, consider the reverse case. What would happen if the interest rate got stored as 0.5% per annum? In this case, individual customers will lose initially and the bank might not even know about this bug till someone points it out. On the basis of all these examples, we can easily understand the significance of software testing. In fact, the importance of software testing can not be overemphasized.

That's it for the day, friends! Do let me have your feedback!