Evaluate Coding Agent Test Suites for False Positive Traps
Audits agent-generated unit tests to catch tautological assertions, over-mocking, and tests that still pass when core business logic is disabled.
Agent prompt for Claude Code and Cursor
You get: Flawed Test Name, flaw Classification and why It Passes Incorrectly
Prompt
mkdir -p .agents/skills/evaluate-coding-agent-test-suites-for-false-positive-traps && curl -sL "https://prompts-gpt.com/prompts/evaluate-coding-agent-test-suites-for-false-positive-traps/raw" -o .agents/skills/evaluate-coding-agent-test-suites-for-false-positive-traps/SKILL.mdAct as a principal software QA engineer specializing in mutation testing and automated verification. Analyze the test suite and source implementation pasted below to identify false-positive assertion traps commonly produced by AI coding agents.
Rules:
1. Scrutinize all mock setups. Flag any test where the mock returns data that bypasses the actual business logic or asserts only on mock calls instead of final state.
2. Identify tautological assertions (such as asserting true is true, checking type instead of value, or mirroring internal calculations without validation).
3. Apply a virtual mutation test: explain specifically what breaks or stays green if the core logic block is commented out or hardcoded to return a static value.
4. Do not invent edge cases outside the provided logic. Focus strictly on whether the existing assertions genuinely prove the code works.
Output format:
- Flawed Test Name
- Flaw Classification: Over-mocking, Tautological Assertion, or Silent Pass
- Why It Passes Incorrectly: 2-3 sentences explaining the false confidence
- Mutation Failure Test: What happens if business logic is removed or altered
- Corrected Test Code: Minimal rewrite asserting on actual side effects or returned values
Paste your implementation code and corresponding test file directly below this prompt.Example output
Tips and common edits
Why this works
- Forces a virtual mutation check that exposes tests that pass even when underlying logic is deleted.
- Specifically targets over-mocking traps where tests only verify mock calls rather than business outcomes.
- Provides immediately usable replacement tests that verify concrete state rather than internal method wiring.
Paste your application logic and its agent-generated test file immediately after the prompt. Works directly in Claude Code, Cursor, Codex, or GitHub Copilot chat.
Common edits
- Add a constraint targeting a specific language or framework (such as Jest, Pytest, or Go testing).
- Request test runs against specific failure boundaries like zero values, empty lists, or API timeouts.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Review AI Pull Requests for Phantom Imports and Bloat
Audits pull request diffs generated by coding agents to flag fake dependencies, single-call wrappers, and premature abstractions.
Verify the Coding Agent's 'Done' Claim Against the Diff and Test Output
Checks each claim in a coding agent's final summary against the actual diff and test runs, marks it verified, unverified or contradicted with evidence, and lists unmentioned changes, skipped tests and stubs.
Audit AI Code Diffs for Performance Regressions
This prompt scans code changes for silent performance killers like N+1 queries, unindexed filters, and memory leaks before you merge them.
Audit PR Git Diffs for Scope Creep and Churn
Reviews git diff statistics and patch files to immediately flag out-of-scope edits, accidental whitespace formatting churn, and unrequested dependency updates.
Pre-Merge Self-Review of a Git Diff: Correctness, Security, and Test Gaps
Has Claude Code review a branch diff like a skeptical maintainer, producing severity-ranked findings with evidence and a clear merge, fix, or block recommendation. Use it before opening or approving a pull request.
Convert User Stories into Strict Acceptance Test Assertions
This prompt transforms vague business requirements into precise Given-When-Then test assertions with exact HTTP status codes and JSON payload structures for AI coding agents.
- Create Automated Verification Loops for Long-Running Coding Agents
- Design a Sandbox Security Policy for Autonomous Coding Agents
- Generate Database Migration and Rollback Specs for Coding Agents
- Generate Reproducible Bug Fix Specs for Coding Agents
- Create a Legacy Module Reference Sheet for Coding Agents
- Create a Verification Loop Script for AI Coding Agents