Jeffallan/claude-skills / skills/test-master
test-master
VerifiedGenerates test files, creates mocking strategies, analyzes code coverage, designs test architectures, and produces test plans and defect reports across functional, performance, and security testing disciplines. Use when writing unit tests, integration tests, or E2E tests; creating test strategies or automation frameworks; analyzing coverage gaps; performance testing with k6 or Artillery; security testing with OWASP methods; debugging flaky tests; or working on QA, regression, test automation, quality gates, shift-left testing, or test maintenance.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.1 KB |
| references/automation-frameworks.md | markdown | 7.2 KB |
| references/e2e-testing.md | markdown | 4.8 KB |
| references/integration-testing.md | markdown | 2.7 KB |
| references/performance-testing.md | markdown | 2.6 KB |
| references/qa-methodology.md | markdown | 6.2 KB |
| references/security-testing.md | markdown | 3.3 KB |
| references/tdd-iron-laws.md | markdown | 4.3 KB |
| references/test-reports.md | markdown | 2.3 KB |
| references/testing-anti-patterns.md | markdown | 6.4 KB |
| references/unit-testing.md | markdown | 2.7 KB |
references/security-testing.md
View on GitHub# Security Testing
## Authentication Tests
```typescript
describe('Authentication Security', () => {
it('rejects invalid credentials', async () => {
await request(app)
.post('/api/login')
.send({ email: 'user@test.com', password: '<wrong-password>' })
.expect(401);
});
it('rejects expired tokens', async () => {
const expiredToken = createExpiredToken();
await request(app)
.get('/api/protected')
.set('Authorization', `Bearer ${expiredToken}`)
.expect(401);
});
it('rejects tampered tokens', async () => {
const tamperedToken = validToken.slice(0, -5) + 'xxxxx';
await request(app)
.get('/api/protected')
.set('Authorization', `Bearer ${tamperedToken}`)
.expect(401);
});
it('enforces rate limiting on login', async () => {
for (let i = 0; i < 6; i++) {
await request(app)
.post('/api/login')
.send({ email: 'user@test.com', password: '<wrong-password>' });
}
await request(app)
.post('/api/login')
.send({ email: 'user@test.com', password: '<test-password>' })
.expect(429);
});
});
```
## Authorization Tests
```typescript
describe('Authorization', () => {
it('denies access to other users resources', async () => {
await request(app)
.get('/api/users/other-user-id/data')
.set('Authorization', `Bearer ${userAToken}`)
.expect(403);
});
it('denies admin routes to regular users', async () => {
await request(app)
.delete('/api/admin/users/123')
.set('Authorization', `Bearer ${regularUserToken}`)
.expect(403);
});
});
```
## Input Validation Tests
```typescript
describe('Input Validation', () => {
it('rejects SQL injection attempts', async () => {
await request(app)
.get('/api/users')
.query({ search: "'; DROP TABLE users; --" })
.expect(400);
});
it('rejects XSS in input fields', async () => {
const response = await request(app)
.post('/api/posts')
.send({ title: '<script>alert("xss")</script>' })
.expect(201);
expect(response.body.title).not.toContain('<script>');
});
it('validates file upload types', async () => {
await request(app)
.post('/api/upload')
.attach('file', 'malicious.exe')
.expect(400);
});
});
```
## Security Headers Test
```typescript
describe('Security Headers', () => {
it('sets security headers', async () => {
const response = await request(app).get('/');
expect(response.headers['x-content-type-options']).toBe('nosniff');
expect(response.headers['x-frame-options']).toBe('DENY');
expect(response.headers['strict-transport-security']).toBeDefined();
});
});
```
## Security Test Checklist
| Category | Tests |
|----------|-------|
| **Auth** | Invalid creds, token expiry, tampering |
| **Input** | SQL injection, XSS, command injection |
| **Access** | IDOR, privilege escalation |
| **Rate Limit** | Brute force, API abuse |
| **Headers** | CSP, HSTS, X-Frame-Options |
| **Data** | PII exposure, error messages |
## Quick Reference
| Vulnerability | Test Approach |
|---------------|---------------|
| SQL Injection | `'; DROP TABLE--` in inputs |
| XSS | `<script>alert(1)</script>` |
| IDOR | Access other user's resources |
| CSRF | Missing/invalid tokens |
| Auth Bypass | Missing auth, expired tokens |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |