Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: When test-driven development just won't do

by tlm (Prior)
on Aug 04, 2005 at 12:38 UTC ( #480798=note: print w/ replies, xml ) Need Help??


in reply to Re: When test-driven development just won't do
in thread When test-driven development just won't do

For instance, how do you write a test that tests your objects ... timely destruct?

How about (untested):

{ package CrashDummy; @CrashDummy::ISA = 'MyPrecious'; *ok = \&Test::More::ok; my $counter = 0; sub DESTROY { Test::More::ok( ++$counter == 2, 'DESTROY called' ); $_[ 0 ]->SUPER::DESTROY; } { my $dummy = bless +{}, __PACKAGE__; ok( ++$counter == 1, 'inner scope' ); } ok( ++$counter == 3, 'expected execution order' ); }
?

How do you test your shuffling or die rolling technique is fair and produces results according to your specifications (say, according to a Gaussing distribution), and isn't biased favouring certain outcomes?

There are a bazillion statistical tests to compare sampled distributions. I'm surprised none of these would meet your needs.

the lowliest monk


Comment on Re^2: When test-driven development just won't do
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2015-07-31 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls