Testing Setup
Analyze and create a testing strategy for Android apps - install testing libraries, set...
Install
npx skills add android/skills --skill testing-setup -g -a claude-code -y- Repository
- android/skills10.2k
- Category
- Design
- Updated
- 6d ago
- License
- Complete terms in LICENSE.txt
- Context cost
- Mediumabout 2,452 tokens
- Runs scripts
- No, instructions only
What it does
Analyze and create a testing strategy for Android apps - install testing libraries, set up test infrastructure, create harnesses for unit tests, UI tests, screenshot tests, and end-to-end tests.
Step 1: Analyze the current testing setup
To understand the testing setup of an existing project, look for these dependencies in the libs.versions.toml file, or build files:
- Dependency Injection framework used. For example, Hilt, Koin, Anvil, or vanilla Dagger.
- Unit (local) testing framework this project uses. For example, JUnit4 or JUnit5.
- Mocking framework (if any) used for unit tests, and for instrumented and UI tests. For example, Mockito or Mockk.
- Robolectric. Identify which of these three uses apply:
- Used in unit tests to have fakes for platform entities
- To run behavior UI tests without a device or emulator. For example, used to run Espresso or Compose tests.
- To do screenshot testing with Roborazzi
- Is the app 100% Compose, Views or hybrid?
- Behavior UI tests:
- Compose Tests (
androidx.compose.ui:ui-test-*) - Espresso Tests for Views. Check for wrappers such as Kaspresso. Dependencies:
androidx.test.espresso:espresso-core,androidx.test:runner,androidx.test:rules.
- Compose Tests (
- Screenshot tests. Identify which of these types the project uses:
- Instrumented (device-based). For example, using Dropshots.
- Based on Robolectric, so they run locally. For example, using Roborazzi.
- Based on LayoutLib, so they run locally. For example, Paparazzi, or the Compose Preview Screenshot Testing tool.
- End to end tests (also known as Release Candidate tests) always run on device and use high-level frameworks such as UIAutomator, Appium, or Robotium.
- Generate a Markdown report with the analysis
Step 2: Set up Dependency Injection frameworks for testing
If there is no Dependency Injection framework, install one: if it's a multiplatform application, ask the user whether they want to install Koin, or kotlin-inject. If it's not multiplatform, install Hilt.
Install the testing dependencies (for example com.google.dagger:hilt-compiler
that should be applied with a kspAndroidTest configuration).


