Two handy reminders when you are thinking about what to test in your unit tests are:
- Right - Are the results right?
- B - are all the boundary conditions correct?
- I - can you check the inverse relationships?
- C - can you cross-check results using other means?
- E - can you force error conditions to happen?
- P - are performance characteristics within bounds?
- C - Conformance - does the value conform to an expected format?
- O - Ordering - is the set of values ordered or unordered as appropriate?
- R - Range - is the value within reasonable minimum and maximum values?
- R - Reference - does the code reference anything external that isn't under direct control of the code itself?
- E - Existence - does the value exist (e.g. is not null, non-zero, present in a set)?
- C - Cardinality - are there exactly enough values?
- T - Time (absolute and relative) - is everything happening in order? At the right time? In time?