testing
Kapsamlı test stratejileri ve 2025 test araçları. Unit, integration, e2e ve visual testing.
npxskills add vuralserhat86/antigravity-agentic-skills--skill testingLoading…
Kapsamlı test stratejileri ve 2025 test araçları. Unit, integration, e2e ve visual testing.
npxskills add vuralserhat86/antigravity-agentic-skills--skill testingLoading…
Yazılım kalitesini sağlamak için sistematik test yaklaşımları. 2025 modern test araçları ve piramit test stratejisi.
/ \
/E2E\ ← En az (Yavaş, Pahalı, Kırılgan)
/-----\
/ INTEGR\ ← Orta (Hız ve Güven dengesi)
/---------\
/ UNIT \ ← En çok (Hızlı, Ucuz, İzole)
/-------------\
| Tip | Kapsam | Hız | Maliyet |
|---|---|---|---|
| Unit | Fonksiyon/Component | ⚡⚡⚡ | 💸 |
| Integration | DB/API/Module arası | ⚡⚡ | 💸💸 |
| E2E | Tam kullanıcı akışı | ⚡ | 💸💸💸 |
import { sum } from './math';
describe('sum function', () => {
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
test('handles zero correctly', () => {
expect(sum(0, 0)).toBe(0);
});
});
// Service mock'lama
jest.mock('./apiService');
import { fetchData } from './apiService';
test('should use mocked data', async () => {
(fetchData as jest.Mock).mockResolvedValue({ id: 1, name: 'Test' });
const data = await getServiceData();
expect(data.name).toBe('Test');
});
import request from 'supertest';
import app from './app';
describe('POST /api/users', () => {
test('should create a new user and return it', async () => {
const response = await request(app)
.post('/api/users')
.send({ email: '[email protected]', name: 'Test' });
expect(response.status).toBe(201);
expect(response.body.email).toBe('[email protected]');
});
});
import { test, expect } from '@playwright/test';
test('user can login successfully', async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="email"]', '[email protected]');
await page.fill('input[name="password"]', 'password123');
await page.click('button[type="submit"]');
await expect(page).toHaveURL('/dashboard');
await expect(page.locator('h1')).toContainText('Hoş Geldiniz');
});
// Playwright visual test
test('dashboard visual comparison', async ({ page }) => {
await page.goto('/dashboard');
await expect(page).toHaveScreenshot('dashboard.png');
});
Kaynak: Spotify's Testing Pyramid & Playwright Best Practices
| Aşama | Doğrulama |
|---|---|
| 1 | Testler "Flaky" (bazen geçen bazen kalan) özellikten arındırıldı mı? |
| 2 | Mock veriler gerçek dünya senaryolarını (Edge cases) yansıtıyor mu? |
| 3 | E2E testleri production ortamını birebir simüle ediyor mu? |
Testing v2.5 - With Workflow
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).