|
|
|
|
|
by gaius
5737 days ago
|
|
The testing infrastructure in perl is _amazing_. It's the best I've used in any language. Well, it has to be, because it's too difficult to second-guess when Perl will DWIM and when it won't. So you have to move a whole lot of complexity out of where it should be, the compiler, and into your own head and your own code. Check out Haskell's QuickCheck for this done right. |
|
I've used Haskell's QuickCheck. Declarative testing is lovely. But it's one particular approach to testing - suitable for finding a class of problems and bugs.
TDD via an xUnit framework is another approach - suitable for finding another class of problems and bugs (after, of course, driving the design - which is it's main purpose).
Style/lint testing is another approach to finding a different class of problems and bugs.
Load testing is another approach to finding a different class of problems and bugs.
The most languages it's an annoying pain to get different kinds of testing framework. TAP and Perl's testing framework makes that really easy.
In Haskell if I want to combine doing TDD with HUnit and declarative testing with QuickCheck - I have to do work to get both frameworks running and integrated at the same time.
In Perl if I want to combine doing TDD with Test::Class and declarative testing with Test::Lectrotest (the QuickCheck style testing library for Perl - http://search.cpan.org/dist/Test-LectroTest) it comes out of the box - because they both output TAP.
I can even interleave declarative styles test inside my xUnit tests - because the both output TAP.
If I discover I need to write some custom test library to poke at some specific corners of my app - I can just output TAP and it's instantly integrated with the rest of my test framework.
Stupidly useful.