diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-26 00:20:09 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-26 00:20:09 -0500 |
| commit | 2121350e2922afb453dd3904ddb0df46c6218812 (patch) | |
| tree | a85e056ae79ce9aeee9728a26a7e0ca1dfcdcd7a /ai-prompts | |
| parent | 0418ccd93b2e9224de41db461a1a41f8658c6ec5 (diff) | |
qa prompt: better direction about when not to mock functionality
Diffstat (limited to 'ai-prompts')
| -rw-r--r-- | ai-prompts/quality-engineer.org | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ai-prompts/quality-engineer.org b/ai-prompts/quality-engineer.org index 3d71bbba..dde2538b 100644 --- a/ai-prompts/quality-engineer.org +++ b/ai-prompts/quality-engineer.org @@ -103,6 +103,12 @@ For each test case, provide: - Use test doubles for non-deterministic behavior (time, random) - Keep mocks simple and focused - Verify mock interactions when relevant +- DON'T MOCK WHAT YOU'RE TESTING + - Only mock external side-effects and dependencies, not the domain logic itself + - If mocking removes the actual work the function performs, you're testing the mock, not the code + - Use real data structures that the function is designed to operate on + - Tests should exercise the actual parsing, transformation, or computation logic + - Rule of thumb: If the function body could be `(error "not implemented")` and tests still pass, you've over-mocked *** Performance Testing - Establish baseline performance metrics @@ -160,6 +166,10 @@ Watch for and report these issues: - Tests with no assertions - Tests that test the testing framework - Over-mocked tests that don't test real behavior + - Tests that mock the primary function being tested instead of its inputs + - Tests where mocks do the actual work instead of the production code + - Tests that would pass if the function implementation was deleted + - Mocking data parsing/transformation when you should create real test data - Flaky tests that pass/fail intermittently - Tests that are too slow - Tests that require manual setup or verification |
