Panorama OO-Browser

Basic Concepts

Panorama OO-Browser generates three kinds of structure charts from your source code: Function Call Graph, Class Inheritance Chart, and Class-Function Coupling Graph. These structure charts give a quick, graphic overview of program hierarchies. They can also be used to search for program components and to display the relationship between the components.

Each function or class is represented by a box. Color-coded lines show the relationship between the boxes. The description of graphic units for function boxes and class boxes are listed in Appendix A.

Function Call Graphs

Function call graphs show the calling relationship between functions and called functions. In this graph, each box represents a non-member function, a member function, a macro function, a set of overloaded functions, or a virtual function in your source code.

Non-member function boxes are outlined with solid lines.
A member function box contains the class name and the function name.
Virtual functions and macro functions are represented by boxes with dotted lines.
Overloaded functions are represented by overlapping boxes.

The lines between these boxes indicate which functions call which.

Solid lines indicate calls from a higher level (on the graph) function to a lower one. The lines that go to the next layer down can be color-coded differently than lines that span more than one layer down.
Dashed lines indicate calls from a lower to a higher function.
Loops on top of function boxes indicates recursive function calls.

Class Inheritance Charts

Like a class browser, Panorama's class inheritance charts show the class inheritance hierarchy. In this chart, each box represents a class. The lines between boxes indicate the inheritance relationship between classes.

But different from the class browsers currently available on the market, OO-Browser's class inheritance charts are active: you can highlight or isolate subtrees, or overlay information about all the classes in the system.

Class-Function Coupling Graph

Panorama OO-Browser's class-function coupling charts simplify the function call graphs. They give an overview of your program by grouping together all the member functions of each class. A box in this graph indicates either a non-member function (including macro functions and overloaded functions) or a class. Lines connected to a class box indicate function calls from or to member functions of that class.

Use Panorama OO-Browser’s automatically generated hierarchical structure charts for a graphic overview of the structure of your entire program. You can highlight a subtree to show the function call chain for a specified function or the inheritance relationship chain for a specified class. Hiding and isolating a subtree allows you to work on a smaller set of functions and still remain the overview of the program.

On the structure charts you can overlay bar graphs and numeric data to show test coverage, complexity, module size, and run-time performance data or pop up logic flow, test coverage, or complexity diagrams of an individual function. It allows you to get a quick overview, then examine the detailed logic of any function. You can also edit source code from the structure chart, then see the effects of modifications on the program.

OO-Browser can work alone or with other tools of the Panorama Family.

When OO-Test is available, the various test coverage data can be shown on the charts. Without OO-Test, the static analysis result can still be shown on the charts.

Operations

This section covers:

Activating Panorama OO-Browser
Generating structure charts
Structure chart menus
Highlighting and isolating subtrees
Hiding and expanding subtrees
Dimming and exposing individual functions or classes
Locating functions and classes
Working with large structure charts
Data overlays
Displaying information about the structure chart
Displaying information about individual functions or classes
Generating various diagrams for the selected module
Specifying new roots
Changing the way the structure chart looks
Editing source code
Printing a structure chart
Exiting the structure chart
Exiting Panorama OO-Browser

Activating Panorama OO-Browser

browser.gif - 0.43 KTo invoke OO-Browser 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-Browser button on the tool bar of the MAIN menu.

    Alternatively, you may click the TOOLS menu, then click OO-Browser option.

    The OO-Browser Option dialog box will pop up.

    Ct_bar.gif - 4.04 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-Browser will show structure charts 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-Browser will show the structure charts of all the files in the project.

Generating structure charts

To generate a function call graph, a class inheritance chart, or a class-function coupling graph of your code:

  1. On the Panorama OO-Browser menu bar, click FUNCTION CALL GRAPH or CLASS INHERITANCE CHART or CLASS-FUNCTION COUPLING GRAPH.

    The CHART OPTIONS dialog box will pop up.

    Browser1.gif - 3.81 K

  2. Select the chart options shown.

    You can display complexity on the structure chart by clicking on COMPLEXITY. You can then select from WITH CASE, WITHOUT CASE, JC0, JC1, or JC2.

    or

    You can display test coverage data by selecting TEST COVERAGE. You can then select from SC0, SC1, SC1+, J-COV, CONDITION TRUE, CONDITION FALSE, CONDITION BOTH, or BRANCH, and LAST or ACCU data.

    or

    You can display performance data by clicking the PERFORMANCE button, then typing the RUN FILE and PROFILE names. The default name for RUN FILE is a.out and the default for PROFILE is mon.out.

  3. Click OK.

    The chart specified will be generated:

    Fcg.gif - 27.45 K

    Function Call Graph

    Cit.gif - 11.00 K

    Class Inheritance Chart

    Cfc.gif - 22.20 K

    Class-Function Coupling Graph

Structure chart menus

Three types of menus are available in the structure charts: CHART pull-down menu, CHART pop-up menu, and BOX pop-up menu. The CHART pull-down menu and CHART pop-up menu provide access to actions that affect the whole chart. The BOX pop-up menu provides access to actions that relate to a specific box. The box pop-up menu may be either a FUNCTION menu if you click on a function box, or a CLASS menu if you click on a class box.

To open the CHART pull-down menu:

  1. Point the cursor to a menu item on the menu bar.
  2. Press the left mouse button.

Then drag the left mouse button and release it to select a menu element.

To open the CHART pop up menu:

  1. Point anywhere in the structure chart window outside the function box and class box.
  2. Press the right mouse button. The CHART MENU appears:

    Ch_menu.gif - 3.18 K

    Then drag the right mouse button and release it to select a menu element.

To open the box menu (FUNCTION menu or CLASS menu):

  1. Point to a function box or class box.
  2. Press the right mouse button. One of the following menu appears:

    Cl_menu.gif - 3.34 K Fu_menu.gif - 3.73 K

    Drag the right mouse button and release it to select a menu element.

Highlighting and isolating subtrees

To highlight a subtree:

  1. Click on the function box or the class box you want to highlight.

    The subtree associated with the box (all functions that call or are called by this function, or all the base classes and derived classes of this class) will be highlighted.

  2. To highlight another subtree, click on another box.

To remove the highlighting, point anywhere in the structure chart except at a box, then click the left mouse button. Or, choose NORMAL CHART form the VIEW pull-down menu.

To highlight a subtree with options:

  1. Point to a function box or a class box you want to highlight.

  2. Open the box menu by pressing the right mouse button.

  3. Drag the cursor onto HIGHLIGHT SUBTREE.

    The HIGHLIGHT SUBTREE submenu will come up. It lets you choose what is highlighted (your choice will remain in effect until you change it or exit Panorama):

    C4.gif - 1.47 K
    CALLERS

    Functions calling the selected function directly or indirectly (i.e. those that call the calling functions) are all highlighted (Function Call Graph).

    Base classes of the selected class (Class Inheritance Chart).

    Ancestors of the selected box (Class-Function Coupling Graph).

    CALLEES

    Functions called by the selected function, directly or indirectly (i.e. those functions called by the called functions) are all highlighted (Function Call Graph).

    Derived classes of the selected class (Class Inheritance Chart).

    Descendants of the selected box (Class-Function Coupling Graph).

    ALL

    The default. All dependencies are highlighted.

    Functions called by or calling the selected function, either directly or indirectly are all highlighted (Function Call Graph).

    All base classes and derived classes of the selected class (Class Inheritance Chart).

    All ancestors and descendants of the selected box (Class-Function Coupling Graph).

    DIRECT

    Only functions which directly call or are directly called by the selected function are highlighted (Function Call Graph).

    The direct base classes and derived classes of the selected class (Class Inheritance Chart).

    Parents and children of the selected box (Class-Function Coupling Graph).

To isolate a subtree with options:

  1. Point to a box from which the subtree originates.

  2. Open the box menu by pressing the right mouse button.

  3. Choose ISOLATE SUBTREE.

    The ISOLATE SUBTREE submenu will pop up.

    Ct_iso.gif - 1.46 K
  4. Choose the option you want.

To return to the full structure chart, step back through the levels of nested subtrees:

  1. Open the VIEW pull-down menu by clicking the left mouse button.

  2. Choose BACKWARD.

    The subtree one level back will appear in the structure chart window.

Repeat steps 1 through 2 until level 1, the full chart, is displayed.

To step forward to next level of nested subtrees:

Choose FORWARD from the VIEW pull-down menu.

Using BACKWARD and FORWARD, you can select any level in the nested subtrees to be displayed as the current structure chart.

To remove a particular level from the nested subtrees:

Choose DESTROY CHART from the OPTION pull-down menu.

The current subtree will not be registered or will be removed from the nested subtrees listing. This menu element will then become inactive, while RESERVE CHART becomes active, you can select RESERVE CHART to register the current subtree in the nested subtree listing. RESERVE CHART is reset whenever you change the chart level.

Hiding and expanding subtrees

To hide a subtree:

  1. Point to the module you wish to hide and click the right mouse button
  2. Choose HIDE from the pop up menu (FUNCTION MENU or CLASS MENU).

    The subtree with the selected module as its root will be dimmed.

To expand a subtree:

To display a chart without dimmed lines and hidden subtrees:

Choose NORMAL CHART from the VIEW pull-down menu.

The chart will appear as when it is generated for the first time.

Dimming and exposing individual functions or classes

To dim a module:

  1. Point to the module you wish to dim and click the right mouse button.

  2. Choose DIM from the pop-up menu.

    The module and all its connection lines will be dimmed.

To expose a module:

  1. Choose DIMMED BOX ACTIVATABLE from the OPTION pull-down menu.

    The default setting is NON-ACTIVATABLE. In this case, a dimmed module can not be exposed.

  2. Point to the module you wish to expose and click the right mouse button.

  3. Choose EXPOSE from the pop-up menu.

Locating functions and classes

To locate a function or a class inside the structure chart:

  1. Press right mouse button to bring up the CHART menu.

  2. Choose FIND from the menu.The FIND dialog box will pop up.

    Ct_find1.gif - 8.07 K

  3. Enter search parameters.

    You may search for functions or classes by name, source file ownership (group, owner), source file name, the date (files modified on or since the date entered are considered a match) .

    By variable(G):Input the global variable that you’re interested in.All the classes/functions which modify or reference the global variable will be highlight.

    Note:The class/function which modify the global variable displayed with pink and reference displayed with green.

    By variable(S):Input the static variable that you’re interested in.All the classes/functions which modify or reference the static variable will be highlight.

    Note:The class/function which modify the static variable displayed with pink and reference displayed with green.

    Use the MM/DD/YY format for the date.

    Select the checkbox to the left of each parameter you want to use, Then specify the parameter in the text input area to the right by clicking on a name from the list.

    Press CLEAR to clear all parameters.

  4. Press OK.

All functions or classes that match your search specification will be highlighted. If a subtree has been highlighted, the FIND highlighting will replace the subtree highlighting. To remove the highlighting, click the left mouse button anywhere the structure chart except on a box. Highlighting a subtree will remove the FIND highlighting.

Working with large structure charts

Large structure charts may not fit entirely within the Panorama window. Instead of scrolling around to see all of the chart, you may prefer to zoom out on the chart and select an area to view.

The REDUCED VIEW window shows a simplified miniature of the full structure chart. Boxes which match your search specification are also highlighted in the REDUCED VIEW. You may scroll the REDUCED VIEW, highlight subtrees and open structure chart menus from within the Reduced View window.

To see a reduced view:

Choose REDUCE from the VIEW pull-down menu.

The REDUCED VIEW window shows a structure chart with smaller boxes. Subtree highlighting is duplicated in the REDUCED VIEW.

Reduce.gif - 13.11 K

To display a full-size structure chart:

  1. Press the middle mouse button and move the white frame on the reduced chart. to select the area your prefer to view.

  2. Choose NO REDUCE from the VIEW pull-down menu.

    The full-size chart will appear. It contains the boxes inclosed by the frame in the reduced chart.

    No_red.gif - 11.14 K

Data overlays

Five types of data can be overlaid on the structure chart that may be applied to a structure chart: coding order, performance data, complexity distributions, test coverage results, and friend information. You can use this feature to get a quick overview, then use other Panorama capabilities to precisely locate problems. Bar graphs are overlaid on the boxes to indicate the data value as a percentage of the maximum value.

The overlays may be applied either when the structure chart is first generated or from the STRUCTURE CHART window. To choose data overlays when you generate the structure chart, click the radio buttons on the CHART OPTIOPNS dialog box that appears when you click FUNCTION CALL GRAPH or CLASS INHERITANCE CHART or CLASS-FUNCTION COUPLING GRAPH button on the OO-BROWSER menu bar.

The following sections will describe how to overlay data once your structure chart has been generated.

Displaying coding order

Panorama provides data that guide software implementation. Based on a bottom-up or top-down strategy, Panorama displays a coding order number above each function box or class box. You can highlight the critical path for your program to find the critical coding order. Using the highlighted subtree and the ordering numbers, software engineers can code and test more efficiently.

To display coding order:

Choose ORDERING from the CHART MENU, then choose BOTTOM UP or TOP DOWN.

The suggested coding order number will be displayed below each box on the structure chart. If a subtree is highlighted, the suggested coding sequence for that subtree will be displayed.

To remove the coding order:

Select CLEAR DATA from the CHART MENU.

Displaying function size and complexity map

Complexity metrics can also be overlaid on a structure chart. The function size, the number of lines of code, will be displayed above the function box. The complexity will be displayed below the function box.

To display complexity data:

  1. Choose COMPLEXITY from the CHART MENU.
  2. The COMPLEXITY submenu gives you a choice of displaying metrics calculated in different ways: WITH CASE, WITHOUT CASE, J-C0, J-C1 or JC2. Select the option you want.

    The complexity data and bar graphs will appear on the structure chart.

    chcomp.GIF - 2.26 K

Displaying performance data

Performance data for functions can be overlaid on a chart. The execution times will be displayed above the function box, and the duration of execution (in milli-seconds) will be displayed below the function box. For a class box, the performance data can be ignored.

  1. Choose PERFORMANCE on the CHART MENU.

    A Panorama C/C++ Performance dialog box will pop up.

    Ct_perfo.gif - 3.80 K

  2. Enter the program’s executable file name and the profile name.

    Panorama needs to know the program and profile names so it can find the performance data files. The default names are ./mon.out for the profile name, and ./a.out for the program name. If you run Panorama in a directory other than the one where the program and its profile are found, you must specify the absolute pathname for both files.

  3. Press OK.

    The performance data and bar graphs will appear on the structure chart.

    chper.GIF - 2.58 K

Displaying test coverage results

To display test coverage data:

  1. Choose TEST COVERAGE from the CHART menu.
  2. Choose test coverage options from TEST COVERAGE submenu.

    Select LAST RUN SC0, LAST RUN SC1, or LAST RUN SC1+ if you only want to look at the data from the last test run. Select ACCU RUN SC0, ACCU RUN SC1, or ACCU RUN SC1+ if you want to use the data from all test runs since the code was compiled. (See the GLOSSARY for the explanation of logical segments-level analysis SC0, SC1, and SC1+).

  3. Press OK.

    The test coverage data and bar graphs will show up on the structure chart.

    chcov.GIF - 2.73 K

Displaying friend data of classes

Choose FRIEND INFO from the CHART menu.

The number of classes which grant the module as a friend will be displayed above the box representing this module; the number of friends the class has will be displayed below the class box.

Removing data overlays

To remove data overlays from the structure chart:

Choose CLEAR DATA from the CHART menu.

The data overlays will disappear form the structure chart. Any highlighted subtree will remain highlighted.

Subtree data display

If performance, test coverage, or complexity data are already displayed on the full structure chart, it will remain visible when a subtree is highlighted; the data will be cleared if a subtree is isolated.

If performance, test coverage, or complexity data are selected while a subtree has been highlighted, only data per the highlighted functions will be displayed. If you highlight another subtree, the specified data will show up on the newly highlighted subtree.

Displaying information about the structure chart

From the CHART MENU, you can choose different buttons and access three windows of information about the structure chart:

ABOUT CHART gives general information about the structure chart, including the source code files involved, the functions and classes involved, and the root functions or classes. If an isolated subtree is displayed, all of this information is about the isolated subtree.

Ctinfor1.gif - 8.64 K

ABOUT HIGHLIGHT gives information about the highlighted part of the structure chart, such as a highlighted subtree or the result of a Find operation. The information included is similar to what is given in ABOUT CHART.

To close an information window, select CLOSE from its window menu.

Displaying information about individual functions or classes

To display information about individual functions or classes, point to a function box or a class box and press the right mouse button to bring up the FUNCTION or CLASS menu.

If the selected box is a virtual function (dashed outline), select HIGHLIGHT VIRTUAL from the FUNCTION menu to highlight virtual functions that can replace the selected function.
If the selected box is an overloading function (overlapping boxes), select HIGHLIGHT OVERLOADING from the FUNCTION menu to highlight overloading functions of the same name.

You may display information about each function in the window using the FUNCTION or CLASS MENU.

To display information about individual functions:

Choose ABOUT FUNCTION from the FUNCTION MENU.

The ABOUT FUNCTION window will come up. It contains information about the selected function, such as the function prototype, attribution, location of the definition, function callers and callees, related functions, compactness, local classes/labels, classes to which the selected function is a friend, global/static variables, complexity, and owner information.

Ctfunc1.gif - 6.77 K

To close this information window, select CLOSE from its window menu.

To display information about individual classes:

  1. For general information, choose ABOUT CLASS from the CLASS MENU.

    The ABOUT CLASS window will pop up. It contains information such about the selected class, such as class name, location of its definition, files in which it is used, base and derived classes, its friends, classes to which it is a friend, nested classes, its data and member functions, constructor and destructor, compactness, complexity, and ownership information.

    It also displays object-oriented metrics values, such as depth of inheritance information, coupling, response, number of methods and users, and code reused.

    Ctclass1.gif - 6.09 K

    To close this information window, select CLOSE from its window menu.

  2. For detailed information, choose DETAILED DEFINITION from the CLASS menu.

    The CLASS DETAILED DEFINITION window will pop up. The information displayed in the window includes the class name, public and private data members, and public and private member functions.

    Ctclass2.gif - 6.48 K

    To close this information window, select CLOSE from its window menu.

Generating various diagrams for the selected module

Panorama OO-Browser can generate logic diagrams for each function/class selected. To view logic diagrams for the entire project, use OO-Diagrammer.

The logic diagrams generated for each module may have last run test coverage data (SC1), accumulated run test coverage data (SC1), or without data depending on whether you have overlaid test coverage data on the entire chart.

To generate J-Diagram for the selected module

Choose J-DIAGRAM from the FUNCTION MENU or CLASS MENU.

Ct18.gif - 11.02 K

To generate ActionPlus Diagram of the selected module

Choose ACTION PLUS from the FUNCTION MENU or CLASS MENU.

Ct1.gif - 12.62 K

To generate J-Flow Diagram of the selected module

Choose J-FLOW from the FUNCTION MENU or CLASS MENU.

Ct8.gif - 10.89 K

For notations of these logic diagrams, please refer to the Appendix B and Appendix C.

Once a logic diagram for the module has been generated, you can select SWITCH TO from the OPTIONS menu of the diagram to convert to another kind of diagram. Select QUIT from the FILE menu of the diagram to close the diagram window.

For more information on how to use the diagrams, see the OO-Diagrammer section of the manual.

Specifying new roots

The structure chart of your program is generated from root functions or classes. These roots can be any function or class. If you do not specify the root, OO-Browser will use modules that call other modules but are never called by others to generate a structure chart. More than one roots may be used in a structure chart.

You can specify new roots within a structure chart to re-organize the structure to be examined.

To select new roots and generate a new chart:

  1. Choose NEW ROOT from the CHART MENU.

    The New Root dialog box will pop up. It contains a list of functions or classes.

    Ctnewrt1.gif - 10.78 K

  2. Select new roots from the NODE LIST by clicking on them.

    The selected node will appear in the NEW ROOTS list.

    To use default roots, click DEFAULT on the dialog box. The default roots will appear in the NEW ROOTS list.

    To delete a node from the NEW ROOTS list, just click on it.

  3. Click OK.

Changing the way the structure chart looks

You can change the colors used in the structure chart, dim out the connecting paths, and change the way function names or class names are displayed. These options can be selected from the VIEW and OPTION pull-down menus.

Editing source code

The structure charts provide a clear interface to your code. They also allow you to directly edit your code.

To edit source code from within the structure chart:

  1. Point to a function box or a class box.

  2. Open the box menu by pressing the right mouse button.

  3. Select EDIT.

    An EDIT window will pop up. It contains the file in which the selected function or class is defined. If you are using vi or emacs, the EDIT window will display the beginning of the function or class selected. With other editors, the EDIT window will display the beginning of the file.

    Ch_ed.gif - 10.07 K

  4. Edit the code.

    As the default, you will be using the vi editor. You can select a different text editor if you like (see below).

  5. Save your edits.

    In vi, you can do so by issuing the :wq command.

    If you exit from vi successfully, the EDIT window will disappear.

    If you have no write permission on the file, you can close the EDIT window using the quit command (:q!). Then you should add write permission to the file and re-edit it.

To select a different text editor:

  1. Select EDITOR SELECTION from the OPTION pull-down menu.

    The CHART EDITOR dialog box will pop up.

    Ch_ed_s.gif - 3.13 K

  2. Type in the name of the editor your want. The editor must come with a window manager frame.

  3. Click OK.

With vi or emacs, when you start editing from the FUNCTION menu, the EDIT window will display the beginning of the function selected. With other editors, the EDIT window will display the beginning of the file in which the function is located.

To enable multiple editor windows for the same file:

Select MULTIPLE EDIT from the OPTION pull-down menu.

This is useful if you want to see more than one part of a single file at the same time. The button becomes inactive while SINGLE EDIT becomes active.

Select SINGLE EDIT to disable multiple editor windows for the same file.

To generate a new database after editing:

When you finish editing the source code, you may wish to regenerate the database for your program. Panorama C/C++ uses incremental database management, so only the files you have modified will be re-analyzed to build the new database.

  1. stop.GIF - 0.22 KStop all Panorama C/C++ activities on the current database.

    Select STOP from the Panorama C/C++ MAIN menu

  2. make.GIF - 0.26 KClick CREATE DATABASE in the tool bar.

    The CREATE DATABASE dialog box will come up. Select the options you want. (See"Creating and Loading a Database" )

    After you have created the new database, you can use different tools to view new results.

Printing a structure chart

The structure chart can be printed on a PostScript printer, or saved to a file in PostScript format:

  1. Select PRINT from the FILE pull-down menu.

    The PRINT dialog box will pop up.

    Ctprint1.gif - 5.42 K

  2. Select TO PRINTER or TO FILE.

    Select TO PRINTER to output to a PostScript printer.

    If you select TO FILE, the structure chart will be written to a file formatted in PostScript according to the page size and tiling instructions in the PRINT dialog box.

  3. Specify the output destination.

    If you select TO PRINTER, enter the device name in the text input area next to that button.

    If you select TO FILE, enter the path and file name in the text input area next to that button.

  4. Select the paper size by clicking USLetter/USLegal/Executive/A4, then dragging the cursor to the desired selection and releasing.

    If you select a paper size which is not supported by your printer or plotter, you may get unexpected results.

  5. Select orientation: Portrait or Landscape.

  6. Specify the number of tiles.

    When printing a large structure chart, you may want to break it up into parts (tiles), and print each part on a separate sheet. Then you can assemble these sheets into one large chart. Move the slider on the tiling scale in the dialog box. The numbers to the right of the scale shows the tile number (n x m).

    The number of tiles in effect controls the output magnification. More tiles will result in a larger chart.

  7. Press OK.

Exiting the structure chart

To exit from the structure chart:

Click EXIT from the FILE pull-down menu .

You do not need to return to the top level of nested subtrees before exiting.

Exiting Panorama OO-Browser

To exit from OO-Browser:

Click QUIT on the OO-Browser menu bar.


back to Table of Contents