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 :) 









No comments:

Post a Comment