Sie sind auf Seite 1von 10

Panorama-2 C++ A Software Testing, Quality Assurance, and Re-engineering Environment for Windows 95 Operation Guide International Software

Automation, Inc. (ISA) 7677 Oakport Street, Suite 105 Oakland, California 94621 USA Fax:(510) 632-3388 Email: isa@netcom.com http://www.softwareautomation.com

About the Operation Guide for Panorama-2 C++ for Windows 95 =========================================================== This operation Guide is used for Panorama-2 C++ for Windows 95. Installation ============ Requirements Machine Requirements: A PC 386/486/586 running Windows 95 Disc space required to load Panorama-2 C++: 5 megabytes Main Memory required: 8+ megabytes Operations ---------1. Run the downloaded file p2cpp_95.exe to install panorama-2. The "WinZip Self-Extractor" dialog box will open, press the Setup button to install Panorama-2. After the file extraction Panorama-2 will prompt you for the directory to store Panorama-2 files. A default value c:\panorama will be displayed in the text field. You can accept or change it. This directory becomes Panorama home directory (PANORAMAHOME). Panorama will set environment variables PANORAMAHOME and PANORAMATMPDIR automatically. 2. Set the Panorama-2 variables ISA_COMPILER and ISA_LINK if needed. For example: MY_COMPILER=CL386.EXE MY_LINK=LINK32.EXE Note: The default variables are CL.EXE and LINK.EXE. If you have not set two of the variables, you can modify it in COMPILER NAME and LINKER text field in PANORAMA ANALYSIS .MAK FILE dialog box when you run Panorama-2. The COMPILER NAME and the LINKER name should be the same as they are specified in the makefile of your program (s). If you use link32 rather than link, you need to modify the makefile of the sample program with the correct linker name, and indicate the correct linker name in the

LINKER text field of the ANALYSIS .MAK FILE dialog box. Panorama-2 performs static and dynamic analysis of a program automatically. The input can be a makefile or a batch file (when you use a batch file, use it as the same as a makefile but directly use the name of a batch file as the make command in the ANALYSIS .MAK dialog box). 3. Get Panorama-2 License. A free version of Panorama-2 can be used to handle a program less than 1501 lines of source code with a license key. To use a product version of Panorama-2, you need to purchase a license and install the license key. Run Panorama-2 from DOS or open the Panorama-2 C++ group from the Program Manger, click on the Panorama-2 icon. Panorama-2's MAIN menu will appear. A message box will show as "license Key: not installed It can be used to analyze sample programs provided or a program less than XXXX lines without license". Click "Get Server Code" from the "License" pull-down menu of Panorama-2. The server code of you computer, the file saved in PANORAMAHOME\code.txt (if you store Panorama in c:\PANORAMA, the server code will be saved in the file c:\PANORAMA\code.txt), Send the server code with The ASCII CODE to ISA or the product distributor. We will give you a key according to the server code. After receiving the key, you may install it by selecting Install Key from License pull-down menu and pressing Install Key from the dialog box. You can check it by select Check Key from License pull-down menu. Installation is now complete. A Guided Tour of Panorama-2 C++ =============================== The Panorama-2 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-2 C++ provides active on-line help. Just click the HELP button when you need more information about an operation. This operation guide uses one of the demo programs provided by Panorama-2 C++, a sortdemo program. 1. Specifying the source program Panorama-2 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. 1.1 Open the Panorama-2 C++ group from the Program Manager, and click on the Panorama-2 C++ icon. The Panorama-2 MAIN menu will pop up. It contains a tool bar with sixteen buttons: six buttons for dealing with input/output (makefile, hsi and database), eight buttons for the nine individual tools in Panorama-2: OO-Test, OO-Browser, OO-Diagrammer, OO-SQA and OO-Analyzer, OO-Playback, OO-MemoryChecker, OO-ProblemTracer, .log button for showing compiler

information and the HELP button for on-line help. 1.2 Click on .MAK from the tool bar. The LOAD .MAK FILE menu will come up. For a sample of Panorama-2 C++, click on the directory SORTDEMO (\PANORAMAHOME\sortdemo). 1.3 Select the makefile for the sortdemo program. Click on the directory sortdemo, then the file sortdemo.mak, and press OK. The file will be loaded into the white area below the tool bar. 2. Creating an analysis database Panorama-2 will analyze the makefile and build a static and dynamic database. The analysis results can then be viewed on charts, diagrams, and reports. It also creates a .hsi file that lists all the source files and the correct CPP options for your reference. If your program does not contain a makefile, you need to manually create a .hsi file specifying all the files of the program to allow Panorama-2 to analyze your program. 2.1 Click on MAKE. The CREATE .DBS FILE dialog box will come up. 2.2 Click OK to accept the default database file name, sortdemo.dbs. The ANALYSIS .MAK FILE menu will come up. 2.3 Click DYNAMIC. This will capture dynamic test coverage data. 2.4 Click SEGMENT+CONDITION COVERAGE DATA (default). This will use the strongest test coverage metric for test coverage analysis 2.5 Click OK. Panorama-2 will analyze the source program to build a database of information. A new window will be opened to display information. When sortdemo.hsi and sortdemo.dbs has been generated, you will be notified. You can then close the window. Follow Step 3 now to collect dynamic test coverage data or skip to Step 4 to directly view only the static analysis information in charts, diagram, report, and metrics diagrams. 3. Getting dynamic test coverage data and capturing the GUI-based operations You need to run the demo program to obtain its test coverage data. This is done using a test script, or a batch file containing the test cases. A test script sortdemo.tca has been provided in the same directory. Just run it from Panorama-2 OO-Test to obtain test data. 3.1 On the tool bar of the MAIN menu, click the green OO-TEST button. The Panorama-2 OO-Test menu bar will pop up. 3.2 Press the SCRIPT button. The SCRIPT window will come up. 3.3 Click FILE, then select LOAD from the submenu. A LOAD CASE FILE dialog box will pop up. 3.4 In the FILE NAME field, type in sortdemo\sortdemo.tca (or sortdemo.tca if you have change the directory to the sortdemo sub-directory already) and press OK to load the script file. The file will show up in the SCRIPT window .

3.5 Click RUN from the menu bar of the SCRIPT window. The SPECIFY TEST DATABASE dialog box will come up showing sortdemo.tdb in the .TDB NAME field. If you want to capture the GUI-based operations for regression testing later, y ou must press RECORD button as TRUE to record the operations. 3.6 Press OK to run the script and accumulate data in sortdemo.tdb. Command window will pop up showing the results of the execution. Then a notification window will come up informing you that the execution has completed (for running each test case, you need to click "Sort" from the sortdemo window to select a sorting method. After the sorting is done, Click "File" then "Exit" to complete each test case. There are ten test cases with the test case file). 3.7 Click OK to close the notification window. 3.8 Click FILE then EXIT to quit the SCRIPT window. 4. Obtaining a system-level overview using J-Charts Panorama-2 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. 4.1 On the tool bar of the MAIN menu, click the blue OO-BROWSER button. The Panorama-2 OO-Browser dialog box will pop up. 4.2 Select FUNCTION CALL GRAPH. 4.3 Select CHART ONLY and press OK. The Function Calling Graph will come up. Each box represents a function, connecting lines represent function calling relationships. 4.4 Click the left mouse button on a function box in the J-Chart will highlight the related functions. 4.5 Click the right mouse button on a function box will activate the FUNCTION pop-up menu. For example, select DIAGRAM then J-DIAGRAM to view the J-Diagram for the function. 4.6 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. 4.7 If you have collected test coverage data (Step 3), you can select TEST COVERAGE then ACCU RUN then SC0 from the CHART pop up menu. Then the test coverage data will be shown on the charts. 4.8 Click on HELP from the chart menu bar. A Panorama-2 C++ Help window will come up, showing an Index. Text in green can be expanded to show more information. 4.9 Click on the green "Description of Structure Chart" a few lines down from the top. The Help window will now display the description of the Structure Chart. 4.10 Click the BACK from the menu bar to jump back to the Index display. Now you know how to navigate the Panorama-2 Help window. Use it whenever you have a question.

4.11 Click EXIT from the Panorama-2 Help window to exit Help. 4.12 Click EXIT from the Chart window to exit OO-Browser. 5. Understanding detailed code logic using Logic Diagrams Panorama-2 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. 5.1 On the tool bar of the MAIN menu, click the orange OO-DIAGRAMMER button. The Panorama-2 OO-Diagrammer menu will pop up. 5.2 Select J-DIAGRAM and press OK. 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. 5.3 Click the left mouse button on an active number at the right side of the diagram to jump to detailed diagram for that function. 5.4 Code in diagrammed format is much easier to read through. You can scroll through it using the <PAGE DOWN> key. 5.5 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. Press <RETURN> to jump back. 5.6 If you have collected test coverage data (Step 3), 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. 5.7 Select OPTION, then SWITCH, 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. 5.8 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. 5.9 Double-click the left mouse button on an untested segment (a black box). A path containing the untested segment will be highlighted in magenta. 5.10 From the menu bar, select PATH then CURRENT PATH INFO to view the logic conditions which when satisfied will test this path. 5.11 Un-select the path by double-clicking the left mouse button away from the logic diagram (such as on the line/block number in the left). 5.12 Select OPTION, then SWITCH, then ACTIONPLUS to switch to the ActionPlus Diagram, an enhanced version of the Action Diagram. 5.13 Click FILE then EXIT to exit OO-Diagrammer. 6. Measuring program quality using metrics diagrams Panorama-2 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, and Reports. 6.1 On the tool bar of the MAIN menu, click the magenta OO-SQA button. The Panorama-2 OO-SQA menu bar will pop up. 6.2 Press FUNCTION, The METRICS window will come up. 6.3 From the menu bar, click TYPE then BAR GRAPH. The Bar Graph will be displayed. For each of the quality assurance metrics listed on the left, a bar shows how well the functions in the program satisfy the metric: the blue part represents the passed functions, the red part the failed functions. 6.4 Click STANDARD. The STANDARD 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. 6.5 Press TYPE, 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. 6.6 You can also view quality assurance REPORTS and MULTIPLE METRICS DIAGRAM by selecting them from the TYPE menu. 6.7 Click FILE then EXIT to exit OO-SQA. 7. Viewing on-line program documentation Panorama-2 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 structure, special functions, global/static variable, complexity, and test coverage. 7.1 On the tool bar of the MAIN menu, click the yellow OO-ANALYZER button. The Panorama-2 OO-Analyzer menu will pop up. 7.2 Press OK on the dialog box. The 44 default reports will be generated. The REPORT window will come up, showing the Table of Contents. 7.4 To the right of each report title is an active number in red. Click the left mouse button on an active number to view the specific report. 7.5 Scroll through the report using the <PAGE DOWN> key. 7.6 Jump back to the table of contents by pressing the <RETURN> key. 7.7 Select FILE then EXIT from the report window to exit OO-Analyzer. 8. Regression testing ---- test case playback Playback function is very useful for rerunning test cases, especially for user's interface testing(GUI playback). You must have done Step 3 (Script action), on Step 3.5 you must select Record button as TRUE in the SPECIFY TEST DATABASE dialog box. 8.1 On the tool bar of the MAIN menu, click the red OO-Playback button. A Playback window pops up.

8.2 Select File then Load menu to load sortdemo.tdb file, the sortdemo.tdb file will be shown on the playback window. 8.3 Select RUN on the menu bar, then you can select ALL or MINI submenu. If you select ALL, A SPECIFY TEST DATABASE dialog box pops up, press OK then all test cases in sortdemo.tdb will be playbacked and all of test database will be added to playout.tdb file. 8.4 Select RUN then MINI menu. TestCase Minimization Options dialog box pops up, select options you want then press OK button, the test cases of minimization will be shown in Minimization Result window. Select Run then ALL menu and SPECIFY TEST DATABASE dialog box pops up, press OK. The test cases of minimization result will be playbacked and all of test database will be added to playout.tdb file. 8.5 You can press FILE menu then SAVE submenu, a SAVE dialog box will pop up, type file name sortmini.tdb then press OK, the minimized test cases will be saved in sortmini.tdb. 8.6 Modifying the source code of sortdemo (copy sortdemo.c to sortdemo.old, then copy sortdemo.new to sortdemo.c or directly modify sortdemo.c) then running Step 1 to build a new database. Running steps 8.1-8.2 with loading sortmini.tdb to playback. (select RUN and ALL this time rather than MINI). The test cases of minimization result will be played back and all of test database will be added to playout.tdb file. 8.7 View the new result after playing back using minimized test cases by repeating steps from section 4 to section 7. You will find that the test coverage result obtained using the minimized test cases through an automated playing the operations back is the same or almost the same as that obtained using the all test cases. It means that with the capture/playback tool seamlessly integrated with test coverage analysis, test case minimization, and analysis of program structure, logic, control flow, complexity, compactness, and data, Panorama-2 can bring you great savings for your software testing and retesting after code modification. Note: a. As you can see from the execution of the sortdemo program, its window position is different each time controlled by the Windows Manager. It is recommended not to move the window (the title) of the sortdemo program otherwise the window may be moved completely or partially out of the screen in automatic playback process. (if it happens, press Alt-Esc to recover it). b. Please make the beginning environment for playback be the same as that for capturing the operations. If the environment is different such as that a file name to be used to save a file does not exist in the capturing process, but after that it exists in the playback process, then the message window shown by the Windows Manager will be different so that the playback process may not be successful (for solving the problem, you may create an empty file before capturing, or rename the file capturing). c. The source file names and the dbs names for capture and for playback after code modification should be the same for correctly running the playback and obtaining the correct test coverage data.

9. Analyzing test cases for more efficient testing You need to have done Step 3 or step 8 to capture test coverage data before running this step. Panorama-2 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. 9.1 On the tool bar of the MAIN menu, click the green OO-TEST button. The Panorama-2 OO-Test menu bar will pop up. OO-Test's Script, and TCA functions are tailored for testing operations. It's Script function and Playback function have been shown in Step 3 and Step 8. We will now present Test Case Analysis (TCA). 9.2 Click TCA on the Panorama-2 OO-Test menu bar. A TEST CASE ANALYSIS dialog box pops up. 9.3 Press OK. A TEST COVERAGE ANALYSIS window will pop up. All the test cases in the script sortdemo.tca applied to the program earlier are recorded internally and listed in this window. 9.4 Click CORRESP. on the menu bar, then click FILE-CLASS-FUNCTION to activate the FILE-CLASS-FUNCTION window, which lists the files/functions of the demo program in a hierarchical tree format. 9.5 Click on a test case in the TEST COVERAGE ANALYSIS window. It will be highlighted in blue. Simultaneously, the corresponding files/functions which can be tested by this test case will be highlighted in red in the FILE-CLASS-FUNCTION window. 9.6 Conversely, click on a file or a function in the FILE-CLASS-FUNCTION window. This file/function will be highlighted in blue while the corresponding test cases which can be used to test this specified file/function will be highlighted in red. 9.7 You can repeat steps 9.4-9.6 using CORRESP. then SEGMENT button. 9.8 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. 9.9 Press OK. The EFFICIENCY ANALYSIS RESULT window will pop up. It shows all the test cases and their test coverage results for different levels. 9.10 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. 9.11 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 sortdemo.tca script. 9.12 Press FILE then EXIT on the TEST COVERAGE ANALYSIS to exit OO-Test. 10. Memory Leak/Violation Check If you want to get memory leak and violation information, use the sample program in the "cppleak" subdirectory. You must

select "Check Memory Leak/Violation" as TRUE in "Panorama-2 Analysis .mak file" dialog box in step 2. In the Memory Checker Report, we will show all of memory leaks and violations to you after you have run a program. 10.1 On the tool bar of the MAIN menu, click the OO-MemoryChecker button. A Memory Leak/Violation Report window will open. You can see all of memory leaks and violation in your program which you have run early. 10.2 Scroll through the report using the <PAGE DOWN> key. 10.3 If you want to clear the earlier record, you can simply click "Clear Record" on the menu bar. 10.4 Press File then Exit to exit Memory Checker Report. 11. Problem Tracer Problem Tracer can trace the execution path from the beginning to the end of an execution of a program when a problem exists with the execution. It can also identify the type of the problem in most cases. You must select "Record Problem Tracing" as TRUE in "Panorama-2 Analysis .mak file" dialog box in Step 2. 11.1 On the tool bar of the MAIN menu, click the OO-ProblemTracer button. A Problem Tracer Report window will open.You can see all of execution path of a program which has some problems you have run early. 11.2 To the right of each case's running time is an active number in red. Click the left mouse button on an active number to view the specific problem tracing report. 11.3 Scroll through the report using the <PAGE DOWN> key. 11.4 Jump back to the table of contents by pressing the <RETURN> key. 11.5 If you want to clear the earlier record, you can simply click "Clear Record" on the menu bar. 11.6 Select FILE then EXIT from the window to exit OO-ProblemTracer. 12. Panorama Log File If you want to know the information of making database, you can click "Open Log" button. The Panorama Log File window will open. If you want to clear these informations you can click "Clear Log" to remove the older panorama log file. 13. Further exploration. 13.1 Panorama-2 C++ comes with another demo program. It is stored in the Panorama-2 home directory under cal, animal, etc. Try them out if you like. 14. Exiting Panorama-2. 14.1 Click FILE then QUIT from the Panorama-2 C++ MAIN menu.