CSE 70, Spring 2008

Software Engineering

Lab 8 Instructions


Measure and improve your test coverage.

EclEmma is an Eclipse plugin that does coverage checking. 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://update.eclemma.org/. 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.
    6. Hit Install, then restart Eclipse.
  2. Use the plugin.
    1. In the Window menu, select Show View -> Other..., then select Java -> Coverage and hit OK.
    2. In the Java view, notice the Coverage tab in the bottom panel.
    3. Right click on the package edu.ucsd.cse70.ircclient in your tests directory, and select Coverage as -> JUnit Test
  3. Improve your test coverage.
    1. Apply Changeset 152 to your project. This should add tests for all the parts of IRCMessage.java that make sense, and should bring coverage up from 81.2% to 88.5% (unless you've made other modifications).
    2. After running the coverage analysis, look through your code and focus on the red and yellow areas. Red means the statement is never executed; yellow means it is executed but there is a boolean expression that doesn't take all possible values.
    3. TASK: Create Trac tickets for any areas where coverage can be improved. Plan to make everything green unless you have a good reason to leave certain code uncovered!

Valid XHTML 1.0 Strict Valid CSS!