Moai Ref Testing Pyramid logo

Moai Ref Testing Pyramid

OrganizationPopular
modu-ai
moai-ref-testing-pyramid

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Agent-extending skill that amplifies manager-develop test-creation and quality-validation work with production-grade testing patterns. NOT for: production code implementation, architecture design, DevOps, security audits.

Overview

Publishermodu-ai
Repositorymoai-adk
Skill namemoai-ref-testing-pyramid
Stars
1.2K
Forks
226
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by modu-ai on GitHub. Read the source before you install it.

Installation

Install the Moai Ref Testing Pyramid AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-ref-testing-pyramid
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/modu-ai/moai-adk.git /tmp/moai-adk
mkdir -p .claude/skills
cp -r /tmp/moai-adk/.claude/skills/moai-ref-testing-pyramid .claude/skills/moai-ref-testing-pyramid
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Moai Ref Testing Pyramid in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Moai Ref Testing Pyramid on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Moai Ref Testing Pyramid is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Testing Pyramid Reference

Target Agents

  • manager-develop - applies patterns during test creation, coverage analysis, and RED-GREEN-REFACTOR cycles

Test Pyramid Ratios

       /  E2E  \        10% — Critical user journeys only
      /----------\
     / Integration \    20% — API endpoints, DB queries, service boundaries
    /----------------\
   /    Unit Tests    \  70% — Functions, hooks, utilities, pure logic
  /--------------------\
LevelSpeedReliabilityMaintenanceCoverage Target
UnitFast (<100ms)HighLow70% of tests
IntegrationMedium (1-5s)MediumMedium20% of tests
E2ESlow (10-60s)LowerHigh10% of tests

Coverage Targets by Context

ContextTargetRationale
Critical business logic95%+Revenue/security impact
API endpoints90%+Contract compliance
Utility functions85%+Reuse reliability
UI components80%+Rendering correctness
Configuration/glue code60%+Low complexity
Generated code0%Don't test generated code

Test Pattern: AAA (Arrange-Act-Assert)

// Arrange: Set up test data and preconditions
input := CreateTestUser("test@example.com")

// Act: Execute the function under test
result, err := service.CreateUser(ctx, input)

// Assert: Verify the outcome
assert.NoError(t, err)
assert.Equal(t, "test@example.com", result.Email)

Unit Test Patterns

PatternWhenExample
Table-DrivenMultiple input/output combinationsGo: tests := []struct{...}
Mock/StubExternal dependencies (DB, API)Interface injection, mock frameworks
SnapshotComplex output comparisonJest snapshots, golden files
Property-BasedMathematical propertiesquickcheck, hypothesis
Boundary ValueEdge cases0, -1, MAX_INT, empty string, nil

Integration Test Patterns

PatternWhenExample
TestcontainersReal DB neededDocker-based PostgreSQL for tests
HTTP Test ServerAPI endpoint testinghttptest.NewServer (Go), supertest (Node)
In-Memory DBFast DB testsSQLite for development
Fixture LoadingConsistent test dataFactory functions, seed files

What to Test vs What NOT to Test

ALWAYS Test

  • Business logic and calculations
  • Input validation and error handling
  • Authentication and authorization flows
  • Data transformations and mappings
  • Edge cases and boundary conditions
  • Race conditions (with -race flag in Go)

NEVER Test

  • Framework internals (React rendering, Express routing)
  • Third-party library behavior
  • Simple getters/setters with no logic
  • Private methods directly (test via public API)
  • Generated code (protobuf, swagger)
  • CSS styling and layout (use visual regression tools instead)

Test Quality Metrics

MetricTargetTool
Line Coverage85%+go test -cover, istanbul, coverage.py
Branch Coverage75%+go test -covermode=count
Mutation Score70%+go-mutesting, Stryker
Test Execution Time<2 min (unit), <10 min (all)CI timer
Flaky Test Rate<1%CI history analysis

Test File Conventions

LanguageTest FileLocation
Go*_test.goSame package
TypeScript*.test.ts / *.spec.ts__tests__/ or co-located
Pythontest_*.pytests/ directory
Java*Test.javasrc/test/ mirror
Rust#[cfg(test)] mod testsSame file or tests/

TDD RED-GREEN-REFACTOR Quick Reference

RED:     Write a failing test that defines expected behavior
GREEN:   Write minimal code to make the test pass
REFACTOR: Clean up while keeping tests green

Rules:

  • Never write production code without a failing test
  • Write the smallest test that fails
  • Write the simplest code that passes
  • Refactor only when all tests are green
  • One assertion per test (when practical)

Common Rationalizations

RationalizationReality
"E2E tests cover everything, unit tests are redundant"E2E tests are slow and flaky. Unit tests provide fast, precise feedback. The pyramid exists because each level serves a different purpose.
"Integration tests are more realistic than unit tests"Realism comes at the cost of speed and isolation. A balanced pyramid gives both fast feedback and realistic validation.
"100% code coverage means the code is well tested"Coverage measures execution, not correctness. A test that executes code without meaningful assertions provides zero value.
"Mocking is bad, I prefer real dependencies"Real dependencies make tests slow and non-deterministic. Mock at boundaries, test business logic in isolation.
"This test is flaky, but it catches real bugs sometimes"Flaky tests erode trust in the entire suite. Fix the flakiness or quarantine the test with a tracking issue.

DAMP over DRY: Test code should be descriptive and self-contained. A reader should understand the test without reading shared fixtures or helper methods.

Red Flags

  • Test pyramid inverted: more E2E tests than unit tests
  • Unit tests depend on external services (databases, APIs, file systems)
  • Test assertions check implementation details instead of behavior
  • No integration tests between unit and E2E layers
  • Flaky test present without a quarantine label or tracking issue

Verification

  • Test distribution follows the pyramid: unit > integration > E2E (show test counts per category)
  • Unit tests run in under 30 seconds total
  • Integration tests mock external dependencies at the boundary
  • No flaky tests in the active suite (run 3x to verify stability)
  • Test names describe behavior, not implementation (review naming convention)
  • Coverage report shows meaningful assertions, not just line execution

Frequently asked questions

What does the Moai Ref Testing Pyramid AI skill do?

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Agent-extending skill that amplifies manager-develop test-creation and quality-validation work with production-grade testing patterns. NOT for: production code implementation, architecture design, DevOps, security audits.

Why use Moai Ref Testing Pyramid on TypingMind?

Because you install it once and use it with any model. Moai Ref Testing Pyramid is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Moai Ref Testing Pyramid in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-ref-testing-pyramid. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Moai Ref Testing Pyramid?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Moai Ref Testing Pyramid?

As many as you like. As long as a model supports skills, you can use Moai Ref Testing Pyramid with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Moai Ref Testing Pyramid AI skill free?

Yes. It is published on GitHub by modu-ai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇