Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Writing unit test scripts for .pl scripts

by Anonymous Monk
on May 04, 2008 at 13:10 UTC ( [id://684416]=note: print w/replies, xml ) Need Help??


in reply to Re: Writing unit test scripts for .pl scripts
in thread Writing unit test scripts for .pl scripts

Yes, talking about testing the perl scripts using Test::Simple or Test::More.

Replies are listed 'Best First'.
Re^3: Writing unit test scripts for .pl scripts
by talexb (Chancellor) on May 04, 2008 at 13:40 UTC

    Ok then -- start writing tests. You'll need to set up either a test database, with the same schema as your Production database, or perhaps use something like DBD::Mock to provide canned responses for particular queries.

    Just go ahead and read the documentation on either of those Test module and come back with any questions you have. Good luck!

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      ...come back with any questions...
      I have one. :-)

      How do you test scripts (i.e. not a module)? The OP may not be able or want to change the scripts. The scripts may or may not be interactive, they may or may not need arguments supplied etc.

      Any tips on where to start looking? Is there something like Test::Expect for non-interactive scripts?

      update: tried to straighten out the grammer

          How do you test scripts (i.e. not a module)? The OP may not be able or want to change the scripts. The scripts may or may not be interactive, they may or may not need arguments supplied etc.

        Those are great questions, and I'm hoping the OP can tell us more about their situation.

        So far, the only thing I know about these scripts is that they access a database and that the code is a little crufty. Apart from that, I know nothing.

        I don't know if these scripts are web-based or if they're command-line based. I don't know if the scripts are batch or interactive. I don't know what platform is involved, and I don't know what the database is.

        Therefore, I've tried to make my answers as useful as possible, while also being as generic as possible.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-03-28 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found