Test individual functions and classes in isolation — fast feedback, high confidence, and living documentation.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
Unit tests verify the smallest testable parts of an application in isolation. They should be fast, deterministic, and independent. Frameworks include Jest, Vitest, xUnit, and pytest. Good unit tests act as documentation, catch regressions, and enable refactoring with confidence. The key is testing behavior, not implementation.