Subscribe by Email


Wednesday, October 13, 2010

Validation phase - Unit Testing - Stubs and Drivers

The validation phase falls into picture after the software is ready or when the code is being written. There are various techniques and testing types that can be appropriately used while performing the testing activities.

Unit Testing


A unit is allocated to a programmer for programming. Functional Specifications document is used as an input for programmer's work. The programmer prepares program specifications for his unit from the functional specifications. Program specifications describe the programming approach, coding tips for the unit's coding.
Using these program specifications as input, the programmer prepares unit test cases document for that particular unit. A unit test cases checklist may be used to check the completeness of unit test cases document. Program Specifications and unit test cases are reviewed and approved by quality assurance analyst or by peer programmer. The programmer implements some functionality for the system to be developed. The same is tested by referring the unit test cases. While testing that functionality if any defects have been found, they are recorded using the defect logging tool whichever is applicable. The programmer fixes the bugs found and tests the same for any errors.

Stubs and Drivers
A software application is made up of a number of units where output of one unit goes as an input of another unit. Due to such interfaces, independent testing of a unit becomes impossible. So here, we use stub and driver.
A driver is a piece of software that drives the unit being tested. A driver creates necessary inputs required for the unit and then invokes the unit.
A unit may reference another unit in its logic. A stub takes place of such subordinate unit during the unit testing. A stub is a piece of software that works similar to a unit which is referenced by the unit being tested but it is much simpler than the actual unit. A stub works as a stand-in for the subordinate unit and provides the minimum required behavior for that unit.
Programmers needs to create such drivers and stubs for carrying out unit testing. Both the driver and stub are kept at a minimum level of complexity, so that they do not induce any errors while testing the unit in question.


No comments:

Facebook activity