in reply to Re^5: Developing a module, how do you do it ?
in thread Developing a module, how do you do it ?
I've seen people go to extraordinary steps to satisfy the coverage tools need to have every code path exercised, even when many of those codepaths are for exceptional conditions that are near impossible to fabricate because they are extremely rare ("exceptional") conditions. Hence you have a raft of Mock-this and Mock-that tools to "simulate" those failures.
I agree, but don't replace crazy with crazy.
Write tests that provide value. Use coverage to see if you've missed anything you care about. Think about what that coverage means (all it tells you is that your test suite somehow executed an expression, not that you tested it exhaustively).
If you're not getting value out of these activities, you're probably doing something wrong. That could mean fragile tests or tests for the wrong thing. That could mean that you have a problem with your design. That could mean too much coupling between tests and code or too little (and too much mocking).
There's no substitute for understanding what you're doing, so understand what you're doing.
(But don't resolve never to use a lathe or a drill press because you heard someone once used one somewhere for eeeeeevil.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Developing a module, how do you do it ?
by BrowserUk (Patriarch) on Mar 03, 2012 at 04:28 UTC |