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 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.
The lines between these boxes indicate which functions call which.
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.
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.
This section covers:
Activating Panorama OO-Browser
To invoke OO-Browser from the Panorama C/C++ MAIN menu:
Alternatively, you may click the TOOLS menu, then click OO-Browser option.
The OO-Browser Option dialog box 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-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.
To generate a function call graph, a class inheritance chart, or a class-function coupling graph of your code:
The CHART OPTIONS dialog box will pop up.
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.
The chart specified will be generated:
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:
Then drag the left mouse button and release it to select a menu element.
To open the CHART pop up menu:
Then drag the right mouse button and release it to select a menu element.
To open the box menu (FUNCTION menu or CLASS menu):
Drag the right mouse button and release it to select a menu element.
Highlighting and isolating subtrees
To highlight a subtree:
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.
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:
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):
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).
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).
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).
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:
The ISOLATE SUBTREE submenu will pop up.
To return to the full structure chart, step back through the levels of nested subtrees:
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.
To hide a subtree:
The subtree with the selected module as its root will be dimmed.
To expand a subtree:
The default setting is NON-ACTIVATABLE. In this case, a hidden module can not be expanded.
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:
The module and all its connection lines will be dimmed.
To expose a module:
The default setting is NON-ACTIVATABLE. In this case, a dimmed module can not be exposed.
Locating functions and classes
To locate a function or a class inside the structure chart:
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.
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.
To display a full-size structure chart:
The full-size chart will appear. It contains the boxes inclosed by the frame in the reduced chart.
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:
The complexity data and bar graphs will appear on the structure chart.
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.
A Panorama C/C++ Performance dialog box will pop up.
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.
The performance data and bar graphs will appear on the structure chart.
Displaying test coverage results
To display test coverage data:
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+).
The test coverage data and bar graphs will show up on the structure chart.
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.
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.
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.
To close this information window, select CLOSE from its window menu.
To display information about individual classes:
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.
To close this information window, select CLOSE from its window 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.
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
To generate ActionPlus Diagram of the selected module
To generate J-Flow Diagram of the selected module
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.
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:
The New Root dialog box will pop up. It contains a list of functions or classes.
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.
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.
Choose DIM LINES from the VIEW pull-down menu.
This will dim the paths that connect function/class boxes and makes it easier to read data overlaid on the chart. Select SHOW LINES will restore the paths.
Choose LONG NAME from the OPTION pull-down menu.
The names on the boxes are normally truncated. Select LONG NAME to display the full names of the modules. LONG NAMES toggles to become inactive. Then you may select SHORT NAME to restore the short names of the modules.
Choose WITH IND. RECU. from the OPTION pull-down menu.
When you highlight a subtree, its indirect recursive lines are also highlighted. This menu element then becomes inactive. Then you may select WITHOUT to dim the indirect recursive lines.
Choose DIM OTHERS from the OPTION pull-down menu.
If a subtree is being highlighted, the boxes which do not belong to this subtree will be dimmed. This menu element then becomes inactive. You can select NORMAL OTHERS to restore other boxes.
OO-Browser can display complexity, performance, and other data on the structure chart as bar graphs overlaid on each module. The dimensions of the bars can be dynamic or fixed.
To set dynamic bar dimension:
Choose DYNAMIC BAR from the OPTION pull-down menu.
The maximum length of the bar overlaid on the function box in the structure chart will be calculated from the maximum data value.
To set fixed bar dimension:
Choose FIXED BAR from the OPTION pull-down menu.
The FIXED BAR VALUE SELECTION dialog box will pop up.
You may type in maximum function size and maximum value for complexity, maximum execution times and maximum duration of execution for performance, and maximum execution times for test coverage in the text fields. Then click OK to accept these setting.
To use default values, click DEFAULT in the dialog box.
You can change the dimensions and spacing of the boxes in the structure chart.
To set box dimension:
Choose BOX DIMENSION from the OPTION pull-down menu.
The BOX DIMENSION SELECTION dialog box will pop up.
You may type in the values of box width, box height, lines distance, line-box distance, vertical distance of boxes in the text fields, then click OK to accept the new setting.
To reset the default values, click DEFAULT in the dialog box.
To automatically set box dimension:
Choose AUTO BOX from the OPTION pull-down menu.
The chart boxes will be automatically resized to be large enough to contain the longest names. The AUTO BOX button will be come inactive.
Choose DIMMED BOX ACTIVATABLE from the OPTION pull-down menu.
The dimmed or hidden boxes are still activated. Then, this menu element becomes inactive, while NON-ACTIVATABLE which you can select to disable the dimmed or hidden boxes becomes active.
The CHANGE CHART COLOR dialog box will pop up.
Samples of the colors for each element of the structure chart are shown in three columns:
The meaning of each element is as follows:
Point to the sample color for the element you want to change, then click the left mouse button.
Point to a slider, hold down the left mouse button, and move the slider left or right. The selected sample color on the left of the window will change as you move the sliders.
Take care to contrast between the colors of the function names and their backgrounds. Avoid, for example, dark blue function names on black function boxes.
At any time, you may press DEFAULT to restore the default colors.
If you want to discard the changes, press CANCEL instead.
Your color choices will stay in effect until you exit the structure chart. You may save your customized colors in a file for later reloading.
To save your color choices:
See above. Do not dismiss the CHANGE CHART COLOR window.
The SAVE COLOR dialog box will come up. It contains a DIRECTORIES list and a FILES list, which shows all the .col files.
Click on a directory in the DIRECTORIES list to change to that directory.
Click on a file in the FILES list to save to that file. You selection will appear in the SELECTION field.
To save to a new file, enter the filename (with .col suffix) in the SELECTION field.
To reload your colors:
The LOAD COLOR dialog box will pop up. It contains a DIRECTORIES list and a FILES list, which shows all the .col files.
Click on a directory in the DIRECTORIES list to change to that directory.
Click on the file in the FILES list. You selection will appear in the SELECTION field.
Changing fonts
You can customize the fonts of the text in the structure chart.
The FONT SELECTION dialog box will pop up.
The sample characters in the selected font will appear below the list.
To use the default font (fixed), click DEFAULT.
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:
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.
As the default, you will be using the vi editor. You can select a different text editor if you like (see below).
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:
The CHART EDITOR dialog box will pop up.
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.
Select STOP from the Panorama C/C++ MAIN menu
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.
The structure chart can be printed on a PostScript printer, or saved to a file in PostScript format:
The PRINT dialog box will pop up.
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.
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.
If you select a paper size which is not supported by your printer or plotter, you may get unexpected results.
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.
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.
To exit from OO-Browser:
Click QUIT on the OO-Browser menu bar.