Avatar of AnjaliW
AnjaliW
 asked on

code coverage

Few questions which I am confused with:

1.Does code coverage happens  on JUNIT Classes?
2.If so ,then will it give all report where that JUNIT invokes other java sources.
3.If I am running Junit and then need to do code coverage on that testclass what should I have to DO?
4.Which command to execute to get code coverage of that JUNIT.
SoftwareJavaProgramming Languages-Other

Avatar of undefined
Last Comment
AnjaliW

8/22/2022 - Mon
ksivananth

>>1.Does code coverage happens  on JUNIT Classes?

basically it checks how much actual code is tested/invoked by unittests.

>>2.If so ,then will it give all report where that JUNIT invokes other java sources.

depends the tool you use

>>3.If I am running Junit and then need to do code coverage on that testclass what should I have to DO?

there are bunch of free and proprietary code coverage tools, EMMA is such one search google and choose the best one fit for you.

4.Which command to execute to get code coverage of that JUNIT
AnjaliW

ASKER
As said ..it checks actual sources has been covered  by test.
If I provide jar's of sources in there dependencies..then will it still do coverage of that classes inside jars. or it requires classes "target/classes/..." to instrument those classes.

In my scenario...it is not creating coverage report at target/cobetura directory...says no classes for instrumentation........

I am using Cobertura plugin....
ASKER CERTIFIED SOLUTION
ramazanyich

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
AnjaliW

ASKER
thx!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23