Wednesday, 17 June 2015

MT - 33 - Stubs and drivers - What and Why ?

These two terms are used by developers to complete the flow of application for a undeveloped piece of code. By using the stubs and drivers the testers can test a part of application even if the other parts of application are not developed. These are basically dummy codes which may be used in integration testing. They are used to replace the missing software and simulate the interface between the software components in a simple manner.

The Stub is called from the software component to be tested. It is used in top down approach and they act as called functions.In this type highest level components are created first.Stubs will contain only functionality needed to be successfully called by a higher level component. It will simulate the behaviour of  a lower level component.






The drivers are used in bottom top approach and is called calling function.In bottom up approach, lower level components are created first.Temporary components called 'drivers' are written as substitutes for the missing code. Then the lowest level components, can be tested using the test driver

Stubs and driver are used in following condition :

• Suppose we want to test the interface between modules A and B and we have developed only module A. So we cannot test module A but if a dummy module is prepare, using that we can test module A.
• Now module B cannot send or receive data from module A directly so, in these cases we have to transfer data from one module to another module by some external features. This external feature used is called Driver.

No comments:

Post a Comment