- Home
- Skills
- Cloudai X
- Claude Workflow
- Designing Tests
designing-tests_skill
- Python
1.2k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill cloudai-x/claude-workflow --skill designing-tests- SKILL.md5.3 KB
Overview
This skill designs and implements testing strategies for any codebase, covering unit, integration, and end-to-end (E2E) testing. It provides practical checklists, templates, and tool recommendations to set up test infrastructure, improve coverage, and stabilize test suites. Use it to create repeatable testing workflows and measurable coverage targets.
How this skill works
The skill inspects your codebase and recommends a testing pyramid distribution (unit / integration / E2E) and specific frameworks by language. It supplies test templates, a test implementation checklist, mocking guidance, and a validation loop for running tests and enforcing coverage thresholds. It also recommends factories, fixtures, and when to mock external dependencies for deterministic tests.
When to use it
- When adding tests to an existing project
- When improving or enforcing coverage targets
- When setting up CI test runners and coverage thresholds
- When debugging flaky or failing tests
- When defining unit, integration, or E2E strategies for a new feature
Best practices
- Follow the testing pyramid: ~70% unit, 20% integration, 10% E2E
- Prioritize business logic, edge cases, and API contracts for high coverage
- Mock external services and time-dependent behavior; avoid mocking the unit under test
- Use factories and fixtures to manage test data and keep tests readable
- Keep tests independent and name them to describe behavior clearly
Example use cases
- Add pytest unit tests for a Python core module and configure coverage thresholds
- Create integration tests for an API using pytest + httpx or FastAPI TestClient
- Implement Playwright E2E flows for critical user journeys like registration and checkout
- Replace flaky network calls in unit tests with MSW (JS) or HTTP mocking in Python
- Set up CI to run tests, report coverage, and fail builds that miss thresholds
FAQ
Aim for global thresholds around 80% and raise core modules to 95% as needed; prioritize business logic and API contracts over trivial code.
When should I mock vs use real services?
Mock external APIs, databases, time, and randomness for unit tests. Use real components in integration tests and only the minimal external parts for E2E to keep realism.