Alternative Code Coverage Methods Other than Emma

14 views
Skip to first unread message

Steve Ramage

unread,
Dec 5, 2011, 10:25:35 PM12/5/11
to CPSC410-2011
About an hour ago, Emma started generating non-sensical code coverage
results (half of my servlets had data, half didn't, but all the tests
did), now it seems that it just doesn't want to give me any code
coverage data anymore. Is there another way to test this, or should we
just hand in our assignment blind? The coverage.ec files don't seem to
be generated anywhere anymore, restarting eclipse doesn't seem to do
anything. Emma does seem to be loading because if I do it in the wrong
order, I get complaints that the port is still in use (on the
servlet), but beyond that, when I do it correctly, it just never
bothers to write anything.


Justin Leung

unread,
Dec 5, 2011, 10:37:26 PM12/5/11
to CPSC410-2011
We had the same problem of emma generating weird coverage data. I
believe the reason was that we could not make changes or modify any of
the classes while emma was running. It is super sensitive to order of
operation and non changing data

This sequence of action seem to work for us..: & Do not edit any of
the files during the process.

Clean Project
Run emma.xml as ANT. (it should say more than 0 classes instrumented..
otherwise you probably didnt clean project)
Refresh Project
Start Server
Run JUNIT Tests
Stop Server
Clean Project

1. coverage file into eclipse directory
1. coverage file into project directory

try deleting the .ec files before you start too to make sure you have
fresh data.

hope it helps.

Eric Wohlstadter

unread,
Dec 6, 2011, 12:41:12 AM12/6/11
to cpsc41...@googlegroups.com
Hi Steve,
 As long as you are covering 80% of your code (statements) with your tests, you will get full credit. If you aren't able to get Emma to work, I would try your best to estimate coverage by simply inspecting your tests and your code. If you think you have covered "a lot", but you are not exactly sure how much, you can certainly just submit whatever you have and leave it up to the grader to determine the exact coverage. 

Eric
Reply all
Reply to author
Forward
0 new messages