Initialization points
An initialization point (IP) is a user-defined constant or variable used to initialize attributes of an object. An IP is defined in the test behavior source code and can be data-driven from the test data table (TDT).
There are two ways to add initialization points to your test behavior code:
- By right-clicking in the code and clicking Component Test > Insert Initialization Point
- By right-clicking a row in the test data table and clicking Insert Initialization Point
In either case, you are prompted to select an existing variable or to create a new one. If you create a new variable, you need to specify its name and type. When you finish, a new row is added to the TDT for that variable.
If you request to define a new variable, a new row is associated with the initialization point. The cells in this row cannot be edited until you define a name and type.
Typically, you use initialization points to initialize variables that will be referenced by multiple cells in the test data table. Tying multiple references to a common variable allows a single change to propagate to multiple cells. The following screen capture shows a test data table from a test of a class called Person. In this example, a variable named zipcode is initialized before the HomeAddress and WorkAddress objects. In the test data table, the ZipCode attribute for each attribute references the variable defined by the initialization point named zipcode. By changing the zipcode variable once, both addresses are constructed with the new zip code variable.
![]()
Another common use of initialization points is for defining a set of objects that have defining attributes. A set of objects and their defining attributes cannot be created directly in a single cell using the set editor. You can define a set of objects by creating initialization points for each object that you want in the set and referencing these initialization points in the set editor.
Adding initialization points
You can add initialization points to a test in one of two ways:
- By right-clicking in the code and clicking Component Test > Insert Initialization Point.
- By right-clicking a row header in the test data table and clicking Insert Initialization Point.
Related tasks
Inserting initialization points