Android کئی قسم کی ٹیسٹنگ کو سپورٹ کرتا ہے — unit tests (منطق، JVM پر چلتے ہیں)، instrumented tests (ڈیوائس/emulator پر چلتے ہیں، Espresso کے ساتھ UI 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
