Unit testing verifica singole unità di codice (funzioni, metodi, classi) in isolamento — controllando che ogni piccolo pezzo funzioni correttamente da solo. Gli unit test sono veloci, focalizzati e formano la base di una buona strategia di testing.
Che cos'è un unit test
A UNIT test verifies the smallest testable piece (a function/method) in ISOLATION:
→ test ONE thing; give inputs, check the output/behavior
→ ISOLATED from dependencies (database, network, other units) — mock/stub those
→ FAST (no real I/O), focused, deterministic
