Wednesday, July 22, 2015

Basics of Software Testing - Part-I : Basic Idea and Mindset

A little background about this - Each person may have their own way of testing or finding issues. They may not necessarily find my method helpful to understand the basics, this is something i'm trying to generalize for the new comers in software/ firmware testing. My intention is to make a series out of it, if i can and get enough motivation to write the basic stuffs.

Software Testing Basics:
A software is a program that takes some input, process it and then displays the output. That's the most generic statement for software. Software testing is to make sure it takes and displays the correct result and handles the invalid scenarios properly.

Example:
For example, lets imagine a software functionality that takes two input as A and B, then adds them up and display the result.
A + B = Result
Looking at it, you get the idea. Best case scenario would be : two inputs are 1 & 2 and then process the input with given operator and the outcome as 3. (1+2=3). 

And then you re-run the same program few times.


Testing ideas/ Mindset:
“Challenge” is the one of the key factor in testing.  When you were given software to test, you need to basically challenge the product to find out the issues out of it. Even that the expected outcome would be correct, our task to challenge it and try to break it from every possible angle.
It’s so simple. So what’s the big deal about it? From a testing point of view, first you have to have a mind- set that will tell you that the expected result will not always be equal to the input. Here are some things that I would consider:
  1. Two variable inputs- could be anything. Could be
    1. Empty/ Null- try with empty inputs
    2. Alphanumeric- try with non numeric inputs
    3. Numeric- try integer/ long numeric values,
    4. Real - try real/ big real number,
    5. Big floating point number - try floating point calculation,
    6. Negative number- try with negative number,
    7. Special characters - try different characters like space, !@#$%^&&*(_)


  1. Then comes the operator sign. It could be:
    1. Regular arithmetic operators  +, -, /,x,
    2. Empty/ Null,
    3. Numbers,
    4. String


  1. Then the result. It could be
    1. The expected result – may display the correct result,
    2. Unexpected result – on a 2nd run it may display the number with previous result,
    3. Error/ Exception – displays error/ exception (divide by zero, infinity etc)


  1. Output could be
    1. Nothing (not output at all, fall into infinite loop or something),
    2. Could crash the operating system,
    3. Output can cause out of memory,
    4. People can die
    5. Earthquake/ Tsunami may happen


These are some basic things that can happen on a simple software function. When you have the mind-set of challenging the outcome, you will figure out the ideas by yourself how you can break it. You have to think beyond the basic expectation. Even though the last point (4.d, 4.e) may or may not happen, but you have to prepare yourself with unthinkable.  
When a programmer writes the code, the first thing they do is to write the code to process the input and output. Then they write more lines of code just to protect from this kind of scenarios as mentioned above. And, as a human being and as a nature of the job, they will make mistake, may not think about all of the possible things an end user can possibly do. Tester’s task is  to think like the end user (with a bit of technical knowledge) and make the code less vulnerable to the unwanted scenarios.

Testing is challenging. It requires more patients and different angle to look at it. I personally take it as fun because programmers are little bit scare (or annoyed) of me. :-)

Next topics: System / Environment

No comments:

Communication - it's very important in recruiting people

One of the common part of our professional life is we get mails from recruiters time to time regardless whether you are looking for job o...