- TDD helps drive design through SRP, decoupling, IOC. Adjusting test
to test only one thing pushes scenarios where you might separate
order placement from order validation.
- Can then design and test each independently.
- If it is not valid to have a null reference passed in to a method,
us assert in that method to enforce the precondition rather than placing
asserts in the test.
- only for cases where you have control of the calling code, not for prod
in public API
- if null reference is a valid scenario, have tests for it.
- Tests drive design, different levels of test drive different levels of design.
- Unit
- Integration
- Acceptance
- If the item under test is very complicated and hard to setup, it may be a
code smell that the item under test is too complex. Though, It may also be
legitimately complex.
Comments (0)
You don't have permission to comment on this page.