Joe Strout wrote:
I'd rather risk something that
breaks the code in an obvious way during development, than risk
something that breaks it in a subtle way and is more likely to be
discovered by the end-user.
breaks the code in an obvious way during development, than risk
something that breaks it in a subtle way and is more likely to be
discovered by the end-user.
going to make much difference to the proportion of bugs that
slip through testing.
Your test suite still has to be comprehensive enough to
trigger the assignment of the erroneous object. If it's
not, your assertions won't catch anything. If it is, then
you would have found out during testing in any case.
It might be more difficult to *fix* the problem without
the assertions, but you will still catch it.
--
Greg
Leave a comment: