1. Unit — functions in isolation
Test a single function with mocked collaborators. Milliseconds per test.
Speed
< 10 ms per test; 1000 tests in 10 s
What it catches
Pure functions, business rules, parsers, validators, state machines — anything that's a self-contained transformation.
When to reach for it: Base layer. For every new function with branching logic, add unit tests BEFORE moving higher. 60-70 % of all tests should live here.
Smell: Mocking 5+ collaborators to test one function = the function has too many responsibilities. Split it before adding more mocks.