CSE 70, Fall 2008
Software Engineering
Lab 6 Instructions
Measure your test coverage.
EclEmma is an Eclipse plugin that does coverage checking.
Follow these directions to install and use it:
-
Install the plugin.
-
In Eclipse's 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 name "EclEmma" and the URL
http://update.eclemma.org/.
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.
-
Hit Install, then restart Eclipse.
-
Use the plugin.
-
In the Window menu, select Show View -> Other..., then select Java -> Coverage and hit OK.
-
In the Java view, notice the Coverage tab in the bottom panel.
-
In the Package Explorer tab, expand your
tests directory
and right-click on the package edu.ucsd.cse70.ircclient, then
select Coverage as -> JUnit Test.
-
In the Coverage tab, expand your
src directory
and the package edu.ucsd.cse70.ircclient.
Double-click on IRCClient.java.
-
Improve your test coverage.
-
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.
-
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!
-
As you develop your project,
continually monitor and improve your test coverage.