![]() |
![]() |
![]() |
![]() |
![]() |
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
- To create a coverage file
- To start the Coverage Viewer
- To interpret and change the coverage tree information
- To open a more detailed coverage chart
- To exit the Simulator UI
Starting the Coverage Viewer
- Restart the simulator.
- Send the signal Newgame. Execute seven (7) transitions until the printed trace shows that the Game process is in the state Winning.
- Send the signal Probe and execute the next transition.
- Select Coverage from the Show menu. The main window of the Coverage Viewer is opened.
Using the Coverage Viewer
If a symbol coverage tree is displayed, switch to a transition coverage tree by clicking on the Tree Mode quick button.
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.
- Since the coverage tree is quite large, you may maximize the window (by using the window manager) while working with the Coverage Viewer. When returning to the Simulator UI, you can simply restore the size of the window to its original size.
Alternatively, you may also zoom out the window contents with a number of clicks on the quick button.
- The coverage tree shows the diagram structure of the Demongame system. Beneath each process diagram (Main, Game, Demon), you see all possible transitions in that process, defined by a state and the possible signal inputs from that state. The start transitions are represented by an SDL start symbol.
- The number below each symbol in the tree is the number of times the symbol has been executed so far. In addition, each symbol is filled with a gray pattern to indicate to what extent it has been executed. Parts of the system that never have been executed have a zero value and "empty" symbols. Parts that have been completely traversed by the execution so far have a non-zero value and completely filled symbols.
- From the displayed tree, you can find out the following information:
- In the states Losing and Winning, one out of four transitions have been executed. Thus, these state symbols are filled to 1/4.
- In the Main process, two out of three transitions have been executed. Thus, the process symbol is filled to 2/3.
- In the Demon process and the block DemonBlock, all transitions have been executed at least once. Thus, these symbols are completely filled.
- In the system as a whole, a little more than half of all possible transitions have been executed.
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.
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.
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!
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.
- Switch back to a transition coverage tree and go back to the Simulator UI.
Augmenting the Coverage
- Execute three more transitions to put the Game process in the state Losing again.
- Send the signal Result. Execute four more transitions to return to state Winning.
- Send the signal Endgame. Execute two more transitions to stop the Game process.
- Check the current system coverage in the Coverage Viewer by selecting Coverage from the Show menu.
- 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.
- 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.
- 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
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.
- 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:
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.
- 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.
- "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.
- First, exit the Coverage Viewer from the File menu.
- 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 |
![]() |
![]() |
![]() |
![]() |