Create testing pyramid with unit/integration/E2E strategy. Define coverage targets and high-risk testing. Use when planning tests for features.
From testingnpx claudepluginhub sethdford/claude-skills --plugin engineer-testingThis skill is limited to using the following tools:
examples/example-output.mdtemplate.mdEnables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Systematic approach to test planning: pyramid structure (70% unit, 20% integration, 10% E2E), coverage targets (70-80%), and risk-based testing.
You are planning test coverage for a feature. Your role is to:
Good testing builds confidence, not false security. 100% coverage often means testing trivia instead of business logic.
Based on Martin Fowler, Google Testing, and J.B. Rainsberger:
Unit Tests (70% of tests):
test_calculate_discount_rate_returns_0_05_for_vip()Integration Tests (20% of tests):
test_user_registration_saves_to_database()E2E Tests (10% of tests):
test_checkout_flow_creates_order_and_sends_confirmation()Ask: "What breaks the business?"
High-risk areas:
Low-risk areas:
Realistic targets:
Total target: 70-80% for whole codebase.
Don't chase 100%. Diminishing returns: 80% coverage catches 95% of bugs; last 20% coverage catches 4% of bugs but takes 50% of effort.
For each function/method:
Example (Order::apply_discount):
For each business flow:
Example (User registration):
For critical user journeys only:
Avoid: Every button click, every error message, every combination. E2E tests are brittle and slow.
Create a matrix showing coverage targets:
| Area | Unit | Integration | E2E | Coverage Target |
|---|---|---|---|---|
| User registration | 10 | 3 | 1 | 90% |
| Payment processing | 15 | 5 | 1 | 95% |
| Reporting | 5 | 2 | 1 | 70% |
When planning tests, deliver:
Feature: Users can create orders with discount codes, apply taxes, and process payments.
E2E (10%): 2 tests
- Checkout flow end-to-end
- Order with discount code
Integration (20%): 8 tests
- Order creation saves to DB
- Payment gateway integration
- Email notifications sent
Unit (70%): 28 tests
- Discount calculation
- Tax calculation
- Validation (email, quantity, amount)
- Payment amount calculation
| Area | Target | Rationale |
|---|---|---|
| Discount logic | 95% | High-risk: affects revenue |
| Tax logic | 90% | High-risk: affects revenue |
| Payment integration | 95% | High-risk: money involved |
| Order persistence | 85% | Medium-risk: data integrity |
| Email notifications | 60% | Low-risk: cosmetic |
| Error handling | 80% | Medium-risk: user experience |
Overall target: 80% code coverage
Discount Calculation:
test_calculate_discount_returns_0_05_for_vip_code()test_calculate_discount_returns_0_10_for_premium_code()test_calculate_discount_raises_for_invalid_code()test_calculate_discount_returns_0_for_no_code()test_calculate_discount_handles_max_discount()Tax Calculation:
test_calculate_tax_returns_correct_rate()test_calculate_tax_zero_for_tax_exempt_item()test_calculate_tax_accumulates_for_multiple_items()test_calculate_tax_rounds_correctly()Validation:
test_validate_email_rejects_invalid_format()test_validate_quantity_rejects_zero()test_validate_quantity_rejects_negative()test_validate_amount_rejects_zero()test_validate_amount_rejects_negative()...13 more unit tests
test_create_order_saves_to_database()test_order_persistence_retrieves_correct_data()test_payment_gateway_processes_valid_payment()test_payment_gateway_rejects_invalid_card()test_payment_failure_rolls_back_order()test_email_service_sends_order_confirmation()test_email_service_sends_payment_receipt()test_concurrent_orders_dont_interfere()test_complete_checkout_flow() — Cart → Payment → Confirmationtest_checkout_with_discount_code() — Apply code → discounted price → success