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 | 21d2f8502e379bf08c3bcd736a4e5a02c616d282 (patch) | |
| tree | a15f95127173b3acb15f6716f9a20b8bb122193d | |
| parent | cc871a4ac671864eaa090e84b5425751b0de2980 (diff) | |
| download | dotemacs-21d2f8502e379bf08c3bcd736a4e5a02c616d282.tar.gz dotemacs-21d2f8502e379bf08c3bcd736a4e5a02c616d282.zip | |
qa prompt: better direction about when not to mock functionality
| -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 3d71bbba5..dde2538bb 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 |
