Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Unit tests as Clue stick by dws
in thread Extreme programming... in perl? by nop

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-12-05 04:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?