Android suporton disa lloje testesh — teste njësi (logjika, ekzekutohen në JVM), teste të instrumentuara (ekzekutohen në një pajisje/emulator, duke përfshirë teste UI me Espresso), dhe të tjera. Një strategi e mirë testimi përmirëson besueshmërinë dhe besimin.
Llojet e testeve
UNIT TESTS (local, on the JVM) → test logic (ViewModels, repositories, utilities):
→ fast (no device); use JUnit, Mockito/MockK (mocking), no Android framework needed
→ for business logic, data processing, ViewModels
INSTRUMENTED TESTS (on a device/emulator) → test code needing the Android framework:
→ UI tests (ESPRESSO — interact with and verify the UI), integration tests
→ slower (real device/emulator) but test real Android behavior
