So I'm writing my first serious test script for a module I've written, and I'm finding that I'm writing the same code in the test script as I did in the module.
Does this make me a bad person?
I realize that part of the point of a test is just to make sure the module is complete and in good shape. But it seems wrong to use the same logic. For example, in my module I stat a file to see if the permissions are acceptable, and if not, chmod it. So in my test script I create a file with bad permissions, run my module function to fix it, and then use basically the same code as I did in my module to see if the new permissions are acceptable.
I do hope this makes sense. It just seems to me that I'm not testing my logic very well in my test script if I'm using the same logic as I used in the module--of *course* it works great!
Any input would be greatly appreciated!
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.