Data AccessA stub for a data access object that isn't developed yet. Returns hardcoded values.
IntegrationA developer uses a stub to simulate integration with systems that she can't connect to on her local environment.
Test DataA developer uses a test stub to simulate a wide variety of responses from systems. For example, a developer may simulate rare response codes for a banking transaction that are difficult to arrange in development environments.
User InterfaceA developer initially populates a web page with a hello world message to test that a redirect is working.
StabilityA module does frequent transactions with an external system that is often down. A developer implements a test stub to replace the calls to the system to increase the reliability of unit tests.
SpeedA software function involves algorithms that are computationally complex. A developer implements a test stub to temporarily replace such algorithms to speed their unit testing.
|Overview: Test Stub|
Quickly developed code that is used as a placeholder to facilitate unit testing.
Unit testing when dependencies aren't ready, are unstable, slow or difficult to setup with required data.