1 / 8

Driver and Stub

Driver and Stub. Testing and Debugging Functions -- Driver. Each function should be tested as a separate unit Testing individual functions facilitates finding mistakes Driver programs allow testing of individual functions

tania
Télécharger la présentation

Driver and Stub

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. Driver and Stub

  2. Testing and Debugging Functions -- Driver • Each function should be tested as a separate unit • Testing individual functions facilitates finding mistakes • Driver programs allow testing of individual functions • Once a function is tested, it can be used in the driver program to test other functions • Function get_input is tested in the driver program

  3. Testing and Debugging Functions -- Stub • When a function being tested calls other functionsthat are not yet tested, use a stub • A stub is a simplified version of a function • Stubs are usually provide values for testing ratherthan perform the intended calculation • Stubs should be so simple that you have confidencethey will perform correctly • Function price is used as a stub to test the rest of the supermarket pricing program.

  4. Function Exercises

More Related