Ovid,

I second that complaint against JUnit. I recently have been doing some Java work and found it somewhat frustrating that when my test failed I had to read line numbers and hunt around, etc etc etc. I have gotten so used to my test comment not only pointing me right to the failed test, but telling me what happened even before I looked at the code itself.

That said, I also think I am going to start looking at Test::Class for my perl testing as I find I am starting to like the whole xUnit approach.

Steve

On Dec 2, 2004, at 12:14 PM, <[EMAIL PROTECTED]> wrote:

--- Andy Lester <[EMAIL PROTECTED]> wrote:
I have a modest proposal.
Stop calling the 2nd parm to ok() the "name".  It's really a comment.

ok( $is_happy, "Make sure the doodad is wingoed" );

Hmm ... I like this idea, though I confess that I don't like that the comment is optional. While I've finally decided that I prefer an xUnit framework (e.g., Test::Class) to Test::More, one of the strongest benefits to Test::More is the comment on most tests.

As an example of where Test::More is beneficial:  in jUnit you might
have a method testing whether you can clone a customer and in that test
you notice that the code does not copy the customer's social security
number.  This might be a bug and it might be a feature.  Who knows?
Little details like that tend to get lost in the xUnit world.  With
Test::More (and Test::Class, since it's a wrapper around Test::More),
you're more likely to have a detailed comment explaining those
nit-picky details.  Thus, while I realize that few would agree with
making comments mandatory -- use strict 'tests'? :) -- I would suggest
that we ignore them at our peril.  I've done enough xUnit tests to miss
that feature of Test::More.

Cheers,
Ovid

=====
Silence is Evil http://users.easystreet.com/ovid/philosophy/decency.html
Ovid http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/





Reply via email to