Enhedstestning verificerer individuelle enheder af kode (funktioner, metoder, klasser) i isolation — kontrollerer, at hver lille del fungerer korrekt på egen hånd. Enhedstests er hurtige, fokuserede og danner grundlaget for en god teststrategi.
Hvad en enhedstest er
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
