Driver and Stub

With what type of test is a driver and a stub most closely associated?

Questions by sentiflat10

Showing Answers 1 - 8 of 8 Answers

SSUUDDUU

  • Apr 29th, 2008
 

They are related to Integration testing.
Driver: When a module in the higher heirarchy has to be simulated, to test another module dependant on it, its called a driver
Stub: Its simulating or placing a module in the lower heirarchy.

Driver=calling function
Stub=Called Function

According to my understanding,
 Intergration testing : Integration testing is a logical extension of unit testing. In its simplest form, two units that have already been tested are combined into a component and the interface between them is tested. A component, in this sense, refers to an integrated aggregate of more than one unit.
Therefore,Stubs and drivers are not used in Intergation testing.

Link :msdn.microsoft . com/en-us/library/aa292128(VS.71) . aspx

Unit Testing :The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect. Each unit is tested separately before integrating them into modules to test the interfaces between modules. Unit testing has proven its value in that a large percentage of defects are identified during its use.
Therefore,Stubs and drivers are used in Unit testing.

Link :msdn.microsoft . com/en-us/library/aa292197(VS.71) . aspx

  Was this answer useful?  Yes

svilvana

  • Feb 4th, 2009
 

In simple terms

Drivers: Are the dummy programs that simply drives(pass) the data from one module to the other. For Ex: Module B (a driver) receives data from Module A and pass it to Module C

Stub: Are the dummy programs which does some functions/process on data and transfer the data. For Ex: Module B (a stub) receives data from Module A, process (do some manupulation) and then pass to module B.

Note: These definitions are not golden rules,People use the dummy programs(driver and stub) for their convenience.

  Was this answer useful?  Yes

These words are being used in Integration Testing.

Integration testing can be done in 2 ways.

-> Topdown approach
-> Bottom up approach

Topdown: Here first parents modules will develop first and then child modules, if at all any child modules missed then we will replace that missed ones with dummy programs, these are called STUB.'

Bottom up: Here first child modules will develop first and then parents modules, if at all any parents modules missed then we will replace that missed ones with dummy programs, these are called STUB.'

CNU

  Was this answer useful?  Yes

A Stub is code emulating a called function.

A Driver is code emulating a calling function.

Unit Testing is testing done on a 'micro' scale.  It verifies that individual units of code are working properly.

Integration Testing is a logical extension of Unit Testing.  In its simplest form two units that have already been tested are combined into a component and the interface between them is tested.

Stubs and Drivers are used in both Unit Testing and Integration Testing.

satyam

  • Nov 9th, 2014
 

I have doubt about stub and driver . when a unit is not completed then where can I place the stub , is it for unit or the whole module of that unit considered as stub

  Was this answer useful?  Yes

sridevi

  • Dec 6th, 2014
 

Stub is a prototype of a function.
Driver is a code which calls a function.

  Was this answer useful?  Yes

krishna

  • Feb 1st, 2015
 

Stub:
while integrating the module in top down approach if at all any mandatory module is missing then that module is replaced with a temporary program is called stub

Driver:
while integrating the modules in bottom up approach if at all any mandatory module is missing then the module is replaced with temporary program known as driver

thanks and regards
krishna

  Was this answer useful?  Yes

Navya

  • Jun 9th, 2015
 

Driver: In Bottom up integration approach, integrating a sub module with a parent module if the parent module is not available then a temporary code is generated. That temporary code is known as "DRIVER".
STUB: In a top to bottom integration approach, integrating main module with a sub module, if the sub module is not available, then a temporary code is generated. That temporary code is known as "STUB".

  Was this answer useful?  Yes

Neeru Gupta

  • Aug 10th, 2015
 

Driver and stub are most closely are associated with integration testing. To increase the effectiveness of integration testing you may use the TOP TO DOWN approach where higher level module are tested first, this technique require creation of STUB or you may use a bottom up technique where lower level modules are tested first this technique will require creation of DRIVER.

  Was this answer useful?  Yes

Bareddy

  • Jan 2nd, 2016
 

Driver and Stubs are under integration testing. Simply Driver means under contrastive sub-madual in top down approach and Stub means under contrastive main-madual in bottom-up approach.

  Was this answer useful?  Yes

Manmohan Garg

  • Jan 11th, 2016
 

Driver and Stubs are used in integration testing. It is difficult to track defect in an integrated design. So individual module are tested before they are integrated or as soon as a module is developed, it is tested without waiting for other modules.

Stubs and Driver emulates dependent modules for a module under test.

A stub act as "called by unit". So the module under test calls stubs while testing.

A Driver act as a "Calls the unit/Calling unit". So module under test are called by Drivers while integration testing.

  Was this answer useful?  Yes

Priyank

  • Jun 30th, 2016
 

Driver I used in bottom-up integration approach and stub is used in top-down integration approach.
Driver is a temporary calling Module.
Stub are special purpose programs, not completely implemented and replaced with original module as integration moves downwards in the application structure.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions