The Panorama C/C++ software testing, maintenance, and re-engineering environment is designed to simplify and speed up the tasks of understanding, evaluating, and maintaining existing code. It is easy to use. Panorama C/C++ provides active on-line help. Just click the HELP button when you need more information about an operation.
This demo operation guide uses one of the demo programs provided by Panorama C/C++. You can select from three different demo programs: for C, a FORTRAN to C translator program (demo2); for C++, a calculator program (cal); and for mixed C and C++, another calculator program(cal_with_c).
- Specifying the source program
Panorama C/C++ generates information about a software program directly from its source code. To specify the source files, the user only needs to identify the makefile of the program.
- Change into the correct demo subdirectory under the Panorama installation directory.
- for a sample C program, type
cd demo/demo2
- for a sample C++ program, type
cd demo/cal
- for a sample mixed C and C++ program, type
cd demo/cal_with_c
- Start Panorama from there:
panorama &
The Panorama MAIN menu will pop up. It contains a tool bar with thirteen buttons: five buttons for dealing with input/output (makefile, hsi and database), five buttons for the five individual tools in Panorama: OO-Test, OO-Browser, OO-Diagrammer, OO-SQA and OO-Analyzer, the SUBSET selection button for analyzing only part of the source files, the STOP button to cancel all operation on the current database, and the HELP button for on-line help.
- Press the LOAD MAKEFILE tool button (the leftmost button in the tool bar) to open the LOAD MAKEFILE menu.
- Click on Makefile from the FILES list to select it.
- Press OK on the LOAD MAKEFILE menu to close the menu.
The MAIN input bin will now display the content of the makefile.
- Creating an analysis database
Panorama will analyze the makefile to extract all the necessary information about the source files. It then creates a .hsi file that lists all the source files and the correct CPP options. Using the .hsi file, Panorama C/C++ can analyze the user’s source code to generate a database of information about the system. The information can then be viewed on charts, diagrams, and reports.
- On the tool bar of the MAIN menu, press the BUILD DBS tool button, the fourth button from the left. The CREATE DBS file will come up.
- In the SELECTION field, type in demo.dbs for the database file name. The DATABASE AND INPUT BIN FILE GENERATOR menu will come up.
- Click APPLY. Panorama will analyze the source program to build a database of information. When demo.hsi and demo.dbs has been generated, a dialog box will come up to notify you.
- Press OK on the dialog box. Static analysis data has been generated.
Follow Step C now to collect dynamic test coverage data or skip to Step D to directly view only the static analysis information in charts, diagram, report, and metrics diagrams.
- Getting dynamic test coverage data
You need to run the demo program to obtain its test coverage data. A test script TestCase been provided in the same directory. Just run it from Panorama OO-Test to obtain test data.
- On the tool bar of the MAIN menu, click the green OO-TEST button, the sixth from the left. The Panorama OO-Test menu bar will pop up.
- Press the SCRIPT button. A dialog box will come up showing demo.hsi.
- Press OK to accept the .hsi file. The SCRIPT window will come up.
- Click FILE, then select LOAD from the submenu. A LOAD TEST CASE SCRIPT dialog box will pop up.
- In the FILE NAME field, type in TestCase and press OK to load the script file. The file will show up in the SCRIPT window.
- Click RUN from the menu bar of the SCRIPT window. The SPECIFY TEST DATABASE dialog box will come up.
- In the .TDBS NAME field, type in demo.tdbs. This is a Test Database of test coverage data.
- Press RUN to run the script and accumulate data in demo.tdbs. A command window will pop up showing the results of the execution. Then a dialog box will come up asking if you wish to keep the window.
- Click NO to close the command window.
- Click FILE then QUIT to exit the SCRIPT window.
- Obtaining a system-level overview using J-Charts
Panorama OO-Browser generates three kinds of J-Charts from your source code: Function Calling Graph, Class Inheritance Chart, and Class-Function Coupling Chart. They give a quick, graphic overview of program hierarchies.
- On the tool bar of the MAIN menu, click the blue OO-BROWSER button, the seventh from the left. The Panorama OO-Browser menu bar will pop up.
- Press the FUNCTION CALL GRAPH button. A CHART OPTIONS dialog box will come up.
- Press OK on the dialog box. The Function Calling Graph will come up. Each box represents a function, connecting lines represent function calling relationships.
- Click the left mouse button on a function box in the J-Chart will highlight the related functions.
- Click the right mouse button on a function box will activate the FUNCTION pop-up menu. For example, select J-DIAGRAM to view the J-Diagram for the function.
- Click the right mouse button anywhere outside the function boxes to open the CHART pop up menu. For example, select COMPLEXITY then WITH CASE to overlay complexity information on the chart.
- If you have collected test coverage data (Step C), you can select TEST COVERAGE then ACCU RUN SC0 from the CHART pop up menu. Then the test coverage data will be shown on the charts.
- You can repeat D.2 - D.7 for Class Inheritance Chart and Class-Function Calling Graph.
- Click on HELP from the right end of the menu bar. A Panorama C/C++ Help window will come up, showing an Index. Text in blue can be expanded to show more information.
- Click on the blue "Notations of Structure Chart" a few lines down from the top. The Help window will now display information on notations. Drag the scroll bar at the right if you want to see more.
- Click the middle mouse button to jump back to the Index display. Now you know how to navigate the Panorama Help window. Use it whenever you have a question.
- Select QUIT from the Panorama Help window to exit Help.
- Click QUIT from the Panorama OO-Browser tool bar to exit OO-Browser.
- Understanding detailed code logic using Logic Diagrams
Panorama OO-Diagrammer generates three kinds of logic diagrams from your source code: J-Diagram, J-Flow, and ActionPlus. They give insights into the detailed logic of a program.
- On the tool bar of the MAIN menu, click the brown OO-DIAGRAMMER button, the sixth from the right. The Panorama OO-Diagrammer menu bar will pop up.
- Press the J-DIAGRAM button. An OPTIONS dialog box will come up.
- Press OK on the dialog box. The J-Diagram will come up. After the table of contents is the Function High Level Diagram. It shows the calling relation ship between functions. At the right of each function name is a corresponding active number.
- Click the left mouse button on an active numbers at the right side of the diagram to jump to detailed diagram for that function.
- Code in diagrammed format is much easier to read through. You can scroll through it using the "page down" key.
- If there is a function call or other reference in the code, just click the left mouse button on the active number at the right side to jump to the corresponding part of the diagram. Click the middle mouse button to jump back.
- If you have collected test coverage data (Step C), you can display test coverage data on the diagram. From the menu bar, select OPTION, then TEST COVERAGE, then ACCUMULATED. The test frequencies will be displayed on the top right of each segment, and the untested segment will be highlighted with black boxes.
- Select OPTION, then SWITCH TO, then J-FLOW to switch to the J-Flow Diagram. In this control flow diagram, you can highlight an untested path and view information about it to help you test an untested segment.
- Scroll down to a function that contains untested segments and is fairly complex. Each vertical line from the left represents a new control level. So one that has many levels is more complex in logic.
- While pressing the "control" key, click the middle mouse button on an untested segment (a black box). A path containing the untested segment will be highlighted in magenta.
- From the menu bar, select PATH then CURRENT PATH INFO to view the logic conditions which when satisfied will test this path.
- Un-select the path by pressing the "control" key and click the middle mouse button away from the logic diagram (such as on the line/block number in the left).
- Select OPTION, then SWITCH TO, then ACTIONPLUS to switch to the ActionPlus Diagram, an enhanced version of the Action Diagram.
- Click QUIT from the Panorama OO-Diagrammer tool bar to exit OO-Diagrammer.
- Measuring program quality using metrics diagrams
Panorama OO-SQA allows you to set practical quality standards for your object-oriented program, then collect quality data from your source code and see how it compares to the standards you have set. The quality data is shown in four easy-to-see formats: Bar Graph, Kiviat Diagram, Multi-Metrics Diagram, Histogram and Reports.
- On the tool bar of the MAIN menu, click the purple OO-SQA button, the fifth from the right. The Panorama OO-SQA menu bar will pop up.
- Press the BAR GRAPH button. A FUNCTION-CLASS selection dialog box will come up.
- Press CLASSES then OK on the dialog box. The METRICS window will come up with the Bar Graph. For each of the quality assurance metrics listed on the left, a bar shows how well the classes in the program satisfy the metric: he blue part represents the passed classes, the red part the failed classes.
- From the menu bar of the METRICS window, click OPTIONS then STANDARDS. The STANDARDS menu will come up. You can change the minimum/maximum acceptable value or the weight for each metric, then press OK to observe the change in the metrics diagram.Press CLASSES then OK on the dialog box. The METRICS window will come up with the Bar Graph. For each of the quality assurance metrics listed on the left, a bar shows how well the classes in the program satisfy the metric: he blue part represents the passed classes, the red part the failed classes.
- Press FILE, then KIVIAT DIAGRAM to view a different metrics diagram. In this diagram, each radius represents a metric. The inner circle represents the minimum acceptable value, the outer circle the maximum acceptable value. Each function’s metric values are connected to form a polygon, if the polygon falls entirely within the two circles, the function satisfy all the metrics.
- From the menu bar, press FILE then HISTOGRAM. You can then select from a submenu with a variety of metrics, including object-oriented metrics such as Ratio of Code Reused/Class.
- You can also view quality assurance REPORTS and MULTIPLE METRICS DIAGRAM by selecting them from the FILE menu.
- Click QUIT from the Panorama OO-SQA tool bar to exit OO-SQA.
- Viewing on-line program documentation
Panorama OO-Analyzer automatically generates reports from the source code to fully document a software program. More than 100 reports provide information on program compactness, function/class structure, special functions, global/static variable, complexity, and test coverage.
- On the tool bar of the MAIN menu, click the pink OO-ANALYZER button, the fourth from the right. The Panorama OO-Analyzer menu bar will pop up.
- Press the REPORT button. A REPORT dialog box will come up.
- Press OK on the dialog box. The 43 default reports will be generated. The REPORT window will come up, showing the Table of Contents.
- To the right of each report title is an active number. Click the left mouse button on an active number to view the specific report.
- Scroll through the report using the "page down" key.
- Jump back to the table of contents by clicking the middle mouse button.
- Select QUIT from the Panorama OO-Analyzer tool bar to exit OO-Analyzer.
- Analyzing test cases for more efficient testing
You need to have done Step C to capture test coverage data before running this step. Panorama OO-Test provides an ideal environment for running test cases, viewing the test coverage result, and analyzing the test cases to reduce re-testing effort.
- On the tool bar of the MAIN menu, click the green OO-TEST button, the sixth from the right.
The Panorama OO-Test menu bar will pop up. OO-Test’s Script, J-Flow, and TCA functions are tailored for testing operations. It’s Script functions has been shown in Step 3. We will now present Test Case Analysis (TCA).
- Click TCA on the Panorama OO-Test menu bar. A TEST COVERAGE ANALYSIS dialog box pops up.
- Press OK. A TEST CASE ANALYSIS window will pop up. All the test cases in the script TestCase applied to the program earlier are recorded internally and listed in this window.
- Click the CORRESPONDENCES on the menu bar, then click FILE-CLASS-FUNCTION to activate the FILE-CLASS-FUNCTION window, which lists the files/classes/functions of the demo program in a hierarchical tree format.
- Click the CORRESPONDENCES on the menu bar, then click SEGMENT option to activate the SEGMENT window, which shows a J-Flow diagram of the demo program.
- Click on a test case in the TEST COVERAGE ANALYSIS window. It will be highlighted in blue. Simultaneously, the corresponding files/classes/functions which can be tested by this test case will be highlighted in red in the FILE-CLASS-FUNCTION window, and the segments which can be tested by this test case will also be highlighted in red in the SEGMENT window.
- Conversely, click on a file or a class or a function in the FILE-CLASS-FUNCTION window. This file/ class/function will be highlighted in blue while the corresponding test cases which can be used to test this specified file/class/function will be highlighted in red.
- Similarly, click the left mouse button on a segment in the SEGMENT window. This segment will be highlighted in blue while the test cases which can be used to test this segment will be highlighted in red.
- Click the left mouse button of SOURCE on the SEGMENT window menu bar, a SOURCE window pops up in which the source code of the demo program being tested are listed.
- The FILE/CLASS/FUNCTION, SEGMENT and SOURCE windows are closely linked to each other. Click one element in a window, the corresponding elements in other two windows will be highlighted. So it is easy to find the corresponding locations of the source elements.
- Test cases have different test efficiency. Adopting the highly efficient test cases results in great savings of test effort. Click EFFICIENCY on the TEST COVERAGE ANALYSIS window.
The TEST CASE EFFICIENCY ANALYSIS OPTIONS dialog box pops up.
- Press OK. The EFFICIENCY ANALYSIS RESULT window will pop up. It shows all the test cases and their test coverage results for different levels.
- In a large set of test cases, many test cases merely duplicate the test coverage results obtained by the previous test cases run. A lot of test efforts thus are wasted. To minimize test cases, press MINIMIZATION on the menu bar of Test Coverage Analysis window.
The TEST CASE MINIMIZATION OPTIONS dialog box pops up.
- Press OK. The MINIMIZATION RESULT window will pop up. It shows the minimized set of test cases obtained from all the test cases in the TestCase script.
- Press QUIT on the Panorama OO-Test menu bar to exit OO-Test.
- Further exploration.
Panorama C/C++ comes with several other demo programs (under panodir/demo). Please note that Blocks works only under Open Look.
- Exiting Panorama.
Click FILE then QUIT from the Panorama C/C++ MAIN menu.