http://qs1969.pair.com?node_id=606591


in reply to Re^2: When 100% Code Coverage Backfires
in thread When 100% Code Coverage Backfires

++

I just removed some dead code earlier today that the code coverage spotted. It was along the lines of the following:

sub foo { # bunch of code if ( $some_condition ) { # do a bunch of stuff return $something; } else { # do some other stuff croak($error); } # do some more stuff }

That can be easy to miss in refactoring.

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re^4: When 100% Code Coverage Backfires
by adrianh (Chancellor) on Mar 26, 2007 at 15:33 UTC
    I just removed some dead code earlier today that the code coverage spotted.

    Ah the joys of legacy code :-)

    I've found code coverage to be a great exploratory tool. Want to know how your application does something - just write an end-to-end test and look at the test coverage. Much easier way of getting an overview than messing around the debugger.

    Informative too ("look - that critical bit of code doesn't touch the logging module. Ooops.")