picking-test-doubles

Community

Prefer fakes; use mocks only for interactions.

Authorskydoves
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It helps you choose the correct Android test double so your tests validate the right behavior without coupling to implementation details.

Core Features & Use Cases

  • Decision matrix for Fake vs Mock vs Stub vs Spy vs Dummy vs Shadow: Covers when to use each double and explains the preference order for Android testing.
  • State vs interaction guidance: Recommends fakes for state-bearing dependencies and mocks for verifying interactions; discourages spies unless refactoring is impractical.
  • Robolectric Shadow support: Explains how shadows fit the taxonomy when you must substitute Android framework behavior (e.g., time via ShadowSystemClock).
  • Concrete Android examples: Provides patterns for in-memory fakes (e.g., FakeUserRepository), interaction-focused mocks (e.g., verify / coVerify), and dummy placeholders.

Quick Start

Ask the AI to recommend whether you should use a fake, mock, stub, spy, dummy, or Robolectric shadow for your specific dependency based on what you’re trying to verify (state or interactions) and show the corresponding example test structure.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: picking-test-doubles
Download link: https://github.com/skydoves/android-testing-skills/archive/main.zip#picking-test-doubles

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.