Reverse code coverage tools?

I am familiar with several code coverage tools that tell me what percentage of lines / branches / etc. covered by my tests, and even show which parts of the code have poor coverage.

Are there any tools that do the opposite, that is, given the code section, can it show me which tests relate to it? This will make it easy to start learning unfamiliar and poorly documented code, playing with the appropriate tests.

You could say that this should be obvious from how the unit tests are organized, but the fact that this often happens is not the case. I worked with several projects where this was so.

I think I'm interested in java / scala, but I'm also just wondering if something is doing this or just a completely crazy idea.

+4
source share
2 answers

The code coverage tool in the JMockit toolkit (which I am developing) provides this feature. You can see it at work in the reach report , which is available online.

Line 72 in the source file OrderRepository.java, for example, on the report page, shows that two tests relate to: OrderFindersTest#findOrderByCustomerand OrderFindersTest#findOrderByNumber.

+1
source

It is easy to do. What you do runs individual tests individually and captures their individual trace information.

-, , , .

. ( , , , ).

, ( -, ?) unit test. , .

( , . ) , , . .

0
source

All Articles