Documente Academic
Documente Profesional
Documente Cultură
Objectives: To identify the usage of stubs or drivers in the context of integration testing scenario.
1. Background
Integration testing is carried out after the completion of unit testing and before the software is delivered for
system testing. In top down integration testing, dummy stubs are required for bottom level modules.
Similarly in bottom up testing, dummy drivers are required for top level modules.
1.1 Top down Testing: In this approach testing is conducted from main module to sub module. if the sub
module is not developed a temporary program called STUB is used for simulate the submodule.
1.1.1 Advantages:
Advantageous if major flaws occur toward the top of the program.
Once the I/O functions are added, representation of test cases is easier.
Early skeletal Program allows demonstrations and boosts morale.
1. 1. 2Disadvantages:
Stub modules must be produced
Stub Modules are often more complicated than they first appear to be.
Before the I/O functions are added, representation of test cases in stubs can be difficult.
Test conditions ma be impossible, or very difficult, to create.
Observation of test output is more difficult.
Allows one to think that design and testing can be overlapped.
Induces one to defer completion of the testing of certain modules.
1.2 Bottom up testing: In this approach testing is conducted from sub module to main module, if the main
module is not developed a temporary program called DRIVERS is used to simulate the main module.
1.2.1 Advantages:
1.2.2 Disadvantages:
2. Stubs and Drivers. These are used in integration testing for Top-Down and Bottom-Up approach.
2.1 A ‘Driver’ is a piece of software that drives (invokes) the Unit being tested. A driver creates necessary
‘Inputs’ required for the Unit and then invokes the Unit. Driver passes test cases to another piece of code.
Test Harness or a test driver is supporting code and data used to provide an environment for testing part of
a system in isolation. It can be called as a software module which is used to invoke a module under test and
provide test inputs, control and, monitor execution, and report test results or most simplistically a line of
code that calls a method and passes that method a value. Figure 1 shows how driver works in testing
different program modules.
Figure 1. Driver implementation
2.2 A ‘Stub’ is a piece of software that works similar to a unit which is referenced by the Unit being
tested, but it is much simpler that the actual unit. A Stub works as a ‘Stand-in’ for the subordinate unit and
provides the minimum required behavior for that unit. A Stub is a dummy procedure, module or unit that
stands in for an unfinished portion of a system. Figure 2 shows how stub works in testing different program
modules.
3. Problem Description
Consider the scenario of development of software for Travel, Management System (TMS) is in
progress. The TMS software has 3 major modules namely Ticket_Booking_Module,
Hotel_Booking_Module and Taxi_Booking_Module. The Ticket_Booking_Module has 3 sub modules
namely Enquiry_Module, Booking_Module and Update_Module. The enquiry module uses
Date_Validation_Unit, Ticket_Validation_Unit and Place_Validation_Unit. Figure 3 shows the system
module hierarchy.
Place_Validation_Unit Ticket_Validation_Unit
Date_Validation_Unit
Source_Validation_Unit Destination_Validation_Unit
Note: Write the letter of your choice and explanation in the given table below, add more rows if necessary.
2. The coding and unit testing of all the module, sub modules and units of TMS are
completed except the Update_Module (coding and testing for Edit_Module,
Cancel_Module and View_Module are also completed). The bottom-up integration is to
be started for the TMS software. Mention any stub or driver needed to carry out the
integration testing? Type your answer in the given table below, add more rows if
necessary.
Stubs Drivers
3. Except the Taxi_Booking_Module, the coding and unit testing of all other modules, sub
modules and units of TMS are completed. The top-down integration is to be started for
the TMS software. Mention any stub or driver needed to carry out the integration testing?
Type your answer in the given table below, add more rows if necessary.
Stubs Drivers