Topic
2 replies Latest Post - ‏2007-04-13T00:17:39Z by SystemAdmin
SystemAdmin
SystemAdmin
210 Posts
ACCEPTED ANSWER

Pinned topic Code Coverage Metrics for unit v's functional testing.

‏2007-04-12T02:15:08Z |

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?

Sincerely,
Shane Paterson.
Updated on 2007-04-13T00:17:39Z at 2007-04-13T00:17:39Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    210 Posts
    ACCEPTED ANSWER

    Re: Code Coverage Metrics for unit v's functional testing.

    ‏2007-04-12T03:15:40Z  in response to SystemAdmin
    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.
  • SystemAdmin
    SystemAdmin
    210 Posts
    ACCEPTED ANSWER

    Re: Code Coverage Metrics for unit v's functional testing.

    ‏2007-04-13T00:17:39Z  in response to SystemAdmin
    Thanks for the quick reply. I'll give it a go.