moai-ref-testing-pyramid

Provides test pyramid strategy, coverage targets, and test pattern reference for quality validation.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/jjjh7401/AI-Lighting_Console --skill moai-ref-testing-pyramid-jjjh7401
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-ref-testing-pyramid
Source: https://github.com/jjjh7401/AI-Lighting_Console/tree/main/.claude/skills/moai-ref-testing-pyramid
Command: npx skills add https://github.com/jjjh7401/AI-Lighting_Console --skill moai-ref-testing-pyramid-jjjh7401

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often struggle with unbalanced test suites, unclear coverage targets, and inconsistent test patterns, leading to slow feedback loops and unreliable quality gates. ## Core Features & Use Cases - Test Pyramid Ratios: Defines the 70/20/10 distribution across unit, integration, and E2E tests with speed and maintenance trade-offs. - Coverage Targets by Context: Sets concrete coverage goals from 95%+ for critical business logic down to 0% for generated code. - Test Patterns Reference: Documents AAA structure, table-driven tests, mocks, testcontainers, property-based testing, and TDD RED-GREEN-REFACTOR rules. - Use Case: When writing tests for a new API endpoint, consult this reference to decide the right test level, apply the AAA pattern, and verify the suite meets the 90%+ endpoint coverage target. ## Quick Start Ask the agent to review the current test suite against the testing pyramid reference and recommend coverage targets for each module.

Frequently Asked Questions about moai-ref-testing-pyramid

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

FAQPage Schema
What is the ideal test pyramid ratio for unit, integration, and E2E tests?▼

The recommended distribution is 70% unit tests, 20% integration tests, and 10% E2E tests. Unit tests run under 100ms each, integration tests take 1-5 seconds, and E2E tests cover only critical user journeys.

How do I structure tests using the AAA pattern?▼

AAA stands for Arrange, Act, Assert: set up test data and preconditions, execute the function under test, then verify the outcome. This structure keeps tests readable and separates setup from verification logic.

What code coverage target should I aim for?▼

Coverage targets depend on context: 95%+ for critical business logic, 90%+ for API endpoints, 85%+ for utilities, 80%+ for UI components, and 60%+ for glue code. Generated code requires no testing.

Should I mock external dependencies in unit tests?▼

Yes, mock at boundaries such as databases and APIs to keep unit tests fast and deterministic. Reserve real dependencies for integration tests using tools like testcontainers or in-memory databases.

Why is 100% code coverage not a good quality goal?▼

Coverage measures execution, not correctness. A test that runs code without meaningful assertions provides zero value, so branch coverage and mutation scores are better quality indicators than raw line coverage.

What should I do about flaky tests in my suite?▼

Fix the flakiness or quarantine the test with a tracking issue. Flaky tests erode trust in the entire suite, and the target flaky rate should stay below 1% based on CI history analysis.