https://developer.android.com/agents/skills/testing/testing-setup/skill

Audit Android project dependencies and configure testing frameworks.

5|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/fornewid/android-developers-changelog --skill https-developer-android-com-agents-skills-testing-testing-setup-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: https://developer.android.com/agents/skills/testing/testing-setup/skill
Source: https://github.com/fornewid/android-developers-changelog/tree/main/docs/agents/skills/testing/testing-setup
Command: npx skills add https://github.com/fornewid/android-developers-changelog --skill https-developer-android-com-agents-skills-testing-testing-setup-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you inventory an existing Android project's testing setup and then systematically add or improve the missing frameworks, rules, test structure, and screenshot/behavior/E2E coverage so your tests are consistent and maintainable.

Core Features & Use Cases

  • Analyze the current testing stack by inspecting dependency declarations (e.g., libs.versions.toml and Gradle files) to identify DI, unit/UI/instrumented testing, mocking, Robolectric, and screenshot tooling.
  • Install and configure test frameworks for local unit tests, instrumented tests, UI tests, screenshot tests, and end-to-end testing based on what the app uses (Compose, Views, or hybrid) and what test types are requested.
  • Refactor for testability using fakes and dependency injection to isolate Android dependencies and improve speed/reliability of UI behavior and scenario testing.
  • Create the right kinds of tests across business logic unit tests, UI behavior tests (Compose semantics/testTags or Espresso interactions), navigation tests, database tests (in-memory with SQLite), screenshot coverage, and a small set of end-to-end journeys.
  • Validate test execution context by placing UI tests in the correct sourcesets (test vs androidTest) so Robolectric and instrumented runs behave as intended.

Quick Start

Tell the assistant what testing frameworks and UI approach (Compose, Views, or hybrid) your project uses, and ask it to generate a Markdown report of the current testing setup analysis and the recommended setup changes.

Frequently Asked Questions about https://developer.android.com/agents/skills/testing/testing-setup/skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a complete Android testing strategy with Robolectric and instrumented tests?

Android testing setup requires auditing dependencies and build configurations to install local unit, Robolectric, instrumented, and screenshot testing frameworks. This ensures tests are correctly organized into appropriate sourcesets for consistent execution.

What's the best way to organize UI tests across test and androidTest sourcesets?

Organizing UI tests across sourcesets requires validating the test execution context by placing Robolectric-driven tests in the test sourceset and instrumented tests in androidTest. This separation ensures tests run in the correct environment with proper test runners and rules.

How do I add screenshot testing for Jetpack Compose previews in an existing Android project?

Adding screenshot testing for Compose previews involves inspecting your dependency declarations like libs.versions.toml to install and configure screenshot testing tooling. The setup validates Compose preview capture and device screenshot execution within the correct sourcesets.

Can I use fakes and dependency injection to refactor Android code for testability?

Yes, you can refactor for testability using fakes and dependency injection to isolate Android dependencies. This refactoring improves the speed and reliability of UI behavior and scenario testing by allowing frameworks to mock or replace external interactions.

Does Robolectric work for end-to-end and database testing in Android?

Robolectric supports local UI behavior tests and database tests using in-memory SQLite, while end-to-end release-candidate coverage requires a small set of instrumented tests. The setup process identifies the appropriate Robolectric approach selection based on requested test types.

When do I need to update my Android testing dependencies in libs.versions.toml?

You need to update Android testing dependencies when auditing your testing stack reveals missing frameworks for local unit tests, UI tests, instrumented tests, mocking, or screenshot tooling. The setup systematically adds or improves missing rules and test structures for maintainability.