Typical code coverage tools give you line and path coverage information (which is certainly helpful depending on how you examine the data); however, what most tools don’t covey is directness. That is, what was the distance from the test to a particular path?– the thinking being that the closer the test, the more reliable the quality of that test. If method doOrder is 5 paths of indirection away from a test, then one could infer that this particular method may require better testing.
Project PEA is a code coverage tool that’ll monitor your JUnit tests in an attempt to gather call stacks so as to give you an idea of indirection– with PEA you can ascertain how well a particular test actually verifies say, that doOrder method.
For more information, check out PEA or view a powerpoint presentation that Matt Harrah put together explaining it.

April 19th, 2008 at 2:26 am
[…] Andy wrote an interesting post today on Fine grained code coverageHere’s a quick excerptTypical code coverage tools give you line and path coverage information (which is certainly helpful depending on how you examine the data); however, what most tools don’t covey is directness. That is, what was the distance from the test … […]