[Raleigh-talk] Testing

Michael Peters mpeters at plusthree.com
Wed Feb 4 12:57:00 PST 2009


Nathan L. Walls wrote:

> We've used Test::Unit, but consensus is there's too little benefit for 
> creating/running harnesses for Test::Unit vs. using prove.

Yeah, Test::Unit is a dead project. The Perl world is pretty heavily in bed with TAP 
(http://en.wikipedia.org/wiki/Test_Anything_Protocol) which is fine by me. Instead of the harness 
running the tests directly, it's a protocol which allows the tests and the harness to communicate 
about what happened. It's a nice decoupling because it means you can test other things besides just 
Perl scripts, like a web API or a database (there's pgTAP for PostgreSQL).

If you want the same basic organization of xUnit style tests, I'd recommend Test::Class. It gives 
you the same setup/teardown/, startup/shutdown hooks as well as letting you group related tests into 
methods. And it outputs TAP so it works with the rest of the Perl testing infrastructure.

-- 
Michael Peters
Plus Three, LP



More information about the Raleigh-talk mailing list