Friday, 25 March 2011

Pair Testing



Today when I was reading something on the internet, I cam across an area called Pair Testing. Being curious, I started reading about it. I found it interesting and I thought of sharing it here.

Pair Testing is a Testing process where two people do testing at the same  computer or  terminal.One person will be handling the computer and the other discusses, reviews various scenarious and cases It involves a tester and a developer\business analyst. It is genrally conducted as a Exploratory\Ad hoc testing . It is very helpful especially when the business requirements are stated poorly or has ambiguities in it.  Pair  Testing is a methodology used in Agile Software Development.  The most interesting fact about this is that it is only 15% slower than the conventional testing method .

The advantages of this testing is as follows:-
  1. The domain knowledge of the analyst and the testing skills of the tester go hand in hand. Hence many bugs can be found when compared to the tester and the analyst\developer working alone
  2. Testers get to learn about the software application and the business workflows explicitly 
  3. The Business Analyst and the developers learn to think in all directions as how a defect can creep into the system, various vulnerabilities,risks etc  Hence this inturn improves the unit testing and the cost of coreecting bugs reduces drastically 
  4. The team inturn understands the requirements better 
When pair testing is to be Used ?
  1. When the software application\requirement  is to be understood within a short span
  2. Can be used to train freshers in testing domain 
  3. Sometimes while testing alone, testers find a bug that keep ocurring randomly. With the help of pair testing the developers and the testers can find the pattern of the bug and  can fix these bugs accordingly 

When Pair Testing is not to be Used ?
  1. When a structured testing is being done 
  2. Automation Testing 
Preparing for Pair Testing
  1. Two people should voluntarily form up to do pair testing. They both need to be in the same wavelength and their skills must be complementary to each other 
  2.  A work station with adequate seating space for two and an undisturbed environment
When starting for Pair Testing, the objective must be clear although it is more like ad hoc or exploratory testing such as getting requirements clear, understanding the software system, finding patterns in defects etc. These need to be clearly stated for starting the pair testing

While executing the pair testing one must execute the testing and the other must conrol, make note of the behaviour and monitor the system. The users must swap roles periodically.

After finishing pair testing the observations must be recorded, bugs must be raised and taken up accordingly.

In a nut shell, pair testing is an interesting and an effective way of working and one should use this whenever he\she has the opportunity to use it.




















Sunday, 13 March 2011

Types of Testing

Testing consists of two parts:-

1) Verification: Building the product right

2) Validation : Building the right product

The major difference between the both is that Verification not only helps in finding the defect but also helps in finding out the location of the defect. On the other hand Validation only helps on identifying the location of the defect.

Secondly Verification is a static testing i.e. it mainly involves reviews such as review of design, requirement, code etc. whereas Validation is a dynamic testing as checking whether the software is doing what it is suppose to do and is also not doing what it is not suppose to do.

Both are equally important and need to be done during the SDLC process.

Using both Verifcation and Validation there are different types of Testing can be done and are classified as follows:-

Based on the Knowledge about the code Testing can be classified as:-

Black Box Testing: The Tester has absolutely no knowledge about the code. The Tester is expected to test the software based on the requirement given to him. Most of the testers in the software industry are black box testers.

White Box Testing: The person testing the software has knowledge about the code and how the software has been developed. This is genrally followed by the Developers to conduct Unit Testing.

Each of the Testing have their strategy to follow which we will see below.

In Black Box Testing the following strategy is followed:-

1) Boundary Value Analysis: : To test  a field\variable in a software the range of the field\variable will be given. The field\variable should accept values within the given range. So this testing will check how the software will behave if a value is given below the given range, well in limits with range and a value above the given range.
 eg: A Mobile number field is to be checked. It is said that the mobile number should be of 10 digits and should start with 9. So the range here is defined as from 9000000000 to 9999999999.  So the system should accept a value within this range and should not accept values that is below or above the given range. Also looking into ASCII character value wise it should take those ASCII inputs that are from 0-9.

Boundary value analysis should also be used when there are overlapping of ranges to check  those values that fall in the overlapped region. 

2)Equivalent Partition Method: This strategy is used from the user perspective if the user would have to make a choice from a list of menu in a menu driven software and check if all the choices are working and whether the software system is rejecting an invalid option or not. In my experience I have used this predominantly in CUI programs where menu driven option is highly used  and checked how the software behaves . It is supplemented to the boundary value analysis

3)State Transition Technique: This strategy is followed if a software system has various states and a state transition diagram that shows as how the software system moves from one state to another. eg: Let us consider an online transaction to buy a product. There exists states such as
a) Submitted: When the purchase order is submitted to the vendor
b) Verfication: When the card details are verified.
c) Sold: When the transaction has been made
d) Delivered: When the product is delivered to the client
e) Failed: When the transaction has failed
















As seen in the above picture, the transition diagram will be as follows. So for a tester to test the software system following the above diagram, he would have to have two test cases, one for when the transaction is successful and the other for testing in case of failed transaction

4) Ad Hoc Testing: This is testing is an exploratory testing which is not documented or planned. The tester would explore the software to find the presence of bugs, vulnerabilities and risks. It is an informal way of testing and does not have any specific technique to follow. One would require good observation, high analytical skills and observation to perform this test.

 Now that I have now discussed about Black Box Testing I would now discuss about White Box Testing .

In white box testing as far as my experience , I have used a method called
Control Flow Path: Through this strategy, a coder finds the number of if else paths, loops etc and ensure that the program executes each of the control flow path atleast once
Eg:



















Looking at the above code snippet we have three paths.
1) In Case 1 when the number is odd
2) In Case 1 when the number is even
3) When the choice is not 1.

Hence we would require three types of test data to test the above code.

Testing Based on Requirements 
So far I discussed about testing that was classified based on the knowledge of the tester about the code. In this section we will see the testing that has been categorized based on the requirement.

Based on the Requirement Testing can be classied as
Functional Testing:  This testing is done based on the business requirement and the business workflows that are to be followed

Non Functional Testing:  These testing  study the basic charactersistics of the software system. They are further classified as follows:-
1)Performance Testing:  This testing is used to determine the performance level of a software system. eg: To check if a software system can handle X users with Y amount of data being fed into the system with Z concurrent tranaction at any point of time.  The basic attributes that are determined during this test are  Throughput, Response Time, Turn around Time,Load etc.
 
2) Load Testing :  This testing is done to determine if the software system can handle the expected load during real time execution

3) Stress Testing :  This testing is done to determine how the software system can handle when large volumes of unexpected data are required to handle by it .

4) Structural Testing:  This is used to test the skeleton or the basic architecture of the software.  The disadvatge of this testing is it does not check whether the software system's functionality is working correctly or not.

Thus I hope I was able to give a clear picture about the given topic. More in my next post. Till then
Cheers From,
Sai :) 









Friday, 4 March 2011

What is Testing ? Why Testing ?

In my previous post I gave my experience as what it is to be a tester. But have you all wondered what is Testing ? Why is Testing done in Software Developemnt ?

In SDLC Testing is a significant phase.

What is Testing ?
* Testing is a risk reducing activities

* It is mainly aimed at reducing faults and bugs in the software

* It is used to determine whether the requirements have been met

* Testing is not a process that happens at the end of development but it is something that starts right from Requirement Specification

* Testing is a way to measure the quality of software produced

Testing is completely different from debugging.

Testing is a process of finding the presence of faults and defects. While debugging is a process of correcting the faults and the defects present in the Software. Debugging is done by the developers while testing is done by testers.

By the above statement people genrally wonder why there are testers seperately? Cant the developers do the job of a Tester ?

A Team generally consist of testers seprate testers because the general pschycology of a person is to not accept faults on his\her creation. So if there is a person who was not involved in the creation of a product, he\she will not be biazed and can raise more defects and bugs that are actually present in the Software. The aim of testing is not to show that software is doing what it is suppose to do, but to show what the software is doing what it is not suppose to do. In short the aim of the tester is to raise as many defects and bugs present in the software as possible in the early stages of development so as to improve the quality of the System.

The Significance of Testing in Software Development is
* Rigourous testing and documentation is important to reduce the risk and defetcs in the software being developed

* It is not a phase that comes at the end of SDLC but however it is a phase that satrts right brom the start

*The advantage of testing is when the process raises defects and bugs at the early stages of developement thus reducing cost of development and improving quality

* Testing shows only the presence of bugs and not the absence. So it is genrally considered that a bug free product is not possible

Before I move on I would like to discuss about Quality

What is Quality ?
There are different definitions given by differnt bodies. But I like this definition.

It is the degree to which a software adheres to the explicitly and implicitly stated requirements.
eg:- Let us consider a web application for say for railway reservation. We say that the web application is of good quality when:-

1) The web application has a easy to use user interface
2) The web application meets the user requirements
3) The web application is a very low response and turn around time
4) It can handle umpteen users and conduct multiple concurrent transaction and provide the same response time to all its users
5) The application handle the unexpected huge amount of load it receives from the users
etc.

This gives a small picture as what is quality. There are various quality models that i will discuss soon.

I will now discuss the next section as

Why do Testing ?

* A Bug free software is never possible. As we humans are never perfect and as I said testing shows the presence of defects and not its absence. Hence a bug free product is almost impossible. But we need testing to remove the defects that are present

* A software that posses bugs can lead to problems:-
a) Loss of money.
Let us consider a net banking application for fund transfer between two savings aacount. A bug existed in updation of the database which was never found. Just imagine how much will the customers lose if such an application is released

b) Injury to health and even death:
I remember reading once that there was a cancer curing machine developed that was controlled by a software. The software controlled the amount of radiation that will be exposed to a patient. The software had a defect and the machine exposed huge amount of radiation to the patients which inturn caused death to many of the hospital's patients .

c) Wastage of time.

* To improve quality of the system

* To check if the requirements are met


One must undderstand the common causes of defects that happen in SDLC. They are as follows:-

* Human errors. This happen due to tight schedules and dealines. A team might have the best programmers and developers in the world, but under tight situation errors and mistakes are prone by anyone

* Complexity of the technology and solution used and provided. In such complex scenarios many loopholes tend to exist which are to be found by the testers and they need to be blocked.

* Programming errors which cannot be avoided as no one is perfect and working on tight schedules makes it happen.

* Wrong programming styles used

* Poor requirement captured

I hope this article thre some light on testing. More on my next article.

Till then Cheers From Sai !!!