Test-driven development (TDD), unit/integration/UAT testing strategies, test organization, coverage requirements, and GenAI validation patterns. Use when writing tests, validating code, or ensuring quality.
Provides comprehensive testing guidance including TDD workflows, test tier auto-categorization, and three-layer validation strategies. Activates when writing tests, measuring coverage, or validating code quality to ensure robust test architecture.
/plugin marketplace add akaszubski/autonomous-dev/plugin install autonomous-dev@autonomous-devThis skill is limited to using the following tools:
arrange-act-assert.mdcoverage-strategies.mddocs/ci-cd-integration.mddocs/progression-testing.mddocs/pytest-fixtures-coverage.mddocs/regression-testing.mddocs/tdd-methodology.mddocs/test-organization-best-practices.mddocs/testing-layers.mddocs/three-layer-strategy.mddocs/workflow-hybrid-approach.mdpytest-patterns.mdtest-templates/fixture-examples.pytest-templates/integration-test-template.pytest-templates/unit-test-template.pyComprehensive testing strategies including TDD, traditional pytest testing, GenAI validation, and system performance meta-analysis.
Modern testing approach combining traditional pytest, GenAI validation, and system performance meta-analysis.
Layer 1: Traditional Tests (pytest)
Layer 2: GenAI Validation (Claude)
Layer 3: System Performance Testing (Meta-analysis)
See: docs/three-layer-strategy.md for complete framework and decision matrix
Four-layer testing pyramid from fast unit tests to comprehensive GenAI validation.
Layers:
Testing Pyramid:
/\ Layer 4: GenAI Validation (comprehensive)
/ \
/UAT \ Layer 3: UAT Tests (few, slow)
/______\
/Int Tests\ Layer 2: Integration Tests (some, medium)
/__________\
/Unit Tests \ Layer 1: Unit Tests (many, fast)
See: docs/testing-layers.md for detailed layer descriptions and examples
Recommended workflow combining automated testing with manual verification.
Development Phase:
Pre-Commit (Automated):
Pre-Release (Manual):
See: docs/workflow-hybrid-approach.md for complete workflow and hybrid testing patterns
Test-Driven Development: Write tests before implementation.
TDD Workflow:
Benefits:
Test Pass Requirement:
Coverage Targets (separate from pass rate):
See: docs/tdd-methodology.md for detailed TDD workflow and test patterns
Track performance improvements over time with baseline comparisons.
Purpose:
How It Works:
See: docs/progression-testing.md for baseline format and test templates
Prevent fixed bugs from reappearing.
When to Create:
Regression Test Template:
def test_regression_issue_123_handles_empty_input():
"""
Regression test for Issue #123: Handle empty input gracefully.
Previously crashed with KeyError on empty dict.
"""
# Arrange
empty_input = {}
# Act
result = process(empty_input)
# Assert
assert result == {"status": "empty"}
See: docs/regression-testing.md for complete patterns and organization
Tests are automatically marked based on directory location. No manual @pytest.mark needed!
Tier Structure:
tests/
├── regression/
│ ├── smoke/ # Tier 0: Critical path (<5s) - CI GATE
│ ├── regression/ # Tier 1: Feature protection (<30s)
│ ├── extended/ # Tier 2: Deep validation (<5min)
│ └── progression/ # Tier 3: TDD red phase
├── unit/ # Unit tests (isolated functions)
├── integration/ # Integration tests (multi-component)
├── security/ # Security-focused tests
├── hooks/ # Hook-specific tests
└── archived/ # Obsolete tests (excluded)
Where to Put New Tests:
Is it protecting a released feature?
├─ Yes → Critical path (install, sync, load)?
│ ├─ Yes → tests/regression/smoke/
│ └─ No → tests/regression/regression/
└─ No → TDD red phase (not implemented)?
├─ Yes → tests/regression/progression/
└─ No → Single function/class?
├─ Yes → tests/unit/{subcategory}/
└─ No → tests/integration/
Run by Tier:
pytest -m smoke # CI gate (must pass)
pytest -m regression # Feature protection
pytest -m "smoke or regression" # Both
pytest -m unit # Unit tests only
Validate Categorization:
python scripts/validate_test_categorization.py --report
See: docs/TESTING-TIERS.md for complete tier definitions and examples
Directory structure, naming conventions, and testing best practices.
Naming Conventions:
test_*.pytest_*test_feature_v{VERSION}_{name}.pytest_ prefix)See: docs/test-organization-best-practices.md for detailed conventions and best practices
Common fixtures for setup/teardown and coverage measurement strategies.
Common Fixtures:
tmp_path - Temporary directorymonkeypatch - Mock environment variablescapsys - Capture stdout/stderrCoverage Targets:
Check Coverage:
pytest --cov=src --cov-report=term-missing
See: docs/pytest-fixtures-coverage.md for fixture patterns and coverage strategies
Automated testing in pre-push hooks and GitHub Actions.
Pre-Push Hook:
#!/bin/bash
pytest tests/ || exit 1
GitHub Actions:
- name: Run tests
run: pytest tests/ --cov=src --cov-report=xml
See: docs/ci-cd-integration.md for complete CI/CD integration patterns
| Pattern | Use Case | Details |
|---|---|---|
| Test Tiers | Auto-categorization | docs/TESTING-TIERS.md |
| Three-Layer Strategy | Complete testing approach | docs/three-layer-strategy.md |
| Testing Layers | Pytest pyramid | docs/testing-layers.md |
| TDD Methodology | Test-first development | docs/tdd-methodology.md |
| Progression Testing | Performance tracking | docs/progression-testing.md |
| Regression Testing | Bug prevention | docs/regression-testing.md |
| Test Organization | Directory structure | docs/test-organization-best-practices.md |
| Pytest Fixtures | Setup/teardown patterns | docs/pytest-fixtures-coverage.md |
| CI/CD Integration | Automated testing | docs/ci-cd-integration.md |
| Tier | Directory | Time Limit | Purpose |
|---|---|---|---|
| 0 (Smoke) | regression/smoke/ | <5s | CI gate, critical path |
| 1 (Regression) | regression/regression/ | <30s | Feature protection |
| 2 (Extended) | regression/extended/ | <5min | Deep validation |
| 3 (Progression) | regression/progression/ | - | TDD red phase |
| Unit | unit/ | <1s | Isolated functions |
| Integration | integration/ | <30s | Multi-component |
| Test Type | Speed | When to Use | Coverage Target |
|---|---|---|---|
| Unit | Fast (ms) | Pure functions, deterministic logic | 90%+ |
| Integration | Medium (sec) | Component interactions, workflows | 70%+ |
| UAT | Slow (min) | End-to-end scenarios, critical paths | Key flows |
| GenAI Validation | Slow (min) | Architecture validation, design review | As needed |
This skill uses progressive disclosure to prevent context bloat:
docs/*.md files with implementation details (loaded on-demand)Available Documentation:
docs/three-layer-strategy.md - Modern three-layer testing frameworkdocs/testing-layers.md - Four-layer testing pyramiddocs/workflow-hybrid-approach.md - Development and testing workflowdocs/tdd-methodology.md - Test-driven development patternsdocs/progression-testing.md - Performance baseline trackingdocs/regression-testing.md - Bug prevention patternsdocs/test-organization-best-practices.md - Directory structure and conventionsdocs/pytest-fixtures-coverage.md - Pytest patterns and coveragedocs/ci-cd-integration.md - Automated testing integrationRelated Skills:
Related Tools:
regression/smoke/ = CI gatetest_<function>_<scenario>_<expected>python scripts/validate_test_categorization.pyThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.