Concept: Stubs
A stub is a component (or complete implementation subsystem) containing functionality
for testing purposes. When you use an incremental integration strategy you select a set of
components to be integrated into a build. These components may need other components to be
able to compile the source code, and execute the tests. This is specifically needed in
integration test, where you need to build up test specific functionality that can act as
stubs for things not included or not yet implemented. There are two styles used here:
- Stubs that are simply "dummies" with no other functionality than being able to
return a pre-defined value.
- Stubs that are more intelligent and can simulate a more complex behavior.
The second style should be used with discretion, because it takes more resources to
implement. So you need to be sure it adds value. You may end up in situations where your
stubs also need to be carefully tested, which is very time consuming.
|