A specialized implementation element used for testing purposes, which simulates a real component.
Other Relationships:  Part Of Implementation Model
Extends: Testability Element
Role:  Implementer 
Optionality/Occurrence:  Optional. Used if the real components are not available or are too expensive to use for testing.
Templates and Reports: 
     
Examples: 
     
UML Representation:  Element in the implementation model, stereotyped as <<test stub>>. 
More Information:   
Input to Activities:    Output from Activities:   

Purpose To top of page

The purpose of the Test Stub is to simulate a real component which is not available for testing.

Brief Outline To top of page

There are two aspects regarding the Test Stub: the degree of emulation and the lifecycle. Given the tests' scope and goals, a stub's implemenation could range from just an almost empty class which complies with a set of interfaces to a full-blown emulator which will perform very close to the real component in terms of functionality. Except for the simple throwaway tests, the stubs will have the same lifecycle as the components under test, therefore in most of the cases they need to be treated the same as product code.

Properties To top of page

Property Name  Brief Description  UML Representation 
name  the name of the class  attribute 
description  a brief description of the role of the class in the system  attribute 
responsibilities a listing of the responsibilities of the class  attribute 
attributes  the attributes of the class  attribute 

Timing To top of page

The stubs follow the development cycle of the components under test.

Responsibility To top of page

See Responsibility in Artifact: Implementation Element.

Tailoring To top of page

See Tailoring in Artifact: Implementation Element.



Rational Unified Process   2003.06.13