IBM
Contents Index Previous Next



The Coverage Viewer


In this final exercise of the SDL Simulator, you will learn to use the Coverage Viewer. The Coverage Viewer is a graphical tool that shows how much of a system has been covered during a simulation in the terms of executed transitions or symbols. By checking the system coverage, you can for instance see what parts of the system that have not been executed in the simulation so far.

What You Will Learn

Starting the Coverage Viewer

  1. Restart the simulator.
  2. Send the signal Newgame. Execute seven (7) transitions until the printed trace shows that the Game process is in the state Winning.
  3. Send the signal Probe and execute the next transition.
    Let us see how much of the system we have executed so far. By simply starting the Coverage Viewer from the Simulator UI, the current coverage information is displayed.
  4. Select Coverage from the Show menu. The main window of the Coverage Viewer is opened.

Using the Coverage Viewer

  1. If a symbol coverage tree is displayed, switch to a transition coverage tree by clicking on the Tree Mode quick button.
  2. To see all of the transition coverage tree, click on the All Nodes quick button. The button shown is as on Windows, it looks slighty different on UNIX.

Figure 120 : A transition coverage tree

Only a part of the tree is depicted.

  1. To only see those transitions that never have been executed, click on the Least quick button. You can now see which signals must be sent in which states to execute the rest of the system. The button shown is as on Windows, it looks slighty different on UNIX.
    • The Least quick button actually shows those symbols that have been executed the least number of times. The symbols that are dashed are present only to make the structure complete.
  2. In the same way, to only see those transitions that have been executed at least once, click on the Most quick button. You can now see which signals have been sent so far in the system. The button shown is as on Windows, it looks slighty different on UNIX.
    • The Most quick button actually shows those symbols that have been executed the most number of times. In this case, no transition has been executed more than once.
  3. To see the whole tree again, click on the All Nodes quick button. If you want to see a transition in the SDL Editor, just double-click on one of the signal input symbols or start state symbols. Try this!
    The Coverage Viewer can also show a symbol coverage tree, i.e. how many times each SDL symbol in the process diagrams have been executed:
  4. Switch to a symbol coverage tree by clicking on the Tree Mode quick button. Beneath each process diagram, you will now see a small icon for each SDL symbol. To see which SDL symbol an icon represents, double-click the small icon.
  5. Switch back to a transition coverage tree and go back to the Simulator UI.

Augmenting the Coverage

  1. Execute three more transitions to put the Game process in the state Losing again.
  2. Send the signal Result. Execute four more transitions to return to state Winning.
  3. Send the signal Endgame. Execute two more transitions to stop the Game process.
  4. Check the current system coverage in the Coverage Viewer by selecting Coverage from the Show menu.
  5. Change to a transition coverage tree and show All Nodes. As you can see, the Main process has now been completely executed. The Losing and Winning states are also more filled.
  6. To see what transitions have still not been executed, you can click the Least quick button. If, however, you click the Most quick button you will only see the most executed transition (and other symbols), i.e. the input of timer T, not all transitions that have been executed.
  7. To see more of the tree, select Increase Tree from the Tree menu. The input of Bump should now be added. Select the command again and all remaining executed transitions should be added.

Looking at Coverage Details

  1. Select the system diagram in the Coverage Viewer. From the Tools menu, select Show Details, or click the quick button for this. The Coverage Details window is opened.
    The displayed coverage chart shows how many transitions that have been executed a certain number of times. The chart should contain four bars:

Figure 121 : The Coverage Details window

  1. Select the bars one at a time and look at the text in the Status Bar at the bottom of the window. You will now see how many transitions that have been executed 0, 1, 2 and 3 times. To see which transitions that have not been executed at all, do as follows:
  2. Select the "zero bar" furthest to the left. Click the Show Editor quick button. The SDL Editor is opened, showing the three transitions in the Game process that remain to be executed.
    • If the transitions can be found in more than one diagram, a confirmation dialog is issued between each diagram that is opened. Simply click OK to see the transitions in the next diagram.
  3. Select another symbol in the coverage tree in the main window. The Coverage Details window is now updated to show the coverage chart for that symbol.
  4. "Play around" in the Coverage Viewer as much as you like. You should note, however, that the Demongame system is a bit too simple to give full justice to the power of the Coverage Viewer.

Exiting the Simulator UI

You will now close down the Simulator UI.

  1. First, exit the Coverage Viewer from the File menu.
  2. Then, exit the Simulator UI from the File menu. You will be asked whether to save the changes to the sets of variables in the Watch window, commands in the Command window, and buttons in the button area. If you choose to save them (with the suggested file names), they will become the default the next time you start the Simulator UI from the same directory.

http://www.ibm.com/rational
Contents Index Previous Next