Previous Chapter | Table of Contents | Next Chapter

Chapter 5 - Using Test Sheets

A Test Sheet is used to lay out a test scenario. A test scenario contains one or more instances of Processing Entities (PE) and consists of one or more messages passed to one or more of the PEs in some order. The purpose of running a test scenario is to observe the behavior of a part of the protocol model in order to determine if the model has been designed correctly.

Each Test Sheet contains one test scenario. You may use as many Test Sheets as necessary to create as many test scenarios as desired. The objects that can appear in a test scenario are PE Test, Node, Message Test, Action, Whitehole, and Blackhole. The information in Chapter 2 about Test Sheets should be reviewed first.

To create a new Test Sheet, use the menu item Edit>New Sheet>For Testing. A new Test Sheet is created containing a number of initial test scenario objects. There is one PE Test instance for each PE on the related Edit Sheet. Also, there is one Whitehole object placed on the Test Sheet.

Note: The related Edit Sheet is determined when the Edit>New Sheet>For Testing menu item is invoked. If the currently selected binder Tab is an Edit Sheet, than that one will be used, otherwise it will be the first Tab to the "left" which contains an Edit Sheet. Also, when an Edit Sheet is deleted, all Test Sheets related to it will also be deleted.

The current Test sheet can be copied to form a new identical sheet by selecting the menu item Edit>Copy Sheet>.

Right clicking on a sheet tab will bring up a menu which includes options for renaming the sheet, copying the sheet, changing the tab order, and for bringing up a window to show the Sheet properties.

Creating and Deleting Objects

Objects can be created, selected, and deleted by using the Selection and Object buttons along the top of the Graphical User Interface (GUI). Figure 5.1 shows the Test sheet buttons.

Test sheet buttons
Figure 5.1 Test Sheet Buttons

Selection Button

Arrow button Select Mode
Left-click on the select (arrow) button to turn on Select mode. In Select mode, an object can be selected by left-clicking on it. Object selection is indicated by one or more handles being shown on the object. Multiple objects can be selected by holding down the <Shift> key while doing the selections.

If the <Delete> key is pressed while one or more objects are selected, those objects are deleted from the Test sheet. When a Message Test object is deleted, all objects with a temporal dependency on the object are also deleted.

Object Buttons

A left-click on any of the following Object Buttons will put the Test Sheet into a mode where the object can be created.

PE Test button PE Test Object
Left-click somewhere on the Test sheet to create a PE Test object. A window will open to allow you to choose which PE object should be associated with this PE Test object.
Message Test button Message Test Object
Left-click on a Whitehole or Action object to begin the creation of a Message Test. Complete the Message Test connection by left-clicking on a Blackhole object or on one of the small cross shapes under the appropriate PE Test object.
An Action object emanates from and orbits around a Node. If the circle portion of an Action object is colored white, then a Message object is connected to the corresponding Action event in the model and it is possible to start a Message Test on this Action object. If the Action object is colored red, then there is no Message object available to which to connect a Message Test.
When starting a Message Test from a Whitehole object, a popup menu will display the labels of the Message objects in the model, allowing you to choose the Message object of which the Message Test will be an instance.
Node objects anchor the reception end of a Message Test object to a PE Test object. They are created and destroyed automatically as Message Test objects are attached and detached.
When a Message Test object is deleted, all Message Test, Node, and Action objects with a temporal dependency are also deleted. The temporal dependency is determined by two axioms:

  • A received message must be preceded by a sent message.
  • Given a Guard event (attached to a Node) which is above another Guard event (attached to a Node) on a PE Test stem, the upper Guard event must precede in time the lower Guard event.

Whitehole Object Whitehole Object
Left-click anywhere on the Test sheet to create a Whitehole object. A Whitehole object is used as a starting point for a Message Test that does not originate on a PE.
Blackhole Object Blackhole Object
Left-click anywhere on the Test sheet to create a Blackhole object. A Blackhole object is used as an ending point for a Message Test that does not terminate on a PE.
Flag Object Flag Object
If there is State() associated with a PE Test, then a Flag object can be created to monitor and display the state values. Left-click on a cross shape under a PE Test to create a Flag object. As the Flag is created, a popup menu allows you to select the names of the states that are to be displayed. The displayed values are updated when the test scenario is executed. A Double-left-click on the object will redisplay the popup menu.
Clock Object Clock Object
A Clock object is used to represent the passage of wall-clock time. Left-click on a cross shape under a PE Test to create a node and attach the Clock object.

Moving and Resizing Objects

Objects can be moved and resized after being selected in Select mode. Not all objects can be resized with the cursor. For example, a selected Node is shown with only one handle which is used to drag the Node to a new location. Almost all objects have restrictions in their axes of movement in order to maintain object relationships. For example, a Node object must stay on the stem of its associated PE Test.

Like the Edit sheet, there are two types of handles which can appear on objects. The traditional handle is square-shaped and is meant to be clicked and dragged. The other type of handle is diamond-shaped and appears at the ends of lines. When a diamond-shaped handle is clicked, the handle goes away and the line follows the cursor so that the line can be repositioned.

The following objects can be moved and/or resized:

PE Test Object
A PE Test object can be moved horizontally by left-clicking and dragging it. It can be resized by selecting the PE Test object and then left-clicking and dragging the handles.
Message Test Object
The ends of a Message Test object are bound to its starting and ending objects; however, there are some other movement operations that can be performed. The following operations can be performed when a Message Test object is selected:
Node Object
A Node object can be moved vertically by left-clicking and dragging its handle. The movement of the Node is bounded by the location of its neighbor nodes above and below.
Whitehole Object
A Whitehole object can be moved to an arbitrary location on the sheet by left-clicking and dragging the object's handle.
Blackhole Object
A Blackhole object can be moved to an arbitrary location on the sheet by left-clicking and dragging the object's handle.
Flag Object
The box portion of a Flag object can be moved to an arbitrary location on the sheet by left-clicking and dragging it. Selecting the diamond-shaped handle allows the Flag to be moved to a new location under the PE Test object. The location of the Flag stem can be changed by selecting and moving the Node which anchors the Flag to the PE Test.
Clock Object
The location of the Clock object can be changed by selecting and moving the Node which anchors the Clock to the PE Test.

Originating Messages

A Message Test object can originate from a Whitehole object or from an Action object by left-clicking on one of these objects while in Message Test mode.

The creation and connection of a Message Test object represents an instance of a message being sent and received. Origination from a Whitehole object represents a message which seemingly appears "out of nowhere". The Test sheet allows any message in the test scenario to originate from a Whitehole.

When choosing the label of a message originating from a Whitehole, one of the labels available in the list is Init_Msg. This Message object is hard-coded into the model. When the Init_Msg Message Test is connected to a PE Test, all of the Initial Rules are presented in a popup window so you can select which Initial Rule is to be attached to the PE Test. All Rules in the model which have no Guard event are considered to be Initial Rules.

Connecting Messages

The Test Sheet allows a Message Test object to be connected only to a PE Test which corresponds to the PE to which the corresponding Message connects in the model. In Message Test mode, the cursor changes to a crosshair pointer only when under an appropriate PE Test. Left-clicking then causes a Node to be created and the Message Test to be connected to the new Node.

When doing Message Test connections, the Test Sheet does not allow a connection to be made which would be a temporal violation. In other words, you are not allowed to place an event earlier in time than an ancestor event. A forbidden icon Forbidden Object appears if a connection would cause a temporal violation.

Using Flag Objects

The Flag object is used to display selected contents of the State() array. When the Flag is created, a popup menu allows you to select the array entries which should be displayed. The entries which appear in the menu are those names which are in the State() array after the latest running of the test scenario.

Once a Flag is created, the test scenario must be executed (with the Execute Button button) in order to display the runtime values of the selected State() entries.

A Double-left-click on an existing Flag object causes the menu to reappear so that the displayed entries can be changed.

Executing Test Scenarios

Arranging the Message Test connections on a Test sheet creates a specific order of events to execute for each PE Test. The simulation is run by invoking <scenario_tag> execute, which invokes <petest_tag> execute in order to execute the events for each PE Test.

A scenario will be (re)executed in the following situations:

The purpose of running a test scenario is to ensure that all state in the PE Tests has been updated in the proper sequence. Whenever the test scenario or the protocol model (on one of the Edit sheets) is modified, the test scenario must be re-executed in order to reflect any potential changes in state caused by the modification. The execution algorithm for a test scenario is straightforward and is based on the basic message passing model:

Go here for a more detailed explanation of the execution loop.

Previous Chapter | Table of Contents | Next Chapter

Copyright © 2003-2005 by Bellum Software™
last updated on 29 May 2005