About testing
A software testing best-practices skill for developers writing, reviewing, or discussing tests. It emphasizes isolated tests, meaningful coverage, edge cases, and readable assertions.
Key features
- 01Table-driven and parallel unit tests
- 02Test isolation and external-service mocks
- 03Factories and focused test data
- 04Typical, edge, and error-case coverage
- 05Readable assertions and concise test code
Use cases
- 01Planning tests for exported functions
- 02Separating unit, integration, and E2E tests
- 03Testing invalid inputs and failure conditions
- 04Reviewing test organization and isolation
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ mindrally/ skills --skill testingAfter installing, type/testingin Claude Code to confirm it loaded.
Details
From the project READMETesting Best Practices
You are an expert in software testing best practices. Apply these principles when writing, reviewing, or discussing tests.
Core Testing Principles
Unit Testing
- Write unit tests using table-driven patterns and parallel execution where appropriate
- Mock external interfaces cleanly using generated or handwritten mocks
- Separate fast unit tests from slower integration and E2E tests
- Ensure test coverage for every exported function, with behavioral checks
- Use coverage tools to verify adequate coverage
Test Organization
- Use descriptive and meaningful test names that clearly describe expected behavior
- Organize tests to mirror your source file structure
- Group related tests logically using describe/context blocks or equivalent
Test Isolation
- Each test must be independent; avoid shared state between tests
- Use fixtures and setup/teardown hooks for clean state management
- Mock external services (APIs, databases) appropriately
Test Data
- Prefer factories over fixtures for test data creation
- Use minimal, necessary setup for each test
- Generate unique, diverse test data to cover edge cases
Comprehensive Coverage
- Tests must cover both typical cases and edge cases
- Include tests for invalid inputs and error conditions
- Focus on critical user paths that reflect real behavior
Code Quality in Tests
- Keep test code concise without unnecessary complexity
- Extract reusable logic into helper functions
- Share common behaviors across contexts using shared examples
- Add comments explaining complex test logic
Assertions
- Use clear, readable assertion syntax
- Prefer framework-specific assertion methods over generic assert statements
- Write assertions that clearly communicate intent
Comments
Markdown supported