NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Specification- and Test-Driven Development (Score:1)
Several years ago I gave a talk to New Orleans Perlmongers on writing a module in the CPAN style. As a gag, I said, "First you write your documentation, then you write your tests, and only then do you write your code."
It was a gag then, but over the next couple of years I began to wonder, "What if I really did write my documentation first?" I.e., what if I wrote myself a specification first.
I tried it and I liked it. With practice, I was able to write 80% of the POD for a module before writing a single line of code. As you discovered, it forced me to think about the interface very early on in the process.
The experience you describe is one I have had repeatedly since I started writing in a more specification-driven and test-driven manner. Thanks for sharing it.
Reply to This
Re: (Score:1)