Panorama OO-Diagrammer

Basic Concepts

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.

Operations

This section covers:

Activating Panorama OO-Diagrammer

dia.gif - 0.60 KTo invoke OO-Diagrammer from the Panorama C/C++ MAIN menu:

  1. Make sure that you have created or loaded a database for your project. (See "Creating and Loading a Database")
  2. Click on the OO-Diagrammer button on the tool bar of the MAIN menu. Alternatively, you may click the TOOLS menu, then click the OO-Diagrammer button.

    The OO-Diagrammer menu bar will pop up.

    Dg_bar.gif - 3.29 K

    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.

Generating logic diagrams

To generate a J-Diagram, ActionPlus, or J-Flow of your code:

  1. On the OO-Diagrammer menu bar, click J-DIAGRAM or J-FLOW or ACTIONPLUS.

    The corresponding diagram generation dialog box will pop up.

    Dg_opt1.gif - 6.94 K

  2. Make selections on the dialog box:

    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.

  3. Click OK.

    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).

Reading the diagrams

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

Dg_func.gif - 13.88 K

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

Dg7.gif - 12.30 K

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

Dg18.gif - 11.44 K

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

Dg8.gif - 12.17 K

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

Dg1.gif - 12.48 K

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.

dgcon.GIF - 2.14 K

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.

Moving around in the diagrams

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:

  1. Point to the active cross reference block number in the right margin of the diagram.

    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.

    Dg19.gif - 12.25 K

  2. Click the left mouse button

    Dg20.gif - 10.34 K

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.

Dg21.gif - 10.24 K

Using tags to save a view:

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:

  1. Choose SET from the TAG pull-down menu.

    A dialog box will pop up.

    Dg24.gif - 2.21 K
  2. Type in a tag in the text field.

    You can even type in some comments for later reviewing.

  3. Click OK.

This operation can be repeated to save a number of view positions.

To jump to a saved view:

  1. Select JUMP from the TAG pull-down menu.
  2. Choose the tag to jump to.

To remove a saved position:

  1. Select CLEAR from the TAG pull-down menu.
  2. Choose the tag to be removed.

    You can click CLEAR ALL to remove all the tags set.

Generating logical paths

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:

  1. Move the mouse pointer to a point on a path in the diagram.

  2. While pressing the CONTROL key, double-click the left mouse button.

    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.

  1. Generate a current path without test coverage 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.

  2. Select the type of paths

    Choose PATH TYPE from the PATH pull-down menu, then choose one of the following three types of paths from the submenu:

  3. Choose BACK PATH SELECTION from the PATH pull-down menu.

    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.

    Dg2.gif - 5.32 K

    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 ‘*’.

  4. Click one of the buttons to highlight the corresponding path in the J-Flow Diagram.

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.

  1. You must generate a current path without test coverage.

    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.

  2. Select the type of paths

    Choose PATH TYPE from the PATH pull-down menu, then choose one of the following three types of paths from the submenu:

  3. Choose FORE PATH SELECTION from the PATH pull-down menu.

    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.

    dg15.GIF - 5.48 K

    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 ‘*’.

  4. Click one of the buttons to generate the corresponding path in the J-Flow Diagram.

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.

Displaying paths information

  1. Generate a current path from within the J-FLOW Diagram.

  2. Select the type of path(s) information.

    Choose PATH INFORMATION from the PATH pull-down menu, then choose one of the following three item from the submenu:

    1. PATH CONDITION ONLY

      Dg25.gif - 8.96 K

      This will display the conditions a test case should satisfy to test the path. T stands for True, and F stands for False.

    2. LOGICAL PATH(S) ONLY

      Dg22.gif - 12.32 K

      This will display the logical paths without the conditions.

    3. LOGICAL PATH(S) WITH CONDITION

      Dg23.gif - 11.33 K

      This will display both the logical paths and the conditions.

  3. Select the type of paths.

    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.

    Dg26.gif - 11.01 K

  4. To close the PATH INFORMATION window, Choose EXIT from the FILE pull-down menu within the window.

Locating code in the diagrams

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:

  1. Choose FIND from the FILE pull-down menu on the menu bar, then select FILE from the FIND submenu.

    The FIND FILE dialog box will pop up.

    Dg12.gif - 3.81 K

  2. Select a file name from the list or enter a file name directly in the FILE NAME text field.

  3. Choose the search direction.

    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.

  4. Click OK

    The diagram will jump to the beginning of the specified file. If the file is not found, try the other direction.

  5. To exit from the FIND dialog box, press CANCEL

To find a function/class:

  1. Choose FIND from the FILE pull-down menu on the menu bar, then select FUNCTION/CLASS from the submenu.

    The FIND FUNCTION & CLASS dialog box will pop up.

    dg16.GIF - 5.45 K

  2. Select a function/class name from the list in the dialog box, or enter the function/class name directly in the FUNCTION/CLASS NAME text field.

  3. Choose the search direction.

  4. Click NEXT to search from the current position, or click OK both to search from the current position and to close the dialog box.

    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.

  5. To exit from the FIND dialog box, click CANCEL.

To find a string:

  1. Choose FIND from the FILE pull-down menu on the menu bar, then choose STRING from the FIND submenu.

    The FIND STRING dialog box will pop up.

    dg13.GIF - 5.42 K

  2. Select a string from the list in the dialog box, or enter any string you want to find.

    The list contains function names, class names, and the graphic characters used to indicating the untested segments.

  3. Choose the search direction.

  4. Click NEXT to search from the current position, or click OK to search from the current position and to close the dialog box afterwards.

    If the string is not found in one direction, try the other direction.

  5. To exit the FIND dialog box, click CANCEL.

Changing colors

You can also change the colors of the diagram.

  1. Choose COLOR from the OPTION pull-down menu.

    The COLOR Property dialog box will pop up.

    Dg_color.gif - 9.74 K

  2. Press one of the radio buttons on the left to select an item. By mixing the red, green and blue values on the right, you may specify colors for each item chosen. While changing the color bars, the color of the item in the diagrams is being changed.
  3. Buttons in action area:

    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.

Changing diagram width

To change the width of the diagram:

  1. Choose WIDTH from the OPTION pull-down menu.

    The CHANGE DIAGRAM WIDTH dialog box will pop up.

    dg6.GIF - 2.06 K

  2. Move the slider of the scale in the dialog box to change the width of the diagram.

  3. Click OK.

    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.

Printing a diagram

Diagrams can be printed on a PostScript or an ASCII printer. Diagrams can also be printed to files in PostScript or ASCII format:

  1. Highlight a part of the diagram to be printed.

    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.

  2. Choose PRINT on the FILE menu.

    The PRINT dialog box will pop up.

    Dg_print.gif - 9.44 K

  3. Select TO PRINTER or TO FILE.

    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:

    Dg_brows.gif - 8.51 K

    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.

  4. Select ASCII or POSTSCRIPT.

    This selection determines the format of the printout or the format in the specified file.

  5. Select ALL or HIGHLIGHTED or BLOCK.

    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.

  6. If POSTSCRIPT is selected, the following selections should be made:

    1. Select SINGLE PAGE or DOUBLE PAGE format.

    2. Select paper format: USLETTER, A4 or PAPER.

      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.

    3. Select margins: TOP, BOTTOM, LEFT and RIGHT.

  7. Press OK.

    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.

Exiting a diagram

To exit from a diagram:

  1. Click on FILE to open the FILE pull-down menu.
  2. Choose QUIT from the menu.

Exiting Panorama OO-Diagrammer

To exit from OO-Diagrammer:

Click QUIT on the OO-Diagrammer menu bar.


back to Table of Contents