Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: RFC: Perl Testing -- How to Introduce to a team

by philcrow (Priest)
on Oct 19, 2006 at 13:12 UTC ( #579352=note: print w/replies, xml ) Need Help??

in reply to RFC: Perl Testing -- How to Introduce to a team

The single best thing I learned about testing from Schwern is to make sure that every time someone finds a bug, they write a test to show the bug before they fix it. This works at the beginning of a project if, as you add feature requests to your list, you write tests for them as you write the code to implement them.

Hence, don't get bogged down in thinking about every possible thing you could test, just get started writing some tests and write more for every missing feature or bug.


  • Comment on Re: RFC: Perl Testing -- How to Introduce to a team

Replies are listed 'Best First'.
Re^2: RFC: Perl Testing -- How to Introduce to a team
by NovMonk (Chaplain) on Oct 19, 2006 at 13:40 UTC
    I've been wondering about that--in such a case, do you write a test For the bug (passes if it hits) or For the Solution to the bug? I'm thinking the former, and then just Reverse it when it's fixed (passes when the fixed code runs right.)

    Thanks for the comment.
      I write the test so it fails when the bug exists and keeps failing until I fix it. If you don't want it to show up for some period of time, mark it TODO.


        I want to second this. It's very important to write a test that can replicate the bug before fixing it.


        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2023-11-28 08:50 GMT
Find Nodes?
    Voting Booth?

    No recent polls found