Pinned topic Code Coverage Metrics for unit v's functional testing.
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
My team is currently working on a Legacy code base which has a lot of closely coupled code, primarily driven by an over-use of singletons and DAOs bound directly to Hibernate Entities. The main problem introduced is that the unit tests have to have a LOT of setup code. Also, the majority of the resulting tests are effectively functional tests, which have many potential points of failure beyond the scope of the unit being tested.
If I run code coverage stats on my code base, it looks very farourable. However, I suspect that the majority of the code base is being exercised primarily by large grained business methods, and not by unit tests close to the target unit.
I am basically looking for some code coverage metric which will tell me how much of my code base is directly covered by unit test e.g. 1 degree of separation from the target unit and the unit test.
Can anyone point me in the direction of a such a code coverage metric?
Updated on 2007-04-13T00:17:39Z at 2007-04-13T00:17:39Z by SystemAdmin
Re: Code Coverage Metrics for unit v's functional testing.2007-04-12T03:15:40ZThis is the accepted answer. This is the accepted answer.There is a tool which aims to do this-- it's called NoUnit (http://nounit.sourceforge.net/); however, it hasn't seen many updates in a bit. I have used it in the past to gather metrics much like you've outlined here.