CSE 70, Spring 2008
Software Engineering
Lab 6 Instructions
Part 1: Apply a patch.
- Check out your team project in Eclipse.
- Look at Changeset 147 in the main project code.
- Use the link labeled Unified Diff at the bottom to save a "patch file" containing the changes.
- Apply the patch to your project using the Eclipse feature (Team->Apply Patch...).
- 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:
-
Install the plugin.
-
In the Help menu,
select Software Updates -> Find and Install...
-
In the Install/Update dialog,
select Search for new features to install and hit Next.
-
Hit New Remote Site and enter the URL
http://metrics.sourceforge.net/update/.
Hit OK, then Finish.
-
Check the box next to the plugin name and hit Next.
-
Select I accept the terms in the license agreement and hit Next, then Finish.
-
Enable and use the plugin.
-
In the Package Explorer tab, select your project and hit Alt+Enter to bring up the Properties dialog.
-
Select the Metrics panel, check Enable Metrics, and hit OK.
-
In the Window menu, select Show View -> Other..., then select Metrics -> Metrics View and hit OK.
-
In the Java view, notice the Metrics tab in the bottom panel.
-
Answer the following questions.
-
Open
IRCMessage.java and examine the parseParams method.
Based on your reading of the code, what is the McCabe Cyclomatic Complexity of parseParams?
-
Now look in the Metrics tab.
Expand the McCabe Cyclomatic Complexity entry
and locate
IRCMessage.parseParams.
Does the plugin's calculation match your own?
-
Which methods in the entire project have the most lines of code?
-
Does the lines of code calculation count comments?
Do an experiment to find out.