CSE 70, Spring 2008

Software Engineering

Lab 6 Instructions


Part 1: Apply a patch.

  1. Check out your team project in Eclipse.
  2. Look at Changeset 147 in the main project code.
  3. Use the link labeled Unified Diff at the bottom to save a "patch file" containing the changes.
  4. Apply the patch to your project using the Eclipse feature (Team->Apply Patch...).
  5. Update from the repository again and run your tests to make sure they still pass, then commit the changes you just applied, including appropriate comments.

Part 2: Install and use an Eclipse plugin.

Metrics is an Eclipse plugin that calculates cyclomatic complexity. Follow these directions to install and use it:

  1. Install the plugin.
    1. In the Help menu, select Software Updates -> Find and Install...
    2. In the Install/Update dialog, select Search for new features to install and hit Next.
    3. Hit New Remote Site and enter the URL http://metrics.sourceforge.net/update/. Hit OK, then Finish.
    4. Check the box next to the plugin name and hit Next.
    5. Select I accept the terms in the license agreement and hit Next, then Finish.
  2. Enable and use the plugin.
    1. In the Package Explorer tab, select your project and hit Alt+Enter to bring up the Properties dialog.
    2. Select the Metrics panel, check Enable Metrics, and hit OK.
    3. In the Window menu, select Show View -> Other..., then select Metrics -> Metrics View and hit OK.
    4. In the Java view, notice the Metrics tab in the bottom panel.
  3. Answer the following questions.
    1. Open IRCMessage.java and examine the parseParams method. Based on your reading of the code, what is the McCabe Cyclomatic Complexity of parseParams?
    2. Now look in the Metrics tab. Expand the McCabe Cyclomatic Complexity entry and locate IRCMessage.parseParams. Does the plugin's calculation match your own?
    3. Which methods in the entire project have the most lines of code?
    4. Does the lines of code calculation count comments? Do an experiment to find out.

Valid XHTML 1.0 Strict Valid CSS!