You typically want to test how a user will want to use your library.
You don't want to write tests for internal stuff. If there are a
sequence of interpendent events that need to be tested I tend to
bundle them in an individual test method.

Testing does take time. When you first start writing them it feels
like wasted time. But I've found it's an invaluable tool for figuring
out what your API should look like before you start making it...and
more importantly they serve as a safety net as you refactor stuff
later on. It's very liberating to have a nice test suite that allows
you to go in and monkey with internals, and then run the test suite
afterwards to reassure yourself that things are working properly.

I guess I'm starting to sound religious about this. I'm not a disciple
of extreme programming, but I do think testing is one of the best
things to come out of that methodology.

//Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to