0
3.8kviews
Describe how drivers and stubs can be used in unit testing with neat diagrams.
1 Answer
0
299views

1. Drivers

  1. Drivers are tools used to control and operate the software being tested.
  2. One of the simplest examples of a driver is a batch file, a simple list of programs or commands that are executed sequentially. In the days of MS-DOS, this was a popular means for testers to execute their test programs.
  3. They‘d create a batch file containing the names of their test programs, start the batch running, and go home.
  4. With today‘s operating systems and programming languages, there are much more sophisticated methods for executing test programs.
  5. For example, a complex Perl script can take the place of an old MS-DOS batch file, and the Windows Task Scheduler can execute various test programs at certain times throughout the day as shown in Figure below :

    enter image description here

2. Stubs

  1. Stubs, like drivers, are white-box testing techniques.
  2. Stubs are essentially the opposite of drivers in that they don‘t control or operate the software being tested; they instead receive or respond to data that the software.
  3. The Figure shows the general view of stub configuration.

    enter image description here

Please log in to add an answer.