Tests Are Divine
One of the first posts on my old journal (which I still don't know if I want to copy the entries here) was entitled Tests are Heavenly. In that post I wrote about how I started adopting TDD for administration purposes.
Recently I've been getting CPANTS reports (<3 CPANTS!) on my WWW::FMyLife module. At first I thought my tests were off. Yesterday I finally got down to take a closer look at the reports and code. I tried some variable dumps (my favorite debugging method) of the data I was receiving from FMyLife.com in the module. Then I noticed that FMyLife were sending me different data than they are suppose to. They aren't following their API correctly.
Testing helped me realize it, and be able to fend against it, if I wanted to. That's pretty awesome. I'm assuming a lot of applications out there (mine is only a module, and still in the works) don't really know they're receiving improper structure at times (which might actually screw things up). I, on the other hand, already know this (just by the automated testing) and already fixed it.
Testing sure is awesome! :)
A note:
The editor in blogs.perl.org (MT) sure would be cool if there was a link button that links to modules on CPAN. Can't be difficult to add. I'm willing to do it.
Further note:
Apologies for David Golden for confusing him with David Cross. Two Davids, both cool, it was bound to happen. :)
Do you actually write tests before you write code?
I'm also an enthusiastic tester as an examination of my CPAN directory will reveal, but I almost always write them after the fact. I think the reason is that I've always been more of a head-first programmer; I like to jump into problems and start solving them right away, even when I don't have a clear picture of the solution yet. So I can't write tests beforehand, because I don't know what I'm testing until it's done.
Do you actually write tests before you write code?
I'm also an enthusiastic tester as an examination of my CPAN directory will reveal, but I almost always write them after the fact. I think the reason is that I've always been more of a head-first programmer; I like to jump into problems and start solving them right away, even when I don't have a clear picture of the solution yet. So I can't write tests beforehand, because I don't know what I'm testing until it's done.
Are you sure you meant CPANTS reports? As far as I known CPANTS doesn't send any reports. However, I'm guessing you mean CPAN Testers, for which I do send out summary reports daily (, weekly, monthly) as well as individual reports, which authors can fine tune on the CPAN Testers Preferences site :)
Are you sure you meant CPANTS reports? As far as I known CPANTS doesn't send any reports. However, I'm guessing you mean CPAN Testers, for which I do send out summary reports daily (, weekly, monthly) as well as individual reports, which authors can fine tune on the CPAN Testers Preferences site :)