organizing-test-source-sets

Organize Android test source sets and Gradle configurations for unit and instrumented tests.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill organizing-test-source-sets-trancee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: organizing-test-source-sets
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/android-testing-skills/fundamentals/strategies/organizing-test-source-sets
Command: npx skills add https://github.com/trancee/MeshLink-template --skill organizing-test-source-sets-trancee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves confusion regarding where to place Android test files and how to correctly configure Gradle dependencies to avoid build errors and runtime crashes.

Core Features & Use Cases

  • Source Set Mapping: Provides a clear decision tree for placing tests in src/test, src/androidTest, or KMP-style source sets.
  • Dependency Management: Explains the correct usage of testImplementation, androidTestImplementation, and debugImplementation to prevent common configuration pitfalls.
  • Use Case: If you are struggling with Unresolved reference errors in Compose tests or need to migrate away from the deprecated src/sharedTest convention, this skill provides the exact configuration patterns required for modern AGP versions.

Quick Start

Use the organizing-test-source-sets skill to determine the correct source set and Gradle configuration for a new Robolectric test file.

Frequently Asked Questions about organizing-test-source-sets

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

FAQPage Schema
How do I organize Android test source sets to fix Unresolved reference errors in Compose tests?

Organize Android test source sets by mapping tests to the correct directories and applying proper Gradle configurations like testImplementation. This resolves Unresolved reference errors in Compose tests by ensuring correct dependency scoping for host and device environments.

What is the difference between testImplementation and androidTestImplementation for Android testing?

testImplementation scopes dependencies for local JVM unit tests in src/test, while androidTestImplementation scopes dependencies for instrumented tests in src/androidTest. Correct usage prevents build errors and runtime crashes across host and device test environments.

How to migrate away from the deprecated src/sharedTest convention in AGP?

Migrate away from src/sharedTest by applying KMP-style testing conventions and configuring Gradle source sets directly. This ensures AGP 7.2+ compatibility and maintains proper execution of unit and instrumented tests without deprecated directory structures.

Does this Android test source set architecture support KMP-style testing conventions?

Yes, the architecture supports KMP-style testing conventions by organizing source sets and Gradle configurations across host and device environments. It applies KMP-style testing conventions to ensure proper execution of unit and instrumented tests.

When do I need debugImplementation for Android instrumented tests?

You need debugImplementation when configuring dependencies for instrumented tests that require Compose test manifest integration. It ensures proper dependency scoping across device environments and satisfies AGP 7.2+ compatibility requirements.