Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Think about Loose Coupling
 
PerlMonks  

Unit tests as Clue stick

by dws (Chancellor)
on Jan 09, 2001 at 23:26 UTC ( #50739=note: print w/ replies, xml ) Need Help??


in reply to Extreme programming... in perl?

The other benefit of having good test coverage through unit tests: they can give you a whack with the clue stick, and tell you when not to be programming.

On a two hour layover between flights earlier this year I fired up the laptop to get in a bit of coding time, and to try out some ideas I'd had on the first leg of the trip. After about 20 minutes of typing, I fired off my test driver, which at the time would run through about 40 test scripts, reporting whether each passed, failed, or failed to run. (Each test script covered several tests; giving an effective coverage of about 120 tests.)

16 of the 40 tests failed.

Pause... Think...

Hm.. I hadn't eaten in a while, had just gotten off a bumpy flight, and was anxious about the weather on the next leg. Plus I'm sitting on the floor of the terminal in San Diego at one of the two available AC outlets, the place is packed with travelers, and kids are crying. Maybe this isn't the best time to be coding... If I keep going, I'm just going to add a bunch of bugs that I'll feel compelled to fix on the next flight, at altitude, where the air is a bit thinner and my brain won't be working as well.

Back out the changes, shut down the laptop, and trundle off in search of food.


Comment on Unit tests as Clue stick

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-04-19 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (480 votes), past polls