Android jassuport diversi tipi ta' testing — unit tests (loġika, jirru fuq il-JVM), instrumented tests (jirru fuq device/emulator, inkluż UI tests b'Espresso), u aktar. Strateġija tajba ta' testing itejjeb ir-reliabilità u l-kunfidenza.
Tipi ta' tests
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
