Ask Claude to Review Your Test Coverage and Write the Missing Tests
You have tests, but you know there are gaps. Instead of guessing where, let Claude compare your code against your test suite and find exactly what's missing.
"Read the UserService and its tests. What scenarios aren't covered? Write the missing tests."
Claude reads the implementation, reads the existing tests, and identifies what's untested — then writes tests for every gap:
# Claude might report:
# ✓ Tested: creating a user with valid data
# ✓ Tested: duplicate email rejection
# ✗ Missing: creating a user when the database is unavailable
# ✗ Missing: updating a user with a role that doesn't exist
# ✗ Missing: deleting a user who has active subscriptions
# ✗ Missing: concurrent updates to the same user
You can scope the review to what matters:
# Check a specific module
"Review test coverage for the entire payments module and write what's missing"
# Focus on error paths
"Find every error condition in the OrderController that doesn't have a test"
# Check edge cases
"What edge cases in the search feature aren't tested? Think about empty queries,
special characters, very long inputs, and pagination boundaries"
# After a refactor
"I just refactored the notification system. Check if any existing tests broke
and add tests for the new code paths"
Claude finds the gaps that are hardest to spot manually:
- Untested branches — if/else paths that no test exercises
- Missing error scenarios — what happens when external calls fail, data is invalid, or permissions are denied
- Boundary conditions — empty inputs, maximum lengths, zero values, null fields
- Race conditions — concurrent writes, stale reads, lock timeouts
- Integration gaps — functions tested in isolation but not together
Run your coverage tool after Claude adds tests to see the improvement:
! php artisan test --coverage
Tests you don't have are bugs you haven't found yet — let Claude find the gaps before your users do.
via Claude Code
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.