July 2010 Archives

Introducing Catechesis

I love testing. I like to know, to the greatest degree manageable, that the code I have written does what I think it does. I love testing in Perl because there's a selection of tools available which is broad and deep. I wish the implementors of other languages would take a look at the Test:: and Devel:: sections of the CPAN and steal some ideas, really.

Recently I found myself designing a message-passing framework, and I decided that I wanted to at least have Perl 5, ObjC, Python, and Javascript implementations. The arguable sanity and hubris of this aside, it brought up an interesting problem in the domain of testing.

Having been influenced by Perl 6's awesome collection of spectests, I decided that the right thing to do was draft a spec have a suite of tests to go along with it. But then I realized I'd have to rewrite the spectests for every implementation, which, aside from being more work, increased the risk of programming errors in the tests themselves. I realized that if there were a way to write spectests (or API tests, or any other black-box tests) just once, that would eliminate the risk of programming errors in the test suite and eliminate the chance of the spec being interpreted in multiple ways, as the spec test suite would be definitive.

So I wrote Catechesis.

About Shawn Boyette

user-pic Doing weird things with Perl, slowly :)