Back to the 2023 paper

Module 4: Software Testing

20237m

What are drivers and stub modules in context of integration and unit testing of software product? Why are stubs and driver modules required?

Worked SolutionAI Assisted

Solution

Drivers and Stub Modules

Context: Integration & Unit Testing

  • Stub: Dummy called module (subordinate). Replaces not-yet-built lower modules in Top-down integration. Simulates return values.

    • Ex: Main → Stub pay() returns dummy "success"
  • Driver: Dummy calling module (superior). Replaces not-yet-built upper modules in Bottom-up integration. Calls unit under test.

    • Ex: Driver test_harness() calls calculateSalary()

Why Required?

  • Modules developed independently / incrementally; not all available at test time
  • Need to isolate unit, simulate interface without building whole system
  • Reduce dependency, enable early testing

Top-down needs stubs, Bottom-up needs drivers, Sandwich needs both.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.