kotlin-testing-kmp

Implement testing strategies for Kotlin Multiplatform projects with kotlin.test.

1|Updated Apr 22, 2026
One-click install
npx skills add https://github.com/cedric-champeix/SpoonFeeder --skill kotlin-testing-kmp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-testing-kmp
Source: https://github.com/cedric-champeix/SpoonFeeder/tree/main/.claude/skills/kotlin-testing-kmp
Command: npx skills add https://github.com/cedric-champeix/SpoonFeeder --skill kotlin-testing-kmp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin Multiplatform projects often struggle to balance fast local tests with platform-specific validations, making it hard to trust shared logic across targets.

Core Features & Use Cases

  • Guidance on designing fast, stable unit tests in commonTest using kotlin.test, plus Android-specific testing where needed.
  • Clear separation of concerns between local, instrumented, Robolectric, and UI tests, with a practical test pyramid.
  • Strategies for Compose Multiplatform UI testing and cross-target mappings that keep shared logic testable and maintainable.

Quick Start

Start by validating shared Kotlin logic in commonTest and then extend coverage with platform-specific tests as your project grows.

Frequently Asked Questions about kotlin-testing-kmp

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

FAQPage Schema
How do I structure unit tests for Kotlin Multiplatform shared logic?

Structure Kotlin Multiplatform unit tests by placing shared logic validations in commonTest using kotlin.test, then expanding coverage with platform-specific tests as your project grows to maintain a proper test pyramid.

What is the right balance between Robolectric and instrumented tests in KMP?

Robolectric and instrumented tests in Kotlin Multiplatform require clear separation of concerns, using Robolectric for local Android-specific validations and instrumentation for broader platform checks to keep shared logic maintainable.

Can I use Compose Multiplatform UI testing across different targets?

Yes, Compose Multiplatform UI testing supports cross-target mappings that keep shared logic testable, ensuring UI tests remain stable and maintainable across the platforms your project targets.

What's the best way to organize commonTest versus platform-specific tests?

Organize tests by enforcing a practical test pyramid: validate core shared logic in commonTest with kotlin.test, then carefully extend with Robolectric, instrumented, and UI tests for platform-specific layers.

When do I need instrumented tests instead of local unit tests in Kotlin Multiplatform?

You need instrumented tests instead of local unit tests in Kotlin Multiplatform when performing platform-specific validations that require an actual device or emulator environment to accurately verify target behavior.

Why does my Kotlin Multiplatform test pyramid struggle with fast local tests?

Your test pyramid struggles because balancing fast local tests with platform-specific validations in Kotlin Multiplatform is difficult; enforcing kotlin.test in commonTest and separating Robolectric tests stabilizes shared logic.