Panorama OO-Diagrammer generates three kinds of logic diagrams directly from your source code:
OO-Diagrammer’s active logic diagrams have greatly simplified the code tracing. All three diagrams feature click-and-jump cross-references which enables the display to jump between the related part of the source code, including:
The enhanced active diagrams of OO-Diagrammer help the user inspect the code and follow the logic flow of complex programs easily. As statistics have shown, about 50% of the bugs can be found during code inspection and walk through. Therefore OO-Diagrammer’s powerful code tracing function can not only accelerate the understanding of the code, but also help find the logical errors in the program.
In each diagram, the detailed logic can be prefaced with a schematic of functional dependencies or class inheritance relationship. This "high-level logic" is linked to the detailed logic by the same click-and-jump cross-reference.
For an explanation of the notations used in the diagrams, see Appendix B and Appendix C
OO-Diagrammer can work alone or with other tools of the Panorama C/C++ Family.
When OO-Test is available, OO-Diagrammer can display segment-level test coverage results and condition-predicate test coverage results directly on the J-Diagrams and J-Flow diagrams. If you choose these options, segment execution frequencies will be added, untested segments will be clearly highlighted, and tested and untested conditions will be marked.
This section covers:
Activating Panorama OO-Diagrammer
To invoke OO-Diagrammer from the Panorama C/C++ MAIN menu:
The OO-Diagrammer menu bar will pop up.
In the menu bar, the FOLLOW SUBSET check button is set by default. You can unselect it by clicking on the button.
If you select FOLLOW SUBSET, OO-Diagrammer will show logic diagrams of only the files you have selected in the Panorama C/C++ MAIN Menu. (See "SUBSET pull-down menu".) If you unselect FOLLOW SUBSET, OO-Diagrammer will show the logic diagrams of all the files in the project.
To generate a J-Diagram, ActionPlus, or J-Flow of your code:
The corresponding diagram generation dialog box will pop up.
All the three diagrams can be displayed with function high level logic and/or class high level logic if WITH FUNCTION HIGH LEVEL and/or WITH CLASS HIGH LEVEL being checked. You may also select if a summary report is required before the whole program, before each file, and/or before each function and class.
Select the width of the diagram (80 -132). The default value is 80.
If Panorama OO-Test is available, You may display test coverage data on the diagrams by pressing the radio button WITH LAST RUN TEST COVERAGE or WITH ACCUMULATED TEST COVERAGE. When the button CONDITION COVERAGE is also checked, the diagrams will be displayed with the condition-predicate test coverage data too.
A window will come up. It contains the diagram you have specified.
You can also generate diagrams of individual function or class from module boxes in the structure charts (See Panorama OO-Browser).
The three types of logic diagrams and high-level logic portion of diagrams are illustrated below. For the details of the notations used in these diagrams, see Appendix B and Appendix C.
The number in the first column on the left is the block number. The number in the second column is the line number of statements in the source file.
Line references for called or referenced code are displayed in the right margin of the diagram. At the called line, the calling block number is shown to the right. This also applies to the relationship between class definition and references, etc. The number followed by an ‘s’ indicates that there are multiple references. Press the right mouse button and select one block number from the pop up menu to jump to that line.
Each time you jump forward, your previous location in the file is saved. So you can jump back by pressing RETURN or click the middle mouse button. If you press RETURN or click the middle mouse button with the SHIFT key pressed, the diagram will return to the position before the first jump.
Function high level logic diagram
This high level diagram can be included in J-Diagram, J-Flow, and ActionPlus diagrams by checking WITH FUNCTION HIGH LEVEL option on the diagram dialog boxes.
Class high level logic diagram
This high level diagram can be included in J-Diagram, J-Flow and ActionPlus diagrams by checking WITH CLASS HIGH LEVEL option on the diagram dialog boxes.
J-Diagram
J-Diagrams graphically organize and identify the logical elements of your code. OO-Diagrammer can include segment (branch) level test coverage on the J-Diagram when Panorama OO-Test is available. The number to the top right of each logical segment in the diagram indicates the number of times that segment was executed during test runs.
J-Flow Diagram
J-Flow Diagrams show path complexity by stripping the logic down to the basics. This schema of the decisions, loops, and switches shows complexity precisely to indicate how complex the source code is. In J-Flow Diagrams you may select and highlight logical paths and obtain test conditions on the logical paths. This will be great help for you to design a good test case.
ActionPlus Diagram
ActionPlus diagram presents your code in an enhanced version of the action diagram, so you can understand the code more easily and thoroughly.
Diagram options
Information summary
OO-Diagrammer provides the following information summaries:
You may include these summary information into the diagrams by checking the option buttons on the diagram dialog box. When the diagrams are generated, these summaries may also be included into or excluded from the diagrams by clicking SUMMARY on the OPTION menu. Then you may select to include the summary information needed into the diagrams.
Displaying test coverage data
When Panorama OO-Test is available, all three diagrams can display Standard Segment Test Coverage result (SC1+) and Condition-Predicate test coverage result. You can make selections on the diagram OPTION dialog box, or you can make your selections on the OPTION menu.
Once the diagrams are generated, you may display the diagrams with or without test coverage data. Select TEST COVERAGE from the OPTION pull-down menu, then select WITHOUT, or LAST, or ACCUMULATED from the submenu.
When displaying test coverage data on the diagrams, you can also decide if the condition-predicate test coverage data are to be displayed. Click WITH CONDITION on the OPTION menu, the condition-predicate test coverage data will be displayed together with segment test coverage data. Click WITHOUT CONDITION on the OPTION menu, the condition-predicate test coverage data will not be displayed even if the segment test coverage data are displayed.
If the diagrams are displayed with test coverage data, the unexecuted segments and blocks are highlighted, and the executed times of segments and blocks are indicated on the diagrams.
To view the scope of each condition test coverage result, press the CONTROL key, click the left mouse button at the condition test coverage data, the relative condition part will be highlighted.
Update the test coverage data
When OO-Diagrammer is activated, the test coverage data available then will be adopted and shown on the diagrams. If the program analyzed by OO-Diagrammer is being executed during the execution of OO-Diagrammer, new test coverage data will be generated. Click REFRESH on the TEST COVERAGE submenu of the OPTION menu, the test coverage data adopted by OO-Diagrammer will be automatically updated to include the newly generated data.
Switch to other diagrams
You may open up to twelve windows to show J-Diagram and/or J-Flow and/or ActionPlus diagrams. However, OO-Diagrammer allows you to switch from one diagram to another with the same display options and at the same block position.
To change to another diagram, click SWITCH TO on the OPTION menu, then select the diagram you wish to switch to.
In addition to using scrollbars, Home, End, PgUp or PgDn, and arrow keys to move around, you can jump directly to classes or functions of cross-references.
OO-Diagrammer provides the following active cross references:
To jump to a cross reference:
The block numbers are given in the high-level class/function logic, and detailed J-Diagrams, and ActionPlus Diagrams. You may jump back and forth between the high-level logic and the detailed logic.
When there are more than one cross references for one line of the diagram, the block number in the right margin will end with ‘s’. Press the right mouse button on the number. A menu will pop up that contains a block number for each cross reference. Select the cross reference you want by clicking the right mouse button.
To return from a cross reference:
Press RETURN or the middle mouse button.
The related block numbers are saved. You may jump through the code as many times as you like. You can then repeatedly press RETURN or the middle mouse button to step back up. If you press RETURN or click the middle mouse button while pressing the SHIFT key, the diagram display will return to the position before the first jump.
You may wish to save your place in the diagram to come back later. You can do so by placing tags in the diagram. Click TAG on the menu bar to pull down the menu.
To save the position of current view:
A dialog box will pop up.
You can even type in some comments for later reviewing.
This operation can be repeated to save a number of view positions.
To jump to a saved view:
To remove a saved position:
You can click CLEAR ALL to remove all the tags set.
Using logical paths can help you develop efficient test cases. You can quickly and easily find out from the logical paths how to begin testing, how to perform the most thorough and efficient testing, and how to test new additions to the existing code.
To generate logical paths from within the J-Flow Diagrams:
A logical path that contains the point selected will be highlighted. The point selected will be identified by an arrow. To remove the highlighting, click the middle mouse button on blank area while pressing the CONTROL key.
To generate backward paths:
Backward paths are possible variations of the part of a path before the point selected.
If LAST or ACCUMULATED is chosen, only those backward paths that have untested segments will be generated.
To disable test coverage, you may select WITHOUT TEST COVERAGE in the diagram dialog box. Alternatively, you may choose TEST COVERAGE from the OPTION pull-down menu, then choose WITHOUT (the default) from the TEST COVERAGE submenu (when Panorama OO-Test is available).
Then, generate a path by pointing the cursor to a path, pressing the CONTROL key and clicking the middle mouse button.
Choose PATH TYPE from the PATH pull-down menu, then choose one of the following three types of paths from the submenu:
The possible paths are listed in the order they have been generated. It is useful that the first time you generate logical paths.
This generates the most thorough and efficient logical paths. When this option is selected, the path covering most segments will appear first.
The paths with most unexecuted segments will appear first. This is useful when you have been testing for a while or if you have generated new untested code. When this option is selected, the logical path containing most untested code will be generated first.
The BACKWARD PATH SELECTION window will pop up. The number of buttons in this window equals to the number of backward paths that can be generated at the current path position point by an arrow.
The label on each button indicates the path sequence, the number of untested segments, and the number of total segments on the path. The current path selected is indicated with ‘*’.
Note: The maximum number of the logical paths OO-Diagrammer can generate is 180.
To generate all forward paths:
Forward paths are variations of the part of a path after the point selected.
If LAST or ACCUMULATED is chosen, only those forward paths that have untested segments will be generated.
To disable test coverage, you may select WITHOUT TEST COVERAGE in the diagram dialog box. Alternatively, you may choose TEST COVERAGE from the OPTION pull-down menu, then choose WITHOUT (the default) from the TEST COVERAGE submenu (when Panorama OO-Test is available).
Then, generate a path by pointing the cursor to a path, pressing the CONTROL key and clicking the middle mouse button.
Choose PATH TYPE from the PATH pull-down menu, then choose one of the following three types of paths from the submenu:
The FORWARD PATH SELECTION window will pop up. The number of buttons in this window equals to the number of forward paths that can be generated at the current path position point by an arrow.
The label on each button indicates the path sequence, the number of untested segments, and the number of total segments on the path. The current path selected is indicated with ‘*’.
Note: The maximum number of the logical paths OO-Diagrammer can generate is 180.
To dim the statements and segments not on the path:
Choose DIM PATH from the PATH pull-down menu. This helps you to review clearly the current path.
Choose PATH INFORMATION from the PATH pull-down menu, then choose one of the following three item from the submenu:
This will display the conditions a test case should satisfy to test the path. T stands for True, and F stands for False.
This will display the logical paths without the conditions.
This will display both the logical paths and the conditions.
From the PATH pull-down menu, you can select BACK PATH(S) INFO, or CURRENT PATH INFO, or FORE PATH(S) INFO for information about three kinds of paths. The PATH INFORMATION window will then pop up.
In addition to using click-and-jump cross-references, you can also jump to the beginning of a file specified, search for the definition of a function or a class, or search for a string in a diagram.
To find a file:
The FIND FILE dialog box will pop up.
Press SEARCH UP to search toward the beginning of the diagram from the current position; press SEARCH DOWN to search toward the end of the diagram from the current position.
The diagram will jump to the beginning of the specified file. If the file is not found, try the other direction.
To find a function/class:
The FIND FUNCTION & CLASS dialog box will pop up.
The diagram will jump to the definition of the specified function or class. If the function/class name is not found in one direction, try the other direction.
To find a string:
The FIND STRING dialog box will pop up.
The list contains function names, class names, and the graphic characters used to indicating the untested segments.
If the string is not found in one direction, try the other direction.
You can also change the colors of the diagram.
The COLOR Property dialog box will pop up.
Click OK to accept new setting and close the dialog box.
Click DEFAULT to restore the default colors.
Click CANCEL to close the dialog box and discard the modifications of the colors.
Click SAVE to open a dialog box in which you may enter the directory and name of a file for storing the current color settings. The file name must have .col extension.
Click LOAD to open a file selection dialog box for loading a set of colors from a .col file.
Click HELP to activate on-line help function.
To change the width of the diagram:
The CHANGE DIAGRAM WIDTH dialog box will pop up.
The width of the diagram will be changed and the dialog box will be closed.
You may also click TRY to see the effect of the changes before closing the dialog box.
NOTE: This function does not automatically change the width of the window displaying the diagram being changed.
Diagrams can be printed on a PostScript or an ASCII printer. Diagrams can also be printed to files in PostScript or ASCII format:
To highlight, position the pointer at the beginning of the part of the diagram to be printed and click the left mouse button. Then position the pointer at the end of the part of the diagram to be printed and click the right mouse button. The diagram between the two clicked positions will be highlighted.
You can also specify the part of the diagram you wish to print using block numbers (see Step 5).
To print the whole diagram, no part of it needs to be highlighted.
The PRINT dialog box will pop up.
If TO PRINTER is selected, you may type the printer ID into this field. If the TO PRINTER field is left blank when it is selected, system default printer will be used.
If TO FILE is selected, a file name with full path is expected.
You may click BROWSE to select a file and load the filename into the TO FILE field. By clicking BROWSE, a BROWSE dialog box pops up:
In this dialog box, you may select a proper directory in the DIRECTORIES field, then click the filename, the filename will appear in the SELECTION field. Click OK, this filename will be loaded into the TO FILE field of the PRINT dialog box.
This selection determines the format of the printout or the format in the specified file.
When ALL is selected, the contents of the whole window will be printed out or be saved into the specified file.
When HIGHLIGHTED is selected, only the highlighted part will be printed out or saved into the specified file. If no part of the diagram has been highlighted, the entire diagram will be printed.
When BLOCK is selected, the range of blocks should be specified to the right of the selection:
FROM: The number of the first block to be printed.
TO: The number of the last block to be printed.
If PAPER is selected, the paper size in inches is to be specified in the WIDTH and HEIGHT fields to the right of the paper format fields.
The specified contents will be printed or be saved in the file.
If the specified file name exists, a warning dialog box will pop up. Then you may choose either CANCEL to simply close the dialog box or OVERWRITE to save the new diagram.
To exit from a diagram:
Exiting Panorama OO-Diagrammer
To exit from OO-Diagrammer:
Click QUIT on the OO-Diagrammer menu bar.