Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've read lots of tutorials and various praises for the "Testing Paradign" and the thought of having hundreds of test I could just instantly run to tell me if my change affected anything fills me with glee, but I Just Don't Get It.

I understand the basic concept of testing, I think, and I can easily apply it to the examples they use in a text book: ok(add(2,2),4); or whatever simple ass method you're testing. My problems comes when I try to extend/abstract the idea.

For example, something I've been working on now is a web application for manipulating a specific type of server. I have no bloody idea how to write tests for it. Sure I could test some of the classes that it uses and so forth, but how do I test the application it self? Print out the html and grep it for some specific phrase? What if I change the html, it's just the display layer isn't it? Do I use a dumper to dump the actual variables I'm passing to the template? Isn't that looking at the implementation?

I'm just confused, I guess what I'm really looking for is "real world" examples of tests for complex things, things you can't just test by calling a function and comparing it's output to a constant.

Updated: Changed the "can" to a "can't" in that last line.

In reply to Yet another meditation on testing by BUU

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (7)
    As of 2021-03-04 12:42 GMT
    Find Nodes?
      Voting Booth?
      My favorite kind of desktop background is:

      Results (104 votes). Check out past polls.