Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: change perl function in runtime

by ColonelPanic (Friar)
on Dec 03, 2012 at 15:40 UTC ( #1006897=note: print w/ replies, xml ) Need Help??


in reply to Re: change perl function in runtime
in thread change perl function in runtime

I have to disagree with you. This is a perfectly reasonable request. In fact, this is considered a good practice for testing complex software.

There are lots of reasons for doing things like this:

  1. You may not have control over function y
  2. It might do something that you don't want to do during testing (such as submit a credit card order...)
  3. It might take a long time to run.
  4. It might be hard to reproduce certain kinds of output.
  5. It might not be written yet, or it might have bugs of its own (simulating part of the software allows you to develop/test multiple interdependent pieces of code simultaneously).



When's the last time you used duct tape on a duct? --Larry Wall


Comment on Re^2: change perl function in runtime
Re^3: change perl function in runtime
by space_monk (Chaplain) on Dec 03, 2012 at 19:21 UTC
    Thanks for the reasons. I normally suppress things I don't want to do during a test run, but I can see your points :-)
    A Monk aims to give answers to those who have none, and to learn from those who know more.

      Obviously, changing function calls at run time is not the only way to overcome the above problems. The important thing is using good testing principles, rather than a particular implementation.

      I think it is a useful and powerful tool for certain kinds of testing.



      When's the last time you used duct tape on a duct? --Larry Wall

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-04-19 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls