|Think about Loose Coupling|
Re: Testaholics Anonymous (or how I learned to stop worrying and love Test::More)by hesco (Deacon)
|on Mar 14, 2006 at 09:17 UTC||Need Help??|
All this discussion on redundant tests and test suites that run too long don't (perhaps yet) seem to apply to me.
I'm new to this testing piece, but enthusiastic about what I've been learning.
Tonight, I'm committing my latest project's access control test script which became the subject of two or three questions to the SoPW page and a couple of days of distraction as I did the research to help me understand what it is I was doing. I'm using WWW::Mechanize and testing lots of interactions with the website. As I muddled through the logic of some of the access control rules, I found myself commenting out four of my five test cases from the hash of test cases and two of the three subroutines I processed that test data through. My 168 test suite usually ran only a dozen or so tests each time (except of course that it error'd out after the fifth one a good bit of the day).
But then I had my Eureka moment and made it to the sixth test, and with a little more clean up through the limited number allowed by my commented out logic in the main loop. I deleted my comments and let the whole suite run, not just the latest, but all eight .t files added so far. I didn't mind the wait as 05access_control.t used LWP to exercise the user interface. It put it through its paces. I checked my email, stretched, checked out what was new at perlmonks and finally reviewed the scroll buffer for the ok messages I had missed.
My eight test scripts took six and a half minutes to completely run, to where they error out now. But it was certainly sweet to think, with as much work as still lays ahead, that at least that much of the application is already working.
Me? I look forward to the day when I've added so much functionality to this application that I would have an hour of tests to run to fully exercise it. By then I'm sure that I too will have adopted the practice of cron driven test runs.