Revised: 14 May 2014
This lab was developed by Dr. Walt Schilling; all errors in its adaptation are the responsibility of the instructor.
In this lab, you will work in a small team (2-3 members) to explore the use of a complexity analysis and visualization tool. You may not do this lab by yourself.
CyVis is a free software metrics collection, analysis and visualization tool for Java. It collects metrics from Java .class and .jar files and creates graphical displays that indicate the software complexity of these modules. Cyvis has GUI, command-line, and Ant task interfaces. Its display parameters are configurable.
Once metrics are collected from the selected modules, the resulting statistical information can be viewed as charts, graphs and tables. The purpose of this analysis and display is to facilitate interpretation of the data and to allow the user to find potential problems.
In this lab, you will analyze four different programs from other (past and future) software engineering courses.
- Download the CyVis software from cyvis.sourceforge.net/index.html.
Extract the ZIP file to c:\ so that the software is located in c:\cyvis-0.9.
- Instructions for using the CyVis GUI can be found at cyvis.sourceforge.net/cyvis_graphical_interface.html.
- Download the winPlotter jar file; you are likely familiar with this utility from prior courses.
- Create a new CyVis project for this code and analyze it.
- Run CyVis by invoking cyvis.bat in the bin subdirectory or by double-clicking on cyvis-0.9.jar.
- Select File->New Project, enter a project name, select a project directory, and Add the WinPlotter jar file. Save the newly created project. (Because CyVis navigates the directory tree from the top each time, it's probably better not to use a long path to your project directory or to the software selected for analysis.)
- You should see:
- Left: a list of packages and classes in the software being analyzed
- Top: A colored graph of method complexity, with one column for each class (hover over each segment to identify the corresponding element; click to drill down further)
- For the overall project: a list of packages and class counts
- For packages: a list of classes, method counts, and instruction counts
- For classes: a list of methods with cyclomatic complexity values and instruction counts
Open the preferences window (Metrics->Preferences...) and configure the following parameters:
- High Complexity CC Count: 12
- Moderate Complexity CC Count: 6
- Low Complexity CC Count: 0
You may leave the colors unchanged. Click Save and Close.
(Note that the Metrics->Generate HTML Report option seems broken in this version and that Metrics->Generate TXT Report does not provide much additional information, though you might be able to edit it for import into a spreadsheet for further analysis.)
- From the analysis data, determine:
- How many methods have high complexity?
- How many methods have moderate complexity?
- What is the highest complexity measured?
- How many classes have methods with high or moderate complexities?
- From this data, which methods seem most problematic with respect to testing and quality, and how concerned would you be?
Repeat the analysis for the other software samples, answering the same questions:
- Pizzaria project code
- JGraph jar file. JGraph is an open-source graphics utility used for the creation and visualization of program graphs.
- Virtual Memory Simulator. This tool is used in the operating systems course to analyze the performance of virtual memory systems. You may find it interesting to take a look at this tool's source code.
(You may have to restart CyVis when beginning a new project to completely reset its state.)
Assignment submission (completed in lab if possible, otherwise due by 11:59PM CDT, Sunday, May 18)
Prepare a PDF report (named "SE2832-username1-username2-username3-Lab9.pdf" (using dashes, not underscores, with the specified capitalization), where each "usernameN" is the lowercase MSOE email username of a team member) on your lab experience, including:
- Your names and assignment identification ("SE-2832 Lab 10")
- A brief description of your analysis results for the software samples listed above. You may wish to include some selected data or analysis output to illustrate your conclusions, but this is meant to be a brief report.
- Other comments on the lab experience and any remaining questions that you have.
If you have any questions, consult the instructor.