http://www.perlmonks.org?node_id=859023


in reply to How do you test end-user scripts?

I endorse chromatic's comment. When writing scripts, I typically abstract the work they do into CPAN-like modules and unit test each module using Test::More and the prove command. I strive to keep my script mainlines as short as is practicable. There are many examples of this approach on the CPAN; see, for example, the perltidy command, part of the Perl-Tidy distribution and the perlcritic command, part of the Perl-Critic distribution.

See also: Effective Perl Programming, 2nd edition: Item 91, "Write programs as modulinos for easy testing"

Replies are listed 'Best First'.
Re^2: How do you test end-user scripts?
by JavaFan (Canon) on Sep 07, 2010 at 12:08 UTC
    I claim that isn't enough.

    If you bring in your car in, would you be satisfied if they just tested the battery, the steering, the transmission, etc, but never actually tried to drive the car and see if it runs? All individual components of you car may work according to the spec, but if they aren't connected correctly, you will still have to walk.

    Heck, for complete products, I'd say testing the final product is way more important than any unit testing.