1 / 3

Stubs & Drivers

Stubs & Drivers.

farhani
Download Presentation

Stubs & Drivers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Stubs & Drivers Programs can involve the use of few to many programmer functions. Oftentimes the calling program for a function is not available to the function developer for testing. Likewise the developer for the calling program may not have all the working functions he/she needs to complete their development. To aide in the development of and debugging of programs utilizing functions, a programmer can write dummy code to simulate the missing pieces. These dummy functions are called stubs and drivers.

  2. Stubs A stub is a dummy function that is called in place of the real function. It has the same name, return type, number of arguments with the same types as the real function would have. However – all it actually does is display a message that it has been called with a particular list of argument. If it has a return type other than void, it should return a fixed value. Stubs are used to test and debug programs that call functions.

  3. Drivers Drivers are programs that help test functions by calling the functions with fixed parameters/arguments. It should contain statements that display on the console that say something like “Calling function so-and-so” with a list of arguments provided and “Return from function so-and-so” with any return values that it might receive. It should call the function it is testing multiple times with values that test all the logic in the function.

More Related