Sunday, January 31, 2010

STUB VS DRIVER

Both these terms, Stub and driver, are mainly used in Software integration testing.


->Stub is a piece of code emulating a called function, a driver is a piece of code emulating  a calling function.


-> Stubs are created integration testing like Top-down approach. 
    Drivers are created integration testing like bottom-up approach.

-> Stub: A piece of code that simulates the activity of missing component. 
    Driver: A piece of code that passes test case to another piece of code.



Example - For Unit Testing of ‘Sales Order Printing’ program, a ‘Driver’ program will have the code which will create Sales Order records using hard coded data and then call ‘Sales Order Printing’ program. Suppose this printing program uses another unit which calculates Sales discounts by some complex calculations. Then call to this unit will be replaced by a ‘Stub’, which will simply return fix discount data.



Also, check out Free ISTQB Training Material here

www.testing4success.com - Application QA/Testing     Mobile App QA/Testing     Web Testing     Training
Iphone App QA  Android App QA  Web QA





Suppose I have a workflow in which the code functionality flows from one system to the another and then to the third one, if the second system in the flow is down then we can use a simulator for that step which will act like a Driver. Similarly, if there was some xml response which we might have been receiving from the second system than that part will be called as Stub.

3 comments:

  1. Oh and forget about system excess weight exercises or the Bowflex or Total Health and fitness center.


    my blog dumbbell sets

    ReplyDelete
  2. Dumbbells are one of the most fundamental weight education tools occupies a
    exclusive spot in each and every fitness center.


    my site click through the up coming internet page

    ReplyDelete
  3. Particularly when you end up picking to do your
    exercises in your own home, make sure that you just employ a home gymnasium
    equipment assembly specialist to create your
    fitness machines for yourself.

    Also visit my homepage :: best adjustable dumbbells

    ReplyDelete