Basic Code Coverage Question [message #1797439] |
Tue, 30 October 2018 22:57 |
Reinhardt Christiansen Messages: 73 Registered: March 2010 |
Member |
|
|
I gave the code coverage functionality in Eclipse (2018-09) a whirl today and was rather surprised by the report it generated. My class, which is a JUnit5 Test Case, has 420 lines of source code but, of course, some of those lines don't get executed as such since they are imports, comments, blank spaces, and class and method declarations. But everything else (aside from two small methods with @Disabled annotations got executed, probably around 300 lines total. So far so good.
However, when I look at the report, it says I executed only 4.2% of my code! Furthermore, it says it there were 1113 "covered instructions", 25,515 "missed instructions" and 26,628 "total instructions".
I'm baffled by this. Essentially, I think I want it to say that I executed 100% of my code, not just 4.2%, since all the statements it could actually execute (which I wanted executed) WERE executed. Also, I don't understand what it means by "instructions" and why there are so many compared to the number of lines actually in my class - and how I managed to miss so many!
Can someone kindly explain what the report actually MEANS? I want to make sure I cover all of my code and if these low numbers mean I've only scraped the surface, I need to know what else I need to do to test ALL of the code. If I *have* run all of the code as I think I have, how do I coax the report to acknowledge that with a nice 100% in the Coverage column?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02466 seconds