Data Access
A stub for a data access object that isn't developed yet. Returns hardcoded values.Integration
A developer uses a stub to simulate integration with systems that she can't connect to on her local environment.Test Data
A 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 Interface
A developer initially populates a web page with a hello world message to test that a redirect is working.Stability
A 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.Speed
A 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 | ||
Type | Unit TestingCoding | |
Definition | Quickly developed code that is used as a placeholder to facilitate unit testing. | |
Value | Unit testing when dependencies aren't ready, are unstable, slow or difficult to setup with required data. | |
Related Concepts | TestingUnit TestingTest AutomationTest FixtureTest HarnessTest DriversMock Object |