|
||
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.
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.
Select ModeIf 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.
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 Object
Message Test Object
Whitehole Object
Blackhole Object
Flag Object
Clock ObjectObjects 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:
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.
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
appears
if a connection would cause a temporal violation.
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
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.
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:
is pressedThe 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.
|
Copyright © 2003-2005 by Bellum Software
last updated on 29 May 2005 |