android-kotlin-testing

Standardize Android Kotlin ViewModel, Compose UI, and Hilt component tests.

34|8|Updated May 21, 2026
One-click install
npx skills add https://github.com/haidrrrry/compose-kotlin-agent-skills --skill android-kotlin-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-kotlin-testing
Source: https://github.com/haidrrrry/compose-kotlin-agent-skills/tree/main/skills/android-kotlin-testing
Command: npx skills add https://github.com/haidrrrry/compose-kotlin-agent-skills --skill android-kotlin-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common pain point of writing flaky, incomplete tests for Android Kotlin applications, where missing best practices for ViewModel state testing, Compose UI semantics, and Hilt test setup lead to bugs slipping through to production and unreliable test suites.

Core Features & Use Cases

  • ViewModel Unit Testing: Templates and patterns for testing ViewModel state transitions using Turbine for StateFlow validation, with guidance on using fake repositories over mocks for more reliable tests.
  • Compose UI Testing: Stateless Compose component testing using test tags and semantics, avoiding flaky ViewModel-integrated screen tests.
  • CI Quality Gates: Pre-configured validation steps to enforce test coverage and skill compliance before code merge, reducing regression risk.
  • Use Case: For example, when building a new feature with a ViewModel that fetches data from a repository, use this Skill to write fast, reliable unit tests that catch loading, error, and success state bugs before they reach QA.

Quick Start

Use this skill to write a unit test for your Android ViewModel that verifies loading, success, and error state transitions using Turbine and fake repository implementations, and configure a CI gate to enforce test coverage before merge.

Frequently Asked Questions about android-kotlin-testing

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

FAQPage Schema
How do I test Android ViewModel state transitions with Turbine?

Test Android ViewModel state transitions by using Turbine to validate StateFlow emissions and implementing fake repositories to reliably verify loading, success, and error states without flaky behavior.

What is the best way to test Compose UI components without flaky screen tests?

The best way to test Compose UI components is to test stateless Composables using test tags and semantics, avoiding flaky ViewModel-integrated screen tests by isolating UI validation from state management.

How do I configure CI quality gates to enforce Android test coverage?

Configure CI quality gates by adding pre-configured validation steps that enforce test coverage and skill compliance before code merge, reducing regression risk and preventing untested code from reaching production.

Does Hilt testing require fake repositories or mocks for reliable component testing?

Hilt testing and component testing require fake repositories over mocks to ensure more reliable tests, providing standardized patterns for integration testing without the brittleness of mock-based setups.

Why does my Android Kotlin test suite catch state bugs but miss UI regressions?

Your Android Kotlin test suite likely misses UI regressions because it lacks stateless Compose UI testing with test tags and semantics, relying instead on flaky ViewModel-integrated screen tests that fail to isolate UI behavior.