---
title: "What are stubs and drivers used for in white-box testing?"  
description: "What are stubs and drivers used for in white-box testing?"  
author: "Chris Anderson"  
published: 2011-09-17  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/1275/what-are-stubs-and-drivers-used-for-in-white-box-testing  
category: "whitebox testing"  
tags: ["whitebox testing"]  
reading_time: 2 minutes  

---

# What are stubs and drivers used for in white-box testing?

Stubs and Drivers are the small programs used in the integration testing such that these programs are placed where the output of undeveloped modules. that is in some cases, some of the non priority module's output is needed in the project. then to get out of that situation, we write a small program such that it generates exactly similar output of the un-generated module. these programs are called stubs and drivers.\
\
Here stub is used when we are testing the application in top-down approach.\
and driver is used when we are testing the application in bottom-top approach.

\

## Answers

### Answer by Chris Anderson

Stubs and Drivers are the small programs used in the integration testing such that these programs are placed where the output of undeveloped modules. that is in some cases, some of the non priority module's output is needed in the project. then to get out of that situation, we write a small program such that it generates exactly similar output of the un-generated module. these programs are called stubs and drivers.\
\
Here stub is used when we are testing the application in top-down approach.\
and driver is used when we are testing the application in bottom-top approach.

\


---

Original Source: https://www.mindstick.com/interview/1275/what-are-stubs-and-drivers-used-for-in-white-box-testing

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
