Java testing: who covers what?

Is there a tool like emma that tells which test covers a specific implementation?

+6
source share
2 answers

If you want to see which tests cover which line of code, you can use Clover which shows you:

  • how many times has one line been covered.
  • which checks the string in question

To find out what you can expect from Clover, here is a screenshot: Clover coverage report. Opened info about test that hit line # 49

+6
source

If you do not want to worry about paying / setting Cover, it’s much easier :

  • remove / disable all breakpoints
  • set a breakpoint on the line that you recognize when testing.
  • re-run tests in debug mode
  • look at the stack to find the call calling it

These methods also allow you to see how many times the line is covered, and all the tests that call it.

0
source

Source: https://habr.com/ru/post/926665/


All Articles