- soloner@lemmy.world5·1 year ago
- TDD (red-green-refactor)
- Dependency injection
- Focusing/skipping tests
- Minimize stubbing (only stub when you have to, and stub closest to the edge of the system)
- Use rollback or other data cleanup strategy. Ensure tests don’t leave data leftovers.
- Test the behavior, not the implementation. Don’t stub and spy so much that refractors to the source code with an equivalent implementation break the test or require extensive refractors to pass again.