Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Wanted, more simple tutorials on testingby davidrw (Prior) |
on Jul 22, 2005 at 15:28 UTC ( [id://477256]=note: print w/replies, xml ) | Need Help?? |
Basically, I don't want to test for things I know. Yes, you do. The edge/weird/invalid cases all need tests, but so do the standard simple cases. What this coverage (of the simple/known stuff) will do is ensure that the basic blocks don't change behavior. It also provides finer-grained resolution for debugging when tests fail -- for example if a weird edge case starts failing, you're going to assume it's because it's a weird edge case and the edge-case code has a problem, but what if it's because you tweaked a core function and it's just rearing it's head here? Good tests on that core function would point to that immediately. As for your actual test-creation, my first thought is that I'm not sure you need (or want) to use WWW::Mechanize (note also the existence of Test::WWW::Mechanize) .. for one, it requires a web server running and is only needed for testing the gui screen functionality, but here it seems like you really want to get tests down for the back-end functionality. For your actual individual tests, it seems like you need 1) input text 2) if the result against HTML::Lint should be valid or invalid and optionally 3) a string to compare the result against You can set that up in a data structure, and then iterate over it performming the tests...
In Section
Seekers of Perl Wisdom
|
|