Unit Testing
- Test at the lowest possible level. A single class or Javascript module.
- Mock dependencies instead of relying on real implementations.
- Include meaningful expectations (asserts) in the tests.
- Test valid as well as invalid inputs
- Where possible test at the interface level so the same test can be used to validate many implementations.