CSE 70, Spring 2010

Software Engineering

Lab Instructions


Measure 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 Eclipse's Help menu, select Software Updates ...
    2. In the Software Updates and Add-ons dialog, select the Available Software tab and hit Add Site ...
    3. In the Add Site dialog enter the URL http://update.eclemma.org/ and hit OK.
    4. In the Software Updates and Add-ons dialog again, check the box next to the plugin name and hit Install ...
    5. In the Install dialog, hit Next, then select I accept the terms of the license agreement and hit Finish.
    6. After the installation finishes, in the Software Updates dialog, hit Yes to 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. In the Project Explorer tab, expand your tests directory and right-click on the package edu.ucsd.cse70.ircclient, then select Coverage as -> JUnit Test.
    4. In the Coverage tab, expand your src directory and the package edu.ucsd.cse70.ircclient. Double-click on files containing code you've written, like IRCActionHandler.java and IRCMessageHandler.java.
  3. Improve your test coverage.
    1. 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.
    2. TASK: Create Trac tickets for any areas where coverage can be improved, and assign them to pairs. Try to make everything green unless you have a good reason to leave certain code uncovered!
    3. As you develop your project, continually monitor and improve your test coverage.

Valid XHTML 1.0 Strict Valid CSS!