Unit testing memverifikasi unit kode individual (fungsi, method, class) secara terisolasi — memeriksa bahwa setiap bagian kecil bekerja dengan benar pada dirinya sendiri. Unit test cepat, terfokus, dan membentuk fondasi dari strategi pengujian yang baik.
Apa itu 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
