Test Doubles

Identify, classify, design, and create test doubles using Fowler's taxonomy: Dummy, Fake, Stub, Spy, and Mock. Use whenever the user needs help with test doubles, mocking, stubbing, faking, spies, or test isolation in any language. Trigger on creating mocks or stubs for unit tests, choosing a double type, state vs behavior verification, brittle over-mocked tests, "what kind of test double is this?", fakes for integration tests, replacing real dependencies, classical vs mockist TDD, tests coupled to implementation details, or "should I mock this?" Also trigger on mocking frameworks such as Mockito, unittest.mock, Sinon, jest.mock, Moq, gomock, testdouble.js, RSpec mocks, OCMock, Mockery, and NSubstitute.

guillevc 3b10cff 2 files · 28.0 KB Updated

File contents

guillevc/skills/tree/main/skills/misc/test-doubles commit 3b10cff1a5

Frequently asked questions

npx skillmds@latest add guillevc/test-doubles