Before I started using rails, I never really was one to write unit
tests or any types of test suites really. The more I’ve been using
rails the more I started to write bigger and more comprehensive test
suites (since it is so easy to do it with the rails framework). I
pretty much picked up all my test writing habits as I wrote my tests
this past year. I never looked into any tips, advice, or instruction
on how to write good test suites.
So, I was wondering if anybody could offer any insight, pointers,
links to resources, or anything really that could help me refine my
approach to writing better test suites. How do you look at your
software when you try are writing your test suites (it seems like it
is a bit hard to do so objectively), how do you get good coverage,
what kind of things do you always want to test in a web application,
how do you share the load between unit tests and functional tests (for
example, the unit tests for a Person model would have extensive
validation coverage, but I’m guessing the functional test wouldn’t
need quite the same level of depth).
In short, how do I know if I am writing good tests for my code?