testing-strategy
Skill4 starsChanged 10 months agoMITView on GitHub
Comprehensive testing patterns - unit, integration, E2E, accessibility, security. Use when writing tests, setting up test infrastructure, or TDD.
- Deletes or force-pushes
37 other projects use a version of this.
Adopted by
Most recently taken up by
- HMBSbige/skillstheir own version, first seen Oct 3, 2026
- vospr/context-engineering-templatetheir own version, first seen Oct 1, 2026
- lgzarturo/codeconductortheir own version, first seen Sep 30, 2026
- Cure-Consulting-Group/ProductEngineeringSkillstheir own version, first seen Sep 28, 2026
- komluk/scaffoldingtheir own version, first seen Sep 28, 2026
- Ygohel18/skillstheir own version, first seen Sep 27, 2026
Used with
Projects with it also use react-patterns, api-design and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
benshapyroSkillreact-patterns
Modern React patterns for TypeScript applications including hooks, state management, and component composition. Use when building React components, managing state, or implementing React best practices.
Also in 4 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 10 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 5 projects that use this
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 6 projects that use this
MicrosoftSkillerror-handling
统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。
Also in 3 projects that use this
CloudAI-XSkilldatabase-design
Designs database schemas, indexing strategies, query optimization, and migration patterns for SQL and NoSQL databases. Use when designing tables, optimizing queries, fixing N+1 problems, planning migrations, or when asked about database performance, normalization, ORMs, or data modeling.
Also in 3 projects that use this
Other versions37 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 37
- anthropics/knowledge-work-plugins★ 26ksame name
- irahardianto/awesome-agv★ 157same name
- AnastasiyaW/codex-claude-code-config★ 153same name
- zakariaf/Flutter-Skills★ 52same name
- shinpr/agentic-code★ 49same name
- addxai/enterprise-harness-engineering★ 44same name
- drafthq/draft★ 40same name
- Hack23/European-Parliament-MCP-Server★ 28same name
- suhailkakar/the-skills★ 26same name
- komluk/scaffolding★ 15same name
27 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- Claude Agent SDK PatternsSkill
- delegation-templatesSkill
- deploymentSkill
- frontend-patternsSkill
- Google ADK PatternsSkill
- LLM Evaluation PatternsSkill
- LLM Observability PatternsSkill
- memory-workflowSkill
- orchestrator-workflowsSkill
- react-native-best-practicesSkill
- skill-creatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 8 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 33 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 137
Fix: Test behavior, not code structure.
- Distinctive: line 145
Fix: Use semantic assertions. See 08-ai-llm-testing.md
- Distinctive: line 149
Fix: Use fixtures, clean up after tests.
- Distinctive: line 157
Fix: Follow testing pyramid. See 01-testing-philosophy.md
- Very specific: line 196
Use keyword presence: assert "Paris" in response
- Very specific: line 197
Use JSON mode: response_format="json" for structure
- Very specific: line 198
Use length bounds: assert 50 < len(response) < 200
- Very specific: line 205
Test SQL injection payloads: "'.
- Very specific: line 207
Test SSRF: Block private IPs (127.0.0.1, 169.254.169.254)
- Distinctive: line 213
Fix immediately: - don't accumulate flaky tests!
- Very specific: line 214
Never use sleep() - use explicit waits
- Distinctive: line 215
Never share state - use fixtures for isolation
- Distinctive: line 216
Never depend on test order - each test independent
- Distinctive: line 245
Introduction: When to use this testing approach
- Very specific: line 251
Navigation: Always load SKILL.md first for quick reference, then specific module for implementation details.
“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing Strategy - Quick Reference
Purpose: Comprehensive testing strategies for robust, reliable software across all layers.
When to use: Designing test plans, implementing automated tests, setting up CI/CD, improving coverage.
Modules
1. Testing Philosophy → 01-testing-philosophy.md
- Test pyramid (60% unit, 30% integration, 10% E2E)
- Coverage targets (critical paths 100%, business logic 90%+)
- What to test vs. what NOT to test
- Best practices and common pitfalls
2. Unit Testing → 02-unit-testing.md
- pytest patterns (AAA, fixtures, parametrization)
- Mocking (external APIs, databases)
- Test isolation and independence
- Example patterns with code
3. Integration Testing → 03-integration-testing.md
- API integration tests (FastAPI TestClient)
- Database integration (test databases, transactions)
- Service integration (multi-component testing)
- Test data management
4. Frontend Component Testing → 04-frontend-component-testing.md
- React Testing Library (user-centric queries)
- Svelte component tests
- Async behavior (loading states, API calls)
- Mocking context and hooks
5. E2E Testing → 05-e2e-testing.md
- Playwright patterns (user journeys)
- Browser automation
- Critical path testing
- When to use E2E vs component tests
6. Accessibility Testing → 06-accessibility-testing.md
- WCAG 2.1 compliance (Level AA target)
- Automated A11y (jest-axe, Playwright AxeBuilder)
- Keyboard navigation testing
- Manual testing checklist
7. Security Testing → 07-security-testing.md
- OWASP Top 10 (injection, XSS, auth, CSRF)
- API security (rate limiting, CORS)
- SSRF prevention (DNS rebinding, TOCTOU)
- Dependency scanning (pip-audit, npm audit)
- SAST/DAST integration
8. AI/LLM Testing → 08-ai-llm-testing.md
- Semantic assertions (never exact strings!)
- JSON mode for deterministic testing
- Prompt testing and variations
- Cost/performance tracking
9. Performance Testing → 09-performance-testing.md
- Load testing (Locust patterns)
- Database performance (query timing)
- Profiling and optimization
10. Flaky Test Management → 10-flaky-test-management.md
- Identifying flaky tests (timing, non-determinism)
- Common causes and fixes (sleep(), shared state)
- Retry strategies (last resort!)
- CI/CD handling (separate flaky tests)
11. CI/CD Integration → 11-ci-cd-integration.md
- GitHub Actions patterns
- Coverage reporting (codecov)
- Test organization (unit/integration/e2e)
- Quality gates
Quick Lookup
Common Tasks:
| Task | Module |
| Writing pytest unit tests? | 02-unit-testing.md |
| Testing FastAPI endpoints? | 03-integration-testing.md |
| Testing React components? | 04-frontend-component-testing.md |
| Testing user flows? | 05-e2e-testing.md |
| Ensuring accessibility? | 06-accessibility-testing.md |
| Security testing? | 07-security-testing.md |
| Testing AI agents/LLMs? | 08-ai-llm-testing.md |
| Load/performance testing? | 09-performance-testing.md |
| Fixing flaky tests? | 10-flaky-test-management.md |
| Setting up CI/CD? | 11-ci-cd-integration.md |
Testing Pyramid
/\
/ \ E2E Tests (10%)
/----\
/ \ Integration Tests (30%)
/--------\
/ \ Unit Tests (60%)
/--------------\Rule: More unit tests (fast, isolated), fewer E2E tests (slow, brittle).
Coverage Targets
| Layer | Target Coverage |
| Critical Paths | 100% |
| Business Logic | 90-100% |
| API Endpoints | 80-90% |
| Utility Functions | 80-90% |
| UI Components | 70-80% |
Measure: pytest --cov=src --cov-report=html
Anti-Patterns
Testing Implementation Details
Problem: Tests break when refactoring, not when behavior changes. Fix: Test behavior, not code structure. See 01-testing-philosophy.md
Flaky Tests
Problem: Tests fail randomly, destroying confidence. Fix: See 10-flaky-test-management.md for systematic fixes.
Exact LLM Output Assertions
Problem: LLMs are non-deterministic, exact strings fail. Fix: Use semantic assertions. See 08-ai-llm-testing.md
No Test Isolation
Problem: Tests depend on each other, fail in isolation. Fix: Use fixtures, clean up after tests. See 02-unit-testing.md
Skipping Security Tests
Problem: Vulnerabilities ship to production. Fix: Automate security scans. See 07-security-testing.md
Too Many E2E Tests
Problem: Slow test suite, brittle tests. Fix: Follow testing pyramid. See 01-testing-philosophy.md
When to Use Which Module
Planning test strategy?
→ Module 1 (Philosophy) - Understand pyramid, coverage, best practices
Writing backend tests?
→ Module 2 (Unit) + Module 3 (Integration)
Testing UI?
→ Module 4 (Component) for React/Svelte, Module 5 (E2E) for flows
Ensuring accessibility?
→ Module 6 (Accessibility) - WCAG compliance, keyboard nav
Testing security?
→ Module 7 (Security) - OWASP Top 10, injection, auth
Testing AI agents?
→ Module 8 (AI/LLM) - Semantic assertions, prompt testing
Performance issues?
→ Module 9 (Performance) - Load testing, profiling
Tests failing randomly?
→ Module 10 (Flaky Tests) - Identify and fix root causes
Setting up CI/CD?
→ Module 11 (CI/CD) - GitHub Actions, coverage, automation
Critical Reminders
LLM Testing (CRITICAL)
Never assert exact strings - LLMs are non-deterministic!
- Use keyword presence:
assert "Paris" in response - Use JSON mode:
response_format="json"for structure - Use length bounds:
assert 50 < len(response) < 200 - Never:
assert response == "Exact string"
See 08-ai-llm-testing.md for complete patterns.
Security Testing (CRITICAL)
Test negative cases - what should be blocked!
- Test SQL injection payloads:
"'; DROP TABLE users; --" - Test XSS:
"<script>alert('XSS')</script>" - Test SSRF: Block private IPs (
127.0.0.1,169.254.169.254) - Automate scans:
pip-audit,bandit,npm audit
See 07-security-testing.md for complete OWASP coverage.
Flaky Tests (CRITICAL)
Fix immediately - don't accumulate flaky tests!
- Never use
sleep()- use explicit waits - Never share state - use fixtures for isolation
- Never depend on test order - each test independent
- Goal: 0% flaky tests
See 10-flaky-test-management.md for systematic fixes.
Best Practices Checklist
- Follow testing pyramid (more unit, fewer E2E)
- Write tests during development (TDD/BDD)
- Keep tests independent and isolated
- Use descriptive test names (
test_user_email_validation_rejects_invalid_format) - Mock external dependencies (APIs, databases in unit tests)
- Use test fixtures and factories
- Maintain >80% coverage (critical paths 100%)
- Run tests in CI/CD pipeline
- Keep unit tests fast (<1s each)
- Test edge cases and error scenarios
- Clean up test data after tests
- Never ignore flaky tests - fix or skip with tracking issue
- Never assert exact LLM strings - use semantic assertions
- Always test security - OWASP Top 10, negative cases
Module Organization
Each module follows this structure:
- Introduction: When to use this testing approach
- Patterns: Code examples and best practices
- Anti-patterns: Common mistakes to avoid
- Checklist: Verification steps
- Cross-references: Links to related modules
Navigation: Always load SKILL.md first for quick reference, then specific module for implementation details.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

