Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: How to Ask a Question (With Test::More)

by CharlesClarkson (Curate)
on Oct 20, 2005 at 10:36 UTC ( #501606=note: print w/replies, xml ) Need Help??

in reply to How to Ask a Question (With Test::More)

  1.  everything after the __DATA_ line.~

    Should read:

     everything after the __DATA__ line below.~

    Perhaps it should read like this, but it may also confuse.

     everything after the __DATA__ (or __END__) line below.~
  2. I don't understand which part of this is template and which is your comment. In fact, I'm not sure I even understand the comment.

    #~convenient way to structure your input and expected output, #assuming that you can use whitespace as the delimiter.

    I think you meant to do this.

    #~convenient way to structure your input and expected output,~ #~assuming that you can use whitespace as the delimiter.~

    But that still sounds like I (the newbie) cannot use this method on pipe delimited data. I (the advanced beginner) realize you don't mean that, but you need to put yourself in your student's heads. The student sees this example and wonders how they can adapt there script to look like this one. "But wait," they think, "I don't have a script which opens a file."

    You haven't explained to them how to use Test::More. You have not shown them how to test their data with test cases and you haven't showed them what your example script looked like before you started testing.

  3. Have you read the Test::More docs recently?

    STOP! If you're just getting started writing tests, have a look at Test::Simple first. This is a drop in replacement for Test::Simple which you can switch to once you get the hang of basic testing.

    So, here is our lowly newbie taking the high road and looking for some clue on how to ask questions before posting to Perl Monks. She sees your tutorial and starts reading. She gets to the module you want her to use and thinks: "I have no clue how to use a module. And just where in blazes is the is() subroutine coming from?" Let me go read the Test::More docs and (wham!), she finds she now must go learn yet another module (actually two more modules-see below).

    There's just too many points at which she can bail out and ask her question anonymously or worse, not ask any question at all. Just giving up on Perl altogether.

    I would gently introduce the reader to the Test::More module and then show the reader templates for asking questions. Perhaps their question will be answered in the test setup. Perhaps not. Either way, they now have another tool for solving their future perl problems.

    Oh and BTW, the Test::Simple module begins with ** If you are unfamiliar with testing read Test::Tutorial first! ** Test::Tutorial is part of a module's (Test::Simple) documentation. Which means can't find it (and it isn't linked from the module docs). Heck, I'm ready to bolt! It's like you had to throw this tutorial together on a deadline.

  4. I associate a template with a fancy (or plain) fill in the blank form. I am asked questions and the answers are entered into the template. Then some magic happens and my question is ready to be asked. I don't see that association from your template.

I guess I'm saying (as gently as possible) that you need to be a bit more long winded. Explain each step to the student. Don't assume she already knows Test::More and Test::Simple and Test::Tutorial and how to find the docs for further reading. Assume she has no freaking clue how to properly ask a question on Perl monks and assume she is ready to bolt from your class for the slimmest reasons.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://501606]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2017-09-25 04:44 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (276 votes). Check out past polls.