Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: Universal test flag

by bulk88 (Priest)
on Jul 17, 2012 at 15:19 UTC ( #982261=note: print w/replies, xml ) Need Help??

in reply to Re^2: Universal test flag
in thread Universal test flag

I dont see Using Test-Point Callbacks for Automated Diagnostics in Testing as being any more efficient than a print statement since multiple arguments of lexicals are still evaluated and copied if the branch is taken and those instructions will not be removed, although they wont execute, with debugging mode off. The only advantage I see of Using Test-Point Callbacks for Automated Diagnostics in Testing is that errors can be discovered automatically with code, rather than the programmer looking for a needle in a haystack wrong value in a mile of debug channel.

Replies are listed 'Best First'.
Re^4: Universal test flag
by ait (Friar) on Jul 17, 2012 at 16:06 UTC

    Exactly! That is precisely the idea: to give a more intelligible diagnostic message instead of having to go through millions of debug messages.

    Whilst the general consensus that the smallest testable unit is a sub, in many real world applications this is simply not the case. A lot of business code has a lot of state data shared in long subroutines. They are always room for refactoring but in the mean time, you need to provide mechanisms to test this code the best you can.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982261]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2018-04-21 00:50 GMT
Find Nodes?
    Voting Booth?