Testing Questions

Nicholas Clark nick at ccl4.org
Mon May 14 23:23:06 BST 2007

On Mon, May 14, 2007 at 02:08:38PM +0100, Andy Armstrong wrote:

> I guess the first step to that is to make your tests as data-driven  
> as possible. I'll typically have a big array called @schedule or  
> somesuch - full of test cases and a little bit of code that chugs  
> through them all. If you can add tests without writing any more test  
> *code* that'd be a good sign.
> Once you're doing that it's much easier to generate tests from  
> whatever reference material you have.

I'm always surprised that so few people seem to do this. Often people I work
with write tests, and each is/like/... runs once. I like putting them in
loops or subroutines and feeding them data until they refuse even a wafeur
thin mint. Having this style of battery of tests has often exposed unexpected
corner cases due to the range of data tried.

Nicholas Clark

More information about the london.pm mailing list