SE-2832 Introduction to Software Verification

Dr. Mark Sebern -- Spring quarter 2013-2014

Lab 10

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.

Lab Assignment

  1. Download the CyVis software from Extract the ZIP file to c:\ so that the software is located in c:\cyvis-0.9.
  2. Download the winPlotter jar file; you are likely familiar with this utility from prior courses.
  3. 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)
      • Bottom:
        • 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
  4. 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.)

  5. 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?
  6. Repeat the analysis for the other software samples, answering the same questions:

    (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:

If you have any questions, consult the instructor.