Skill / SKILL.md

Picking Test Doubles

skydoves/android-testing-skills

Use this skill to pick the right test double — fake, mock, stub, spy, dummy, or Robolectric shadow — for an Android test. Encodes Google's verbatim preference order ("fakes ... are preferred", "Fakes are preferred over stubs for simplicity", "Fakes or mocks are therefore preferred over spies"), gives Android examples (in-memory `FakeUserRepository`, `mockk<UserRepository>()`, `ShadowSystemClock`), and a decision matrix mapping intent to the correct double. Use when the user asks "fake or mock", "should I use Mockito here", "how do I replace this dependency in tests", "what's the difference between a stub and a mock", "spy vs mock", or mentions `mockk`, `every { } returns`, `verify { }`, `org.mockito`, `argumentCaptor`, `Robolectric` shadows, `ShadowSystemClock`, or `FakeRepository`.
3 views 351 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Use this skill to pick the right test double — fake, mock, stub, spy, dummy, or Robolectric shadow — for an Android test. Encodes Google's verbatim preference order ("fakes ... are preferred", "Fakes are preferred over stubs for simplicity", "Fakes or mocks are therefore preferred over spies"), gives Android examples (in-memory `FakeUserRepository`, `mockk<UserRepository>()`, `ShadowSystemClock`), and a decision matrix mapping intent to the correct double. Use when the user asks "fake or mock", "should I use Mockito here", "how do I replace this dependency in tests", "what's the difference between a stub and a mock", "spy vs mock", or mentions `mockk`, `every { } returns`, `verify { }`, `org.mockito`, `argumentCaptor`, `Robolectric` shadows, `ShadowSystemClock`, or `FakeRepository`.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/skydoves/android-testing-skills' skill-source

Use the complete skill-source/fundamentals/doubles/picking-test-doubles directory with your client’s skill installer.

  • fundamentals/doubles/picking-test-doubles

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory fundamentals/doubles/picking-test-doubles

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Included files
Source & validation
Source status
Awaiting source check
Format validation
Needs source review
Checked at
Pending source check
Content SHA-256
c459479250a1ea9b5d46190450d5a2984187296e70a0193c54df535d7b50842f
Format validation findings
  • Metadata requires string values.
Agent Skills specification
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills