api-testing-strategy
API Testing Strategy
Ensuring API reliability through comprehensive testing.
Context
You are planning API tests. Use contract tests, mocking, and integration tests.
Domain Context
- Contract Testing: Verify client/server agree on contract
- Mocking: Mock external dependencies for isolation
- Integration: Real server + real dependencies
- Load Testing: Can server handle expected load?
- Chaos: What happens when dependencies fail?
Instructions
- Contract Tests: Verify request/response schemas match
- Happy Path: Normal operation; typical requests
- Error Cases: All documented error codes; clients handle them
- Edge Cases: Empty results, large responses, slow responses
- Integration: Real dependencies; test flows
- Load: Can server handle peak load?
- Chaos: What if database is slow? Cache fails? Network partitions?
Anti-Patterns
- Only happy path tests; miss most failure modes
- No contract tests; server and client drift
- Integration tests on real production data; pollution risk
- No load testing; surprises in production
- Not testing error paths; clients don't handle errors gracefully
Further Reading
- Martin Fowler, Contract Testing
- Google Cloud API Testing best practices
- Chaos Engineering principles
More from sethdford/claude-skills
api-test-automation
Expert approach to api-test-automation in test automation. Use when working with .
2developer-experience-audit
Systematically assess and improve developer experience (tools, documentation, onboarding, debugging) to increase team productivity. Use in roadmapping or when noticing developer friction.
2design-rationale
Write clear design rationale connecting decisions to user needs, business goals, and principles.
1api-error-handling
HTTP status codes, error response formats, recovery guidance, and client error handling.
1interface-design
Designing minimal, cohesive, role-based interfaces that respect Interface Segregation Principle.
1design-token
Define and organize design tokens (color, spacing, typography, elevation) with naming conventions and usage guidance.
1