android-testing-unit
Write fast, focused Android unit tests for reducers, use cases, repositories, and lifecycle-safe state holders.
Works with
--- name: android-testing-unit description: Write fast, focused Android unit tests for reducers, use cases, repositories, and lifecycle-safe state holders. license: MIT --- # Android Testing Unit ## When To Use - Use this skill when the request is about: android unit test strategy, test viewmodel reducer android, repository unit tests android. - Primary outcome: Write fast, focused Android unit tests for reducers, use cases, repositories, and lifecycle-safe state holders. - Handoff skills when the scope expands: - `android-testing-ui` - `android-ui-states-validation` ## Workflow 1. Scope the risk surface: correctness, security, performance, test depth, or release automation. 2. Pick the narrowest verification strategy that still catches the likely regressions. 3. Instrument the workflow so failures are actionable rather than just red. 4. Run the relevant checks on the showcase apps and packaging outputs. 5. Capture any residual risk with explicit follow-up work and owner skills. ## Guardrails - Prefer reproducible checks in CI over one-off local heroics. - Fail with a precise remediation path instead of a vague quality gate. - Keep secrets, signing material, and production credentials out of examples and fixtures. - Treat performance and security work as engineering tasks with evidence, not folklore. ## Anti-Patterns - Adding more tests without increasing signal. - Shipping benchmarks or security scans that no one can reproduce. - Hard-coding release credentials into build logic. - Using synthetic metrics with no user-impact interpretation. ## Examples ### Happy path - Scenario: Cover reducer and formatter logic in both fixture apps with focused local tests. - Command: `cd examples/orbittasks-compose && ./gradlew :app:testDebugUnitTest && cd ../orbittasks-xml && ./gradlew :app:testDebugUnitTest` ### Edge case - Scenario: Mock sync failures and permission-denied branches without instrumentation. - Command: `cd examples/orbittasks-compose && ./gradlew :app:testDebugUnitTest` ### Failure recovery - Scenario: Separate unit-testing requests from UI testing or general architecture cleanup. - Command: `python3 scripts/eval_triggers.py --skill android-testing-unit` ## Done Checklist - The implementation path is explicit, minimal, and tied to the right Android surface. - Relevant example commands and benchmark prompts have been exercised or updated. - Handoffs to adjacent skills are documented when the request crosses boundaries. - Official references cover the chosen pattern and the main migration or troubleshooting path. ## Official References - [https://developer.android.com/training/testing/local-tests](https://developer.android.com/training/testing/local-tests) - [https://developer.android.com/training/testing/fundamentals](https://developer.android.com/training/testing/fundamentals) - [https://developer.android.com/topic/libraries/architecture/viewmodel](https://developer.android.com/topic/libraries/architecture/viewmodel) - [https://kotlinlang.org/docs/jvm-test-using-junit.html](https://kotlinlang.org/docs/jvm-test-using-junit.html)
More Testing skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
setup-pre-commit
mattpocock/skills
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

