I've been using a test framework that I wrote (which actually predates
any of the other Test:: modules by 1-2 years) and I finally decided to
rework it as a full-blown module. I was never a fan of the existing
Test:: frameworks because I felt they make it easy to write test
scripts, but the tests are hard to read and use the way I want to.

I use my test scripts in two ways:

1) I use my test scripts to debug my module. When I get a bug report,
I'll add a test case which I know demonstrates a bug to one of the test
scripts, and then I'll debug the test script. Once the module is
debugged, I'll just leave the test case there so (hopefully) the bug
won't come back.

So, in the debugger, I want to be able to trivially do the following:

break at the start of test N

2) Obviously, I use my test scripts to easily see what I'm testing for
and to see if there are any particular combinations of input that I
might need to test for.

In Test::More, a series of tests might look like:

# test 1
$result = func("apples","bushels");
is($result, "enough");

# test 2
$result = func("grapefruit","tons");
is($result, "enough");

# test 3
$result = func("oranges","boatloads");
is($result, "insufficient");

This illustrates both of the missing features I want.

1) If I ran the test and found that test #2 failed, I have to figure out
what line the second call to func is on, run the script in the debugger,
and set a breakpoint there. Not hard... but it breaks the train of
thought, and if instead of 3 tests, there are 300 tests, it might take a
while to figure out where the breakpoint should be.

I much prefer being able to say:

b func ($::TI_NUM == 2)

Additionally, I'd like support for only running a subset of the tests
(one only one specific test), etc. The scripts can also print out more
or less diagnostic information which may reduce the amount of time
needed to debug the problem.

2) Looking at the Test::More script, the script is very simple (thanks
to the very nice Test::More module)... but the TESTS are NOT nice to
read. When I'm working on my test suite, the scripts are almost
completely uninteresting. Once I get it right, it's very likely that
I'll never touch the "script" side of things again, but I may reexamine
the scripts many times (to add new tests, to re-debug one when a new
version of the module breaks something, to examine them in total to see
if there are missing tests). I don't want to write the tests in the form
above (unless that turns out to be the most convenient). I'd prefer to
write the tests in a form in which the tests are very readable, such as:

$tests = "

apples bushels => enough

grapefruit tons => enough

oranges boatloads => insufficient


$o->tests(tests => $tests,
func => \&func);

Now, I can quickly see all of the tests in a simple table that I can
trivially understand. I can also see that I forgot to test for "bunches
of bananas", and add that.

So, I finally got around to reworking my framework into a module that
I'll be releasing to CPAN within a few days... but I'm not sure what to
name it.

I'm currently using "Test::Inter" (i.e. interactive tests), but I'm not
a fan of that name since interactive tests are only one of the features
(and the more readable tests are probably more 'important' to most people).

I could go with "Test::Readable", "Test::Flexible", "Test::Most", ...
but none of them are really grabbing me, so I figured I'd just call for
suggestions and go with whatever is suggested.

The complete POD is here:


Thanks for any suggestions

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupmodules @
postedApr 20, '10 at 1:38p
activeApr 21, '10 at 3:44p

2 users in discussion

Brian d foy: 1 post Sullivan Beck: 1 post



site design / logo © 2021 Grokbase