In Controller Tester, if there are no libraries used in the target function when executing a test, if the libraries are not yet developed, or if the variables not declared are used, it creates automatically the stubs instead. The stubs are created when running the test and the body is not implemented.

You can add stubs directly in addition to the stubs created in Controller Tester. Multiple stubs can be created for the same function and the stubs created can be linked to each test.

You can control the behavior of each stub by using user macro within the stub. The value used in the user-entered macro can be controlled in Edit a test case tab for the test linked.

Function type

Type Description
Function Function without deficition
Function Function with definition
Variable Global variable

Stub type

Type Description
User stub User-defined stub
Build stub Auto-created stub
Old version stub Stub with 2.3 or less version

Menu

Menu Description
Create Creates stubs.
Delete Deletes stubs.
Import Imports the stub file exported.
Export Exports a stub file.
Save Saves the change stub information.
Enable Enables stubs.
Disable Disables stubs.

Create stubs

  • Create stubs in Stub view
    1. Click the pull-down menu (▽) in Stub view and click [Create] menu.
    2. Check the functions to be created as stubs and select [OK].
  • Create stubs by drag-and-drop in the Test Navigator
  • Create stubs by drag-and-drop in the Test Navigator
    1. Select the functions to be created as stubs.
    2. Right-click it and select [Create Stub] context menu.
  • Create and Link in Test Editor
    1. In the test structure of Test Editor, select the stubs or sub nodes.
    2. Select [Add New Stub…] button on the right section.
    3. Check the functions to be created as stubs and select [OK].

Delete stubs

  • Select and right-click unnecessary stubs and select [Delete] menu.

Edit stubs

  • You can check the macro information by pressing ‘Ctrl + Space’ in the Stub Code screen. After editing the stub code, press ‘Ctrl + S’ or [Save] button in the toolbar to save it.
  • In the stub setting screen, the description can be edited.

Link between stubs and tests

Each stub can be linked to the host/target test.
If you select “Stub” in the test structure editor, you can edit all the stubs included in the host and the target.

If you select “Host” or “Target”, you can only edit the stubs in the selected test environment.

  • Dragging and dropping into the test editor in Stub view
  • Link with [Add Stub…] button in Test Editor.
    1. Select stubs from the test structure in Test Editor.
    2. Select [Add Stub…] button on the right section.
    3. Among the existing stub list, check the stubs to be linked and select [OK].

Unlink between stubs and tests

Select the stubs linked in the Test editor and select [Remove Stub] button or select the stubs in the test structure tree and right-click it to unlink them.

Export stubs

  1. Select and the stubs to be exported and right-click and select [Export…] menu.
  1. Specify the saving location of the stub file in the directory dialog and select [OK].

Import stubs

  1. Select [Import…] menu from the pull-down menu (▽) in Stub view.
  1. Select the stub file to be imported and select the [Open] button.

Use/Not use stubs

You can set whether to use the created stubs.

  1. Select the stubs and right-click and select [Disable] menu.
  1. The stub image decorator is added and the color of the stub name changes to gray as shown in figure below.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.