In software testing field we have numbers of small concepts like Driver and Stub which are using and help us in different way to solve our daily routine problems. Basically the idea of Stubs and Drivers are frequently used in the case in software testing when we are checking or testing of dependents methods, Projects methods, Application’s Pages. This type of testing always help us to continue testing while we are working with or across the teams where teams are dependent on each other’s so then testing may be done in isolation with the rest of the system depending upon the context of the development cycle.
What is Stub?
Stub is basically a run time created dummy function method, Page, module which basically input some other module in projects. It is called the STUB. Stub using in Top Down approach of integration.
What is Driver?
Driver is basically a run time created dummy function method, Page, module which basically input some other module in projects. It is called the DRIVER. Driver using in Bottom Up approach of integration.
Please don’t mess both concept with each other basically both are dummy methods formation approaches but one is use in TOP DOWN Integration and other one is using in BOTTOM UP Integration.
Example for More Clarification:
Suppose you have a Tow pages of one web application Page One (Login Form) that is basically allow authenticated and authorized users to login in Application after entering their valid Credentials. Suppose this user redirected on Application Second Page (Dashboard Page) after successful login
Now let suppose your one developer has finished his work on Page one (Login Form) and wants to move in initial testing. Now here the problem you face that you can’t seem to test or check its functionality because the Page one (Login Form) can’t land or redirected the users on Dashboard page because it is in development or may be not started yet so without developing second page (Dashboard Page).
In this case, you create a dummy Dashboard Page here to check the login form’s user direction on Dashboard page. This dummy Dashboard page called by page. Such type of dummy is called a Stub.
Same as to know what a driver is, suppose you have finished Second Page (Dashboard Page) and is waiting for Page one (Login Form) to be developed. In this case you create a dummy to call the Dashboard Page. This dummy is called the driver.