testing-strategies

Guides selection and implementation of unit, integration, E2E, and contract tests across languages.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/masermediagroup-stack/maser-media --skill testing-strategies-masermediagroup-stack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: testing-strategies
Source: https://github.com/masermediagroup-stack/maser-media/tree/main/.cursor/skills/community/ai-design-components/skills/testing-strategies
Command: npx skills add https://github.com/masermediagroup-stack/maser-media --skill testing-strategies-masermediagroup-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams struggle to decide which test types to write, how to balance the test pyramid, and how to manage test data, mocking, and CI integration without ending up with slow, flaky suites. ## Core Features & Use Cases - Test Type Decision Frameworks: Decision trees and feature-based tables for choosing unit, integration, E2E, or contract tests. - Multi-Language Patterns: Concrete examples for TypeScript (Vitest, Playwright, MSW), Python (pytest, hypothesis), Go, and Rust. - Test Data & Mocking Strategies: Guidance on fixtures, factories, property-based testing, ephemeral databases, and API mocking. - Use Case: When building a new checkout feature, use this Skill to decide which parts need unit tests (price calculation), integration tests (payment API with mocked Stripe), and a single E2E test for the full purchase flow. ## Quick Start Ask the AI to design a testing strategy for your new feature, specifying your language and framework, and it will recommend the right mix of unit, integration, and E2E tests with example code.

Frequently Asked Questions about testing-strategies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between unit, integration, and E2E tests?▼

Use unit tests for pure functions and isolated business logic, integration tests for API endpoints and database operations, and E2E tests only for critical user journeys like checkout or login. The decision tree maps each feature type to the appropriate test level.

What is the ideal test pyramid distribution?▼

The traditional guideline is 60-70% unit tests, 20-30% integration tests, and 10% E2E tests. Microservices architectures shift toward 60/30/10 with contract tests validating service boundaries.

When should I use property-based testing instead of fixtures?▼

Use property-based testing with tools like hypothesis, fast-check, or proptest for complex algorithms, parsers, and validators where edge cases are hard to anticipate. Use fixtures for known scenarios and regression tests requiring deterministic data.

Should I mock the database in integration tests?▼

No, integration tests should use real ephemeral databases via Docker testcontainers or in-memory SQLite to validate actual queries and transactions. Mock only external APIs using tools like MSW or pytest-httpserver.

Why are my E2E tests flaky and how do I fix them?▼

Flakiness usually comes from timing issues and unstable selectors. Use Playwright's built-in auto-wait instead of hardcoded sleeps, select elements with data-testid attributes, and add retry logic for network requests.

Is 100% code coverage a good target?▼

No, chasing 100% coverage leads to testing trivial code and false confidence. Aim for risk-based targets: 90%+ for critical business logic, 80%+ for API endpoints, and 70-80% overall, optionally validated with mutation testing.