in reply to Re^4: Cleaning up unused subroutines
in thread Cleaning up unused subroutines

foo() may or may not be called, depending on @ARGV.

Better. A clear example rather than oblique allusions.

The only way to really do this was covered earlier: with a comprehensive test suite and gradual code modification.

And how do you test that your test suite is comprehensive?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^6: Cleaning up unused subroutines
by Somni (Friar) on Oct 26, 2007 at 13:03 UTC
    And how do you test that your test suite is comprehensive?

    With code coverage checks, such as Devel::Cover.

        Coverage checks are intended to determine how much of your code is exercised by your test suite. The basic presumption is that your test suite should call everything. If something is missed it's an indication that your test suite either needs more tests, or you have functions you aren't using.

        This differs from checking for unused functions by a chunk of code. A chunk of code, be it a script or a module, is not necessarily supposed to call every function possible on any given execution.

Re^6: Cleaning up unused subroutines
by blazar (Canon) on Oct 27, 2007 at 12:23 UTC