Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Does anybody write tests first?

by kyle (Abbot)
on Feb 22, 2008 at 04:33 UTC ( #669461=note: print w/replies, xml ) Need Help??


in reply to Does anybody write tests first?

I've had the best luck with writing the synopsis first—the stuff that goes near the top of the POD. This way I get a simple use case from start to finish. Usually that shakes out the knees and elbows of the interface I had in my mind. I can streamline things before I've coded any decisions. Once that looks good, it's pretty easy to translate into test cases.

Replies are listed 'Best First'.
Re^2: Does anybody write tests first?
by doom (Deacon) on Feb 23, 2008 at 04:03 UTC

    I've had the best luck with writing the synopsis first—the stuff that goes near the top of the POD.

    Yes, I was going to say something like that. I don't always write tests first (writing them soon is good enough), but writing (some of) the documentation first is almost always helpful. I find it encourages me to simplify the interface: I get rid of unnecessary options because they're too much of a pain to write about.

    But it sounds like the OP has not yet gotten in the habit of putting almost all of the code into modules, and that's really the first step toward sanity. For one thing, it makes it a lot easier to write fine-grained unit tests.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://669461]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2019-10-18 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?