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

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.