Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How do you test end-user scripts?

by eyepopslikeamosquito (Chancellor)
on Sep 06, 2010 at 08:28 UTC ( #859023=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://859023]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2020-04-03 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (32 votes). Check out past polls.

    Notices?