android-testing
Android Testing
Overview
Android-specific testing patterns on a test-first foundation.
Test-first foundation:
- No production code without a failing test first. Write the test, watch it fail (RED), write the minimal code to pass (GREEN), then refactor. A behaviour you never watched fail isn't proven.
- A bug isn't fixed until a test that was red because of the bug is green.
This skill adds Android context on top of that cycle; it doesn't replace it. Optional: if you run a dedicated test-first discipline skill (e.g. superpowers:test-driven-development or ace:test-driven-development), this layers on top of it — but it requires none.
Greenfield setup: This skill teaches the practice of writing tests once the stack is in place — TDD loop, fake-first strategy, three-tier model, semantics matchers. For bootstrapping the testing stack from scratch (DI for tests, JUnit/Robolectric/Roborazzi/Paparazzi selection, instrumented test runner configuration, Compose Preview Screenshot Testing, end-to-end with UI Automator, Jacoco coverage), see Google's official testing-setup skill (android skills list to check for a local install; android skills add testing-setup otherwise). The two are complementary.
Android's Three Testing Tiers
Choose the lowest tier that can meaningfully test the behaviour: