David Cantrell wrote:
clearly. So my attempt to make my tests good will mostly consist of applying the same coding standards to the test suites as I do to the rest of the code.

OK, Lazy Web, who's going to write Test::Test::Perl::Critic?

:-)

Any tips on what - other than comprehensiveness, clarity and maintainability - 
I should aim for specifically in test suites would be greatly appreciated.

No claim to best practice here, but this some of what I aim for:

I try to reduce the amount of copy/paste test code I use. Once is OK, but twice makes me start thinking about putting it into a module that I pull in with "use t::Common" or something.

I try to separate my test data from my test code. Many of my test files are data structures of test inputs, outputs, and labels that get processed in a small loop.

I try to have the test labels be self documenting -- I'll often throw in a pass() to help me see the flow of execution when run verbosely

I try to have each test file test a single feature -- with minimal dependencies on other tests being successful (not always possible).

I try to skip subsequent tests that depend on something being successful so the real point of failure is apparent.

Regards,
David

Reply via email to