Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Care you lend me your widsom? And your eyes, too?

by stvn (Monsignor)
on Sep 14, 2004 at 14:40 UTC ( [id://390856]=note: print w/replies, xml ) Need Help??


in reply to RFC: Tutorial on Testing

To start out, let me say that I was very excitied to see Test::LectroTest come out on CPAN, I have recently stumbled onto specification based testing myself (see here for my rant on the subject). So I am looking forward to experimenting with your module myself.

One thing I would like to see in your tutorial, is more information about how to test with input other than integers. In my node on this subject, I showed a specification based test for a list, how would I do something like that with Test::LectroTest? Can I feed it a sampling of string data, which can be randomized/shuffled in some way? Nested lists? (I see in Test::LectroTest::Generator where I would find some of this info, but it would still be nice in tutorial form)

I would also like to see how to make more complex data-structures (structure being the key word there). For instance, I have a module Tree::Binary which I actually tried to do some specification based testing with (see the file 50_Tree_Binary_Theorem_Proofs_test.t for details). How would I go about using Test::LectroTest to create the random binary trees? Can I create a custom generator with Test::LectroTest? If so, how could I got about it?

I know some of these things I am talking about are more advanced uses of your module, but to be honest, I think your module really is going to appeal to a crowd which is likely to use those features. Specification based testing is not a beginners subject, and IMO has a somewhat steep learning curve (at least for us non-math/CS majors out here). I would suggest keeping that in mind and not be afraid to write the more advanced stuff.

-stvn
  • Comment on Re: Care you lend me your widsom? And your eyes, too?

Replies are listed 'Best First'.
Thanks for your feedback!
by tmoertel (Chaplain) on Sep 14, 2004 at 15:01 UTC
    I am looking forward to experimenting with your module myself.
    Great! Please let me know if you have any suggestions or criticisms. (You might also want to check the TODO and see what's already in the pipeline.)
    One thing I would like to see in your tutorial, is more information about how to test with input other than integers. In my node on this subject, I showed a specification based test for a list, how would I do something like that with Test::LectroTest? Can I feed it a sampling of string data, which can be randomized/shuffled in some way? Nested lists?
    That's a good idea. You can do all of those things with LectroTest, but the tutorial doesn't even hint at it. In the Generator docs, as you mention, I give some examples of list-of-list and of tree building, and in my "Free Unit Tests In Perl with LectroTest" talk for the festive Pittsburgh Perl Mongers, I showed how to build RFC 2822–compliant email addresses. You're right, I ought to cover this in the tutorial. Even if for compactness reasons I can't add a full-blown example of these uses, at least I can mention them in passing and provide pointers to relevant portions of other docs.

    Thanks again for your feedback.

      Even if for compactness reasons I can't add a full-blown example of these uses, at least I can mention them in passing and provide pointers to relevant portions of other docs.

      You might consider 2 tutorials (if you have time of course). A gentle introduction is nice, but a "jump right in the deep end" would also be nice too. I would even be happy to help out once I get my head around your module more.

      Thanks again for your feedback.

      No problem, thanks for the module, you saved me from writing it :)

      -stvn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://390856]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (None)
    As of 2024-04-18 23:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found