testing-strategy
БесплатноБез исполняемых скриптовНе проверенComprehensive testing strategy covering unit, integration, E2E, security, accessibility, and performance testing for web applications
от Hack23★ 15 звёзд на GitHubОб этом скилле
Testing Strategy Skill
Purpose
Defines comprehensive testing approaches for web applications, ensuring code quality, security, accessibility, and performance through automated and manual testing practices.
Rules
Testing Pyramid (MUST Follow)
/\
/E2E\ ← Few, slow, expensive (UI tests)
/------\
/Integration\ ← More, moderate speed (API, DB tests)
/------------\
/ Unit Tests \ ← Many, fast, cheap (function/method tests)
/------------------\
Distribution:
- 70% Unit Tests (fast, isolated, many)
- 20% Integration Tests (moderate speed, component interaction)
- 10% E2E Tests (slow, full user journeys)
Unit Testing Standards
MUST:
Coverage Requirements:
- Minimum 80% code coverage
- 100% coverage for critical paths
- Test all public APIs
- Test error handling
- Test edge cases
Test Structure (AAA Pattern):
// Arrange - Set up test data
const user = { name: 'Alice', role: 'admin' };
// Act - Execute the code under test
const result = validateUser(user);
// Assert - Verify the outcome
expect(result.valid).toBe(true);
JavaScript/TypeScript (Jest):
describe('UserValidator', () => {
describe('validateEmail', () => {
it('should accept valid email addresses', () => {
expect(validateEmail('[email protected]')).toBe(true);
});
it('should reject invalid email addresses', () => {
expect(validateEmail('invalid-email')).toBe(false);
});
it('should handle null input gracefully', () => {
expect(validateEmail(null)).toBe(false);
});
});
});
Python (pytest):
class TestUserValidator:
def test_validate_email_accepts_valid_addresses(self):
assert validate_email('[email protected]') is True
def test_validate_email_rejects_invalid_addresses(self):
assert validate_email('invalid-email') is False
def test_validate_email_handles_none(self):
assert validate_email(None) is False
Integration Testing
MUST TEST:
Component Integration:
- Database queries and transactions
- API endpoint functionality
- External service integration
- Cache behavior
- Message queue processing
API Testing Example (Supertest):
describe('POST /api/users', () => {
it('should create new user with valid data', async () => {
const response = await request(app)
.post('/api/users')
.send({ email: '[email protected]', name: 'Test' })
.expect(201);
expect(response.body).toHaveProperty('id');
expect(response.body.email).toBe('[email protected]');
});
});
End-to-End (E2E) Testing
Critical User Journeys:
Web Applications:
- User registration and login
- Core feature workflows
- Checkout and payment flows
- Form submissions
- File uploads/downloads
Playwright Example:
test('user can complete checkout', async ({ page }) => {
await page.goto('/shop');
await page.click('[data-testid="add-to-cart"]');
await page.click('[data-testid="checkout"]');
await page.fill('[name="email"]', '[email protected]');
await page.fill('[name="card"]', '4242424242424242');
await page.click('button[type="submit"]');
await expect(page.locator('.success-message')).toBeVisible();
});
Security Testing
MUST INCLUDE:
1. Static Analysis Security Testing (SAST)
- CodeQL scanning
- SonarQube security rules
- Bandit (Python), ESLint security plugins
2. Dependency Scanning
- npm audit / pip-audit
- Dependabot alerts
- OWASP Dependency-Check
3. Dynamic Analysis Security Testing (DAST)
- OWASP ZAP scans
- Burp Suite Professional
- Penetration testing
4. Common Vulnerabilities
- SQL Injection tests
- XSS (Cross-Site Scripting) tests
- CSRF protection verification
- Authentication/authorization tests
- Input validation tests
Security Test Example:
describe('Authentication Security', () => {
it('should prevent SQL injection in login', async () => {
const maliciousInput = "admin' OR '1'='1";
const response = await request(app)
.post('/api/login')
.send({ username: maliciousInput, password: 'test' })
.expect(401);
});
it('should protect against XSS in user input', () => {
const xssPayload = '<script>alert("XSS")</script>';
const sanitized = sanitizeInput(xssPayload);
expect(sanitized).not.toContain('<script>');
});
});
Accessibility Testing
MUST TEST:
WCAG 2.1 AA Compliance:
- Keyboard navigation (Tab, Enter, Esc, Arrow keys)
- Screen reader compatibility
- Color contrast ratios (4.5:1 normal, 3:1 large text)
- Form labels and ARIA attributes
- Focus management
- Semantic HTML
Automated Tools:
- axe-core (Playwright axe, Jest axe)
- Lighthouse accessibility audits
- Pa11y
Manual Testing:
- Keyboard-only navigation
- Screen reader testing (NVDA, JAWS, VoiceOver)
- Zoom to 200% without horizontal scroll
- Ta
Установить testing-strategy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл testing-strategy?
Comprehensive testing strategy covering unit, integration, E2E, security, accessibility, and performance testing for web applications
Как установить скилл testing-strategy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testing-strategy запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic