I just wrote some simple sample code to make sure that I had EclEmma installed correctly. I'm not getting 100% coverage, and I don't understand why. The highlighting implies that it has to do with the class name. Here's my code, with corresponding JUnit tests, the way EclEmma highlighted it:
The coverage results show that three instructions in Arithmetic
aren't getting hit, even though both actual methods seem to be completely covered:
I've read the EclEmma documentation about basic block coverage, but I'm still confused. I'm not sure which basic blocks are being missed. At first, I thought EclEmma might just be ignoring the bytecode for classes, but ArithmeticTest
seems to be handled just fine.
I have two closely related questions:
- Does this indicate a problem with the way I installed/configured EclEmma?
- Is it normal/acceptable for fully covered code to have a high-but-not-quite-100% EMMA coverage rating, and if so, how does that work?
new Arithmetic()
. Of course, the correct thing here would be to declare aprivate
default constructor in the class. – Pounds