Android testing

From HoangNguyen0403/agent-skills-standard · View interactive version

Android testing is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Write Android unit, Compose UI, and Hilt-integrated tests. Use when designing test behavior with MockK or coroutine test utilities; defer database/WorkManager-specific recipes to the owning feature skill.

How to use this skill

Skill file

Android Testing Standards

**Priority: P0 (CRITICAL)**

Universal anti-slop rules (naming, identity fixtures, tautologies, skip/focus, mock echoing, bug-first lock, sleeps,

shallow assertions, coverage): anti-slop-rules.md. Only Android

deltas follow.

Core Rule Anchors

asserting copies of 30-property state. Under runTest with StandardTestDispatcher, advance virtual time with

advanceUntilIdle() or Turbine before asserting (GUARD-KT-02).

serialization/parsing or error mapping. Ban tests of generated code and trivial getters.

stub-return echoes (GUARD-KT-01: coEvery { dataSource.get() } returns x; repo.get() == x).

behavior. Activity recreation (recreate()) is same-process only; true OS process death requires external device termination

and relaunch.

Implementation Guidelines

Unit Tests

DispatcherProvider rather than reading Dispatchers.Main. Mock with MockK or fakes.

UI Integration Tests (Instrumentation)

@TestInstallIn fakes.

TalkBack focus traversal or audio announcements); verify touch bounds ≥ 48dp.

Anti-Patterns

assertions on uncompleted coroutines without advanceUntilIdle() or Turbine.

timing.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.