The first step of being a tester is understanding what testing entails. Let’s start with a very simple definition. Testing is making sure that the application does what it is supposed to do and does not do what it is not supposed to do.
That doesn’t sound so bad, but what are the implications of this definition?
If we’re going to test an application, we first have to know what it is supposed to do. Ideally this is answered by other people. Requirements, specifications, and design documents help to answer this question. Common sense should be able to fill in the gaps.
In practice, this never happens. You will always run into a scenario when writing test cases and even while testing where you cannot answer the question, “What is this supposed to do?” Knowing who can answer that question and having an open communication channel to those people is important.
Even with a perfect specification, what an application is supposed to do can be affected by physical limits. For example, a spec may say that an application should support an infinite number of users, but this is practically impossible. Even if you owned every hard drive in the world, there will still be a limited amount of space to store those users in. What an application would really do is, “support a large enough number of users so as to be effectively infinite.” Now you have the question of, “What is ‘a large enough number’?”
Once we know what an application is supposed to do, we have to decide how to verify that it does that. This might seem simple, but once again, it proves to be a significant challenge. Consider a program that is a fibonacci sequence generator. A fibonacci sequence is a sequence of numbers where each number in the sequence is the sum of the previous two numbers. The beginning of the sequence goes like this: 1, 1, 2, 3, 5, 8, 13.
Now think about how you would test this. Would you hand calculate the sequence and compare what the program generates to your sequence? If you decide to do that, I hope you really like where you’re sitting. The sequence is infinite, which means you are going to spend the rest of your life trying to test the generator in this way.
Don’t worry. In reality the sequence generator would stop working before that. Unfortunately, it stops working when it crashes. When this happens will depend on multiple factors including the language it was programmed in and what platform it was running on. These affect the implementation of the generator, and it may result in the program crashing when the value passes 4,294,967,296 or 2,147,483,647 or 65,536. Or it may not crash at all and suddenly start spitting out negative numbers. It all depends on how it is implemented in code, and that is generally hidden to testers.
We already have the problem of testing a program that in theory never ends when it is working correctly. Now we have to consider everything that the sequence generator is not supposed to do. It is not supposed to:
OK, so the last three are practically impossible, but they are still in the realm of things that the program is not supposed to do. But the first two are reasonable, and even likely, and the third is not as farfetched as it may seem.
Add to this the problem of making sure that something doesn’t happen. This is not always impossible, but it is very difficult. You might find that it crashes when calculating the 5,627th number. You still don’t know if it will crash when calculating the 9,321st number.
So by examining our simple definition of testing we’ve gone from difficult, to impossible, to soul-crushingly impossible. This is where the art of testing comes in. A tester’s skill is in covering enough of this infinite space to demonstrate that a user is unlikely to encounter a defect during the time that they use the program. Finding the answers to the question of what an application is supposed to do, figuring how how to make sure it is doing what it is supposed to do, predicting possible points of failure, and finding the failures that nobody ever thought were possible: These are just some of the things that an experienced tester is capable of doing.