I have source code (java language) in eclipse. Then I check the coverage. I give 4 as the input. But I don't know what's the meaning of the color (red, yellow, and green). This is the code(ifElse.java):
Then what's the meaning of Statement 80%, Branch 50%, and Term 50%? How to calculate it? Thank you.
Green means your tests have run through those instructions.
Yellow means your tests have run through those instructions, but not all of possible cases have been covered.
If you have this simple conditional:
if(i>2) <- yellow
It means your tests covered a value of i
either less than 2 or greater than two, but not two of them. In such case you must to think of 2 different "scenarios" which usually means two different tests.
Red means none of your tests reached those instructions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With