testing-workflow
БесплатноБез исполняемых скриптовНе проверенRun and manage functional tests (unit, integration, E2E, mutation) and verify FR/NFR test completeness. Use when running tests, debugging test failures…
от VilnaCRM-Org★ 16 звёзд на GitHubОб этом скилле
Testing Workflow Skill
Context (Input)
- Code changes require test validation
- Test failures need debugging
- Coverage/mutation targets must be met
- FR/NFR positive, negative, edge, security, performance, and operability cases must be covered
Task (Function)
Execute appropriate test suite and ensure 100% pass rate with required coverage, mutation strength, deterministic tests, and explicit FR/NFR case coverage.
Note: For K6 load/performance testing, see load-testing skill.
Test Commands Quick Reference
| Test Type | Command | Runtime | Coverage | Location |
|---|---|---|---|---|
| Unit | make unit-tests |
2-3 min | 100% | tests/Unit/ |
| Integration | make integration-tests |
3-5 min | Full | tests/Integration/ |
| E2E (Behat) | make behat |
5-10 min | BDD | features/ |
| All Tests | make all-tests |
8-15 min | 100% | All |
| Mutation | make infection |
Variable | 100% MSI | Unit tests |
Load Testing: Use load-testing skill for K6 performance tests.
Execution Workflow
Step 0: Build Requirement Test Matrix
Before adding or accepting tests for a PR:
- Extract FRs/NFRs from PRD, stories, architecture, docs, PR description, and changed behavior.
- Generate positive, negative, and edge cases for each requirement.
- Add NFR-specific cases for security, availability, performance, scalability, interoperability, observability, operability, maintainability, and compatibility.
- Map each case to an automated test, CI check, mutation/coverage evidence, contract/spec validation, or load/performance run.
- Record manual evidence only as supporting context. It does not satisfy automated coverage.
- Treat unmapped applicable cases as missing coverage. Implement tests or mark the review blocked.
Step 1: Run Tests
make unit-tests # For quick validation
make all-tests # For comprehensive check
Step 2: Check Results
- ✅ All Pass + 100% coverage → Complete
- ⚠️ All Pass but matrix gaps → Add missing cases before completion
- ❌ Failures detected → Go to Step 3
Step 3: Debug Failures
Identify failure type and apply fix:
| Failure Type | Debug Command | Common Fixes |
|---|---|---|
| Assertion failure | PHPUnit output | Fix logic, update test expectations |
| Coverage < 100% | Coverage report | Add missing test cases |
| Escaped mutants | make infection output |
Test edge cases, strengthen assertions |
| Behat scenario | Feature output | Fix application logic or step definitions |
| Type error | Stack trace | Fix type hints, mock returns |
| Matrix gap | FR/NFR matrix | Add positive, negative, edge, or NFR case |
| Flaky risk | Test inspection | Remove timing/order/env/shared-state risk |
Step 4: Fix and Re-test
# Fix the code/tests
make unit-tests # Re-run to verify fix
Repeat Steps 2-4 until all tests pass with 100% coverage.
Mutation Testing (Infection)
Goal: 100% Mutation Score Indicator (MSI) - Zero escaped mutants
Run Mutation Tests
make infection
Fix Escaped Mutants
- Review mutation diff in output
- Add test case for uncaught mutation
- Strengthen assertion specificity
- Consider refactoring for testability
Example: If mutant changes > to >=, add boundary test case.
Faker Usage in Tests
Setup: Tests extend UnitTestCase which provides $this->faker
// Good - Dynamic test data
$this->faker->email();
$this->faker->lexify('??'); // 2 random letters
$this->faker->unique()->ulid();
// Bad - Hardcoded values
'[email protected]'
'AB'
Available:
$this->faker->ulid()- Domain ULID via custom provider- All standard Faker methods (email, name, word, etc.)
Load Testing
Commands:
make smoke-load-tests # Minimal load, 5-10 min
make average-load-tests # Normal traffic, 15-25 min
make stress-load-tests # High load, 20-30 min
make spike-load-tests # Extreme spikes, 25-35 min
Prerequisites:
- Test database seeded (
make setup-test-db) - Docker containers running (
make start) - K6 Docker image built
Flaky-Test Review
Every new or changed test must be inspected for deterministic behavior.
Reject or fix tests with:
- Sleeps, unbounded waits, wall-clock assumptions, or timezone/locale dependence.
- Shared mutable state, non-unique IDs, rate-limit leakage, or order dependency.
- External network calls in unit/integration tests.
- Random test data not generated through pro
Установить testing-workflow в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл testing-workflow?
Run and manage functional tests (unit, integration, E2E, mutation) and verify FR/NFR test completeness. Use when running tests, debugging test failures, ensuring test coverage, fixing mutation testing issues, checking flaky-test risk, or mapping requirements to positive/negative/edge automated coverage. Covers PHPUnit, Behat, and Infection. For K6 load/performance tests, use the load-testing skill instead.
Как установить скилл testing-workflow?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testing-workflow запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic