How to avoid writing unit tests
- Use the type system -- compile errors are better than test failures
- Use libraries instead of writing your own code (and having to test it yourself as well).
- Say no to unnecessary features. Be ruthless. Every new feature means more testing.
- Test all the glue with a single integration test. Testing glue with unit tests is a waste of time:
- glue unit tests only ever fail when you're refactoring, so they are all maintenance and no protection
- they are not useful as documentation (there's no point documenting glue)
- This does NOT apply to unit tests for business logic (as opposed to glue)
- Write simpler code.
No comments:
Post a Comment