Android ਕਈ ਜਾਂਚ ਦੀਆਂ ਕਿਸਮਾਂ ਦਾ ਸਮਰਥਨ ਕਰਦਾ ਹੈ — unit tests (logic, JVM ਤੇ ਚਲਦੀਆਂ ਹਨ), instrumented tests (device/emulator ਤੇ ਚਲਦੀਆਂ ਹਨ, Espresso ਦੇ ਨਾਲ UI tests ਸ਼ਾਮਲ ਹਨ), ਅਤੇ ਹੋਰ ਬਹੁਤ ਕੁਝ। ਇੱਕ ਚੰਗੀ ਜਾਂਚ ਦੀ ਰਣਨੀਤੀ ਨਿਰਭਰਯੋਗਤਾ ਅਤੇ ਆਤਮ-ਵਿਸ਼ਵਾਸ ਵਿੱਚ ਸੁਧਾਰ ਲਿਆਉਂਦੀ ਹੈ।
Test ਦੀਆਂ ਕਿਸਮਾਂ
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
