testing-strategies
Skill2 starsChanged 4 months agoMITView on GitHub
Testing Strategies — unit tests, integration tests, E2E testing, contract testing, visual regression, property-based testing, mutation testing, test design patterns, CI/CD integration. Use when designing test strategies or writing comprehensive tests.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
- ldaume/agentic-engineering-harnesstheir own version, first seen Oct 20, 2026
- mejbaurbahar/software-tester-skillstheir own version, first seen Oct 13, 2026
- AgentJDrew/claude-skill-kittheir own version, first seen Jul 6, 2026
- fabioc-aloha/alex-cognitive-architecturetheir own version, first seen Apr 26, 2026
- terrene-foundation/pacttheir own version, first seen Apr 6, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- theexperiencecompany/gaia★ 325same name
- ldaume/agentic-engineering-harness★ 3same name
- harrissohail6/claude-code-config★ 1same name
- mejbaurbahar/software-tester-skills★ 1same name
- Typeless-Git/skills★ 1same name
- AgentJDrew/claude-skill-kit★ 0same name
- fabioc-aloha/alex-cognitive-architecture★ 0same name
- terrene-foundation/pact★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository383 other files it gives its agents.
- 37signals-waySkill
- ab-test-analysisSkill
- advisor-orchestrator-workerSkill
- ai-ml-engineeringSkill
- algorithmic-artSkill
- analyze-feature-requestsSkill
- animation-vocabularySkill
- apple-designSkill
- emil-design-engSkill
- find-animation-opportunitiesSkill
- improve-animationsSkill
- pick-ui-librarySkill
- prototypeSkill
- review-animationsSkill
- ansoff-matrixSkill
- api-and-interface-designSkill
- api-design-best-practicesSkill
- app-store-changelogSkill
- auth-authorizationSkill
- beachhead-segmentSkill
- blue-ocean-strategySkill
- brainstorm-experiments-existingSkill
- brainstorm-experiments-newSkill
- brainstorm-ideas-existingSkill
- brainstorm-ideas-newSkill
- brainstorm-okrsSkill
- brand-guidelinesSkill
- browser-testing-with-devtoolsSkill
- bug-hunt-swarmSkill
- business-modelSkill
- canvas-designSkill
- ci-cd-and-automationSkill
- claude-apiSkill
- clean-architectureSkill
- clean-codeSkill
- cli-creatorSkill
- code-review-and-qualitySkill
- code-review-skillSkill
- code-simplificationSkill
- cohort-analysisSkill
- cold-start-problemSkill
- commit-archaeologistSkill
- competitive-battlecardSkill
- competitor-analysisSkill
- contagiousSkill
- context-engineeringSkill
- continuous-discoverySkill
- architecture-blueprint-generatorSkill
- azure-architecture-autopilotSkill
- cli-masterySkill
- codeqlSkill
- conventional-commitSkill
- create-implementation-planSkill
- csharp-asyncSkill
- diagnoseSkill
- dotnet-best-practicesSkill
- draw-io-diagram-generatorSkill
- git-commitSkill
- github-actions-efficiencySkill
- java-springbootSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 53
Isolated: No shared state, independent order
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing Strategies Skill
Test Pyramid (Practical)
╱╲
╱ E2E ╲ ~5% — Critical user journeys
╱────────╲
╱ Integration ╲ ~15% — API, DB, external services
╱────────────────╲
╱ Unit Tests ╲ ~80% — Isolated functions, components
╱────────────────────────╲Unit Testing
AAA Pattern
// Arrange-Act-Assert
describe('UserService.register', () => {
it('should create user and send welcome email', async () => {
// Arrange
const emailService = { sendWelcome: vi.fn() };
const repo = { findByEmail: vi.fn().mockResolvedValue(null), save: vi.fn() };
const service = new UserService(repo, emailService);
// Act
const user = await service.register({ email: 'test@test.com', name: 'Test' });
// Assert
expect(user.email).toBe('test@test.com');
expect(repo.save).toHaveBeenCalledWith(expect.objectContaining({ email: 'test@test.com' }));
expect(emailService.sendWelcome).toHaveBeenCalledWith(user.id);
});
});Test Doubles Guide
| Type | Description | When to Use |
| Dummy | Passed but not used | Filling parameter lists |
| Fake | Working implementation (in-memory DB) | Slower tests but more confidence |
| Stub | Returns canned answers | When you need a specific response |
| Spy | Records calls made | Verifying interactions |
| Mock | Pre-programmed with expectations | Behavior verification |
F.I.R.S.T Principles
- Fast: Tests should run quickly (< 100ms per test)
- Isolated: No shared state, independent order
- Repeatable: Same result every time
- Self-validating: Pass/fail, no manual check
- Timely: Written before or alongside production code
Integration Testing
Database Integration (Testcontainers)
import { PostgreSqlContainer } from '@testcontainers/postgresql';
describe('UserRepository', () => {
let container: StartedPostgreSqlContainer;
let pool: Pool;
beforeAll(async () => {
container = await new PostgreSqlContainer('postgres:16-alpine')
.withDatabase('testdb')
.start();
pool = new Pool({ connectionString: container.getConnectionUri() });
await runMigrations(pool);
}, 30000);
afterAll(async () => {
await pool.end();
await container.stop();
});
it('should persist and retrieve user', async () => {
const repo = new UserRepository(pool);
const user = await repo.create({ email: 'test@test.com' });
expect(user.id).toBeDefined();
const found = await repo.findById(user.id);
expect(found.email).toBe('test@test.com');
});
});API Integration (Supertest)
import request from 'supertest';
import app from '../app';
describe('POST /api/auth/login', () => {
it('should return 200 with token for valid credentials', async () => {
const res = await request(app)
.post('/api/auth/login')
.send({ email: 'admin@test.com', password: 'password123' })
.expect(200);
expect(res.body).toHaveProperty('token');
expect(res.body.user.email).toBe('admin@test.com');
});
it('should return 401 for invalid password', async () => {
await request(app)
.post('/api/auth/login')
.send({ email: 'admin@test.com', password: 'wrong' })
.expect(401);
});
});E2E Testing (Playwright)
Page Object Model
class LoginPage {
constructor(private page: Page) {}
async goto() { await this.page.goto('/login'); }
async fillEmail(email: string) { await this.page.fill('[data-testid="email"]', email); }
async fillPassword(password: string) { await this.page.fill('[data-testid="password"]', password); }
async submit() { await this.page.click('[data-testid="login-button"]'); }
async getErrorMessage() { return this.page.textContent('[data-testid="error"]'); }
}
test('successful login', async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.fillEmail('user@test.com');
await loginPage.fillPassword('correct-password');
await loginPage.submit();
await expect(page).toHaveURL('/dashboard');
});API Mocking (MSW)
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';
const server = setupServer(
http.get('https://api.example.com/users/:id', ({ params }) => {
return HttpResponse.json({ id: params.id, name: 'Test User' });
}),
);
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());Contract Testing (Pact)
// Provider
await provider.verify({
state: 'user exists',
uponReceiving: 'a request for user',
withRequest: { method: 'GET', path: '/users/123' },
willRespondWith: { status: 200, body: { id: '123', name: 'Test' } },
});
// Consumer
await pact.addInteraction({
state: 'user exists',
uponReceiving: 'get user by id',
withRequest: { method: 'GET', path: '/users/123' },
willRespondWith: { status: 200, headers: { 'Content-Type': 'application/json' } },
});Performance Testing (k6)
import http from 'k6/http';
import { check, sleep, group } from 'k6';
import { Rate, Trend } from 'k6/metrics';
const errorRate = new Rate('errors');
const latency = new Trend('latency_ms');
export const options = {
stages: [
{ duration: '2m', target: 50 }, // Ramp up
{ duration: '5m', target: 50 }, // Stay
{ duration: '2m', target: 100 }, // Spike
{ duration: '2m', target: 0 }, // Ramp down
],
thresholds: {
http_req_duration: ['p(95)<500', 'p(99)<1000'],
errors: ['rate<0.01'],
},
};
export default function () {
group('user API', () => {
const res = http.get('https://api.example.com/users');
latency.add(res.timings.duration);
errorRate.add(res.status !== 200);
check(res, { 'status 200': (r) => r.status === 200 });
});
sleep(1);
}Visual Regression Testing
// Playwright visual comparison
test('homepage matches snapshot', async ({ page }) => {
await page.goto('/');
await page.waitForLoadState('networkidle');
await expect(page).toHaveScreenshot('homepage.png', {
maxDiffPixelRatio: 0.01,
threshold: 0.2,
});
});Mutation Testing (Stryker)
npx stryker run
# Killed mutants: 385/420 = 91.7% mutation score
# Goal: > 80% mutation scoreCoverage Goals
| Type | Line Coverage | Branch Coverage | Mutation Score |
| Core domain | 100% | 100% | 95%+ |
| Services | 95%+ | 90%+ | 90%+ |
| Components | 90%+ | 85%+ | 85%+ |
| Controllers/API | 90%+ | 80%+ | 80%+ |
| Configuration | 60%+ | 50%+ | 50%+ |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

