Agent skill

Testing Strategies

by MadAppGang in MadAppGang/claude-code

A skill your agent uses when writing tests, setting up test frameworks, implementing mocking strategies, or establishing testing best practices (unit, integration, E2E) across any technology stack.

MITAuto-check passedTesting & QA

Install Testing Strategies

skills CLI
$ npx skills add MadAppGang/claude-code --skill testing-strategies -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install MadAppGang/claude-code testing-strategies --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dev/skills/core/testing-strategies .claude/skills/testing-strategies && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-strategies
GitHub stars
285
Token cost
~2k tokens
SKILL.md length
422 words
Files
1
Skills in repo
69
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing tests, setting up test frameworks, implementing mocking strategies, or establishing testing best practices (unit, integration, E2E) across any technology stack.

  • Setting up test frameworks
  • SKILL.md covers Overview, Testing Pyramid, Test Structure: AAA Pattern and Naming Conventions, plus 5 more sections
  • Calls vitest, jest and pytest
  • Implementing mocking strategies

What it does

Testing Strategies is an agent skill from MadAppGang/claude-code. Use when writing tests, setting up test frameworks, implementing mocking strategies, or establishing testing best practices (unit, integration, E2E) across any technology stack.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test strategy and Unit testing. The repository describes itself as: claude code plugins marketplace. The licence is MIT.

When your agent uses it

  • Setting up test frameworks
  • Implementing mocking strategies
  • Establishing testing best practices (unit
  • E2E) across any technology stack

Example prompts

  • “/testing-strategies”

What it can do on your machine

Read from SKILL.md and the folder at commit 6097ad4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • vitest
    • jest
    • pytest
    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing Strategies loads about 2k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 422 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from MadAppGang/claude-code at commit 6097ad4, republished under its MIT licence (© MadAppGang). 422 words, ~2,029 tokens.

Download SKILL.mdSave it as .claude/skills/testing-strategies/SKILL.md (or your agent's skills folder).
name
testing-strategies
description
Use when writing tests, setting up test frameworks, implementing mocking strategies, or establishing testing best practices (unit, integration, E2E) across any technology stack.
version
1.0.0
keywords
testing, unit tests, integration tests, E2E testing, mocking, test coverage, test-driven development, TDD, test pyramid
plugin
dev
updated
2026-01-20

Universal Testing Strategies

Overview

Language-agnostic testing patterns and strategies applicable across all technology stacks.

Testing Pyramid

          ┌───────┐
          │  E2E  │  Few, slow, expensive
         ─┴───────┴─
        ┌───────────┐
        │Integration│  Some, medium speed
       ─┴───────────┴─
      ┌───────────────┐
      │     Unit      │  Many, fast, cheap
     ─┴───────────────┴─
Unit Tests (70-80%)
  • Test individual functions/methods in isolation
  • Mock external dependencies
  • Fast execution (< 10ms per test)
  • High volume, run on every save
Integration Tests (15-20%)
  • Test component interactions
  • Real database/API calls (often with test containers)
  • Medium speed (100ms - 1s per test)
  • Run on commit/PR
End-to-End Tests (5-10%)
  • Test complete user flows
  • Real browser/environment
  • Slow (seconds to minutes)
  • Run before deployment

Test Structure: AAA Pattern

// Arrange - Set up test data and conditions
const user = createTestUser({ email: 'test@example.com' });
const service = new UserService(mockDb);

// Act - Execute the code under test
const result = await service.createUser(user);

// Assert - Verify the expected outcome
expect(result.id).toBeDefined();
expect(result.email).toBe('test@example.com');

Naming Conventions

Test File Names
component.test.ts       # Unit tests
component.spec.ts       # Alternative convention
component.integration.ts # Integration tests
component.e2e.ts        # End-to-end tests
Test Case Names

Use descriptive names that explain the scenario:

// Pattern: should [expected behavior] when [condition]
describe('UserService', () => {
  describe('createUser', () => {
    it('should create user when valid data provided', () => {});
    it('should throw ValidationError when email is invalid', () => {});
    it('should throw DuplicateError when email already exists', () => {});
  });
});
BDD Style (Given-When-Then)
describe('User Registration', () => {
  describe('given a valid email and password', () => {
    describe('when the user submits the form', () => {
      it('then creates a new account', () => {});
      it('then sends a welcome email', () => {});
    });
  });
});

Mocking Strategies

Test Doubles Overview
TypePurposeExample
StubReturns predetermined valuesstub.returns(42)
MockVerifies interactionsexpect(mock).toHaveBeenCalled()
SpyWraps real implementationspy(realFunction)
FakeWorking implementation (simplified)In-memory database
DummyPlaceholder (not used)Required parameter
When to Mock

DO Mock:

  • External services (APIs, databases)
  • Time-dependent functions
  • Random number generators
  • File system operations
  • Network requests

DON'T Mock:

  • The code under test
  • Simple value objects
  • Pure functions with no side effects
Mock Example
typescript
// Mock external API
const mockApi = {
  getUser: jest.fn().mockResolvedValue({ id: '1', name: 'Test' })
};

// Inject mock
const service = new UserService(mockApi);
const result = await service.getUser('1');

// Verify interaction
expect(mockApi.getUser).toHaveBeenCalledWith('1');
expect(result.name).toBe('Test');

Test Data Management

Test Factories

Create reusable factory functions for test data:

typescript
// factories/user.ts
export function createTestUser(overrides = {}) {
  return {
    id: randomUUID(),
    email: `test-${Date.now()}@example.com`,
    name: 'Test User',
    createdAt: new Date(),
    ...overrides
  };
}

// In tests
const user = createTestUser({ name: 'Custom Name' });
Fixtures

Static test data for consistent testing:

typescript
// fixtures/users.ts
export const validUser = {
  email: 'valid@example.com',
  password: 'SecurePass123!'
};

export const invalidEmails = [
  'no-at-sign',
  '@no-local.com',
  'no-domain@',
  'spaces in@email.com'
];

Assertion Best Practices

Be Specific
typescript
// BAD - vague assertion
expect(result).toBeTruthy();

// GOOD - specific assertion
expect(result.success).toBe(true);
expect(result.data.id).toBe('expected-id');
One Logical Assertion Per Test
typescript
// BAD - multiple unrelated assertions
it('should process order', () => {
  expect(order.id).toBeDefined();
  expect(order.total).toBe(100);
  expect(emailService.send).toHaveBeenCalled();
  expect(inventory.reduce).toHaveBeenCalled();
});

// GOOD - focused tests
it('should assign an order ID', () => {
  expect(order.id).toBeDefined();
});

it('should calculate correct total', () => {
  expect(order.total).toBe(100);
});

it('should send confirmation email', () => {
  expect(emailService.send).toHaveBeenCalled();
});
Custom Matchers

Create domain-specific matchers for readability:

typescript
expect.extend({
  toBeValidEmail(received) {
    const pass = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(received);
    return {
      pass,
      message: () => `expected ${received} to be a valid email`
    };
  }
});

// Usage
expect('user@example.com').toBeValidEmail();

Edge Cases to Test

Input Validation
  • Empty/null/undefined inputs
  • Boundary values (0, -1, MAX_INT)
  • Invalid types
  • Malformed data
State Transitions
  • Initial state
  • After single operation
  • After multiple operations
  • After error and recovery
Async Operations
  • Successful completion
  • Timeout
  • Network errors
  • Concurrent operations
  • Race conditions
Error Handling
  • Expected errors (validation)
  • Unexpected errors (system)
  • Error recovery
  • Error propagation
Show full SKILL.md (164 more words)Show less

Code Coverage Guidelines

Coverage Targets
TypeTargetNotes
Line Coverage80%Minimum acceptable
Branch Coverage75%Test all conditionals
Function Coverage90%All public APIs
Critical Paths100%Auth, payments, data integrity
Coverage Pitfalls

High coverage ≠ good tests

typescript
// 100% coverage but useless test
it('should run without error', () => {
  processOrder(order); // No assertions!
});

Focus on:

  • Business-critical paths
  • Edge cases and error handling
  • Integration points

Test Performance

Keep Tests Fast
Test TypeTarget Time
Unit test< 10ms
Integration test< 1s
E2E test< 30s
Full suite< 5min
Parallelization
bash
# Run tests in parallel
vitest --pool=threads
jest --maxWorkers=4
pytest -n auto
go test -parallel 4
Test Isolation

Tests should not depend on each other:

typescript
// BAD - shared state
let counter = 0;
it('test 1', () => { counter++; });
it('test 2', () => { expect(counter).toBe(1); }); // Fragile!

// GOOD - isolated state
beforeEach(() => { counter = 0; });
it('test 1', () => { counter++; expect(counter).toBe(1); });
it('test 2', () => { counter++; expect(counter).toBe(1); });

CI/CD Integration

Pre-commit
  • Lint checks
  • Type checks
  • Unit tests (fast)
Pull Request
  • Full unit test suite
  • Integration tests
  • Coverage report
Pre-deployment
  • E2E tests
  • Performance tests
  • Security scans

Test Maintenance

Avoid Flaky Tests
  • Don't depend on timing
  • Don't depend on external services
  • Use deterministic data
  • Retry with care (hide real issues)
Keep Tests Readable
  • Clear naming
  • Minimal setup
  • Obvious assertions
  • Helpful failure messages
Review Test Code
  • Test code is production code
  • Apply same quality standards
  • Refactor when needed

Testing strategies applicable to all technology stacks

© MadAppGang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/dev/skills/core/testing-strategies of MadAppGang/claude-code.

Open the folder on GitHubat commit 6097ad4

Compare with similar skills

Testing Strategies next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing Strategies compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Strategies this skillMadAppGang/claude-code285—~2kAutomated safety check: PassMIT
Testing OpenLogi UIAprilNEA/OpenLogi23k—~1.1kAutomated safety check: PassApache-2.0
Testing Hashqlhashintel/hash1.7k—~1.9kAutomated safety check: PassAGPL-3.0
Dynamo Unit TestingDynamoDS/Dynamo2k—~622Automated safety check: PassApache-2.0
Handsontable Unit Testinghandsontable/handsontable22k—~1.2kAutomated safety check: PassCustom licence
Abp Testingabpframework/abp14k—~1.7kAutomated safety check: PassLGPL-3.0

Similar skills

  • Testing OpenLogi UI

    AprilNEA/OpenLogi

    Verifies OpenLogi's native GPUI interface with focused tests, the component gallery and a mock agent, choosing the evidence that fits each change.

    23k GitHub stars~1.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing Hashql

    hashintel/hash

    HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

    1.7k GitHub stars~1.9k tokensUpdated today
    Testing & QAAuto-check passed
  • Dynamo Unit Testing

    DynamoDS/Dynamo

    Write comprehensive NUnit tests for the Dynamo codebase following Dynamo testing patterns, conventions, and architectural constraints.

    2k GitHub stars~622 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Handsontable Unit Testing

    handsontable/handsontable

    Conventions for Handsontable's Jest unit and TypeScript type tests: where files go, how to run them, mocking limits and when to write an E2E test instead.

    22k GitHub stars~1.2k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Abp Testing

    abpframework/abp

    ABP testing patterns - integration tests over unit tests, GetRequiredService, IDataSeedContributor, Shouldly assertions, AddAlwaysAllowAuthorization, NSubstitute mocking, WithUnitOfWorkAsync.

    14k GitHub stars~1.7k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Agent Tester

    ruvnet/ruflo

    Agent skill for tester - invoke with $agent-tester. An agent skill from ruvnet/ruflo.

    74k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed

More from MadAppGang/claude-code

All 69 skills in this repo
  • Content Brief

    MadAppGang/claude-code

    Content brief template and creation methodology for SEO-optimized content.

    285 GitHub starsUsed in 1 repo~959 tokens
    Auto-check passed
  • Context Detection

    MadAppGang/claude-code

    A skill your agent uses when detecting project technology stack from files/configs/directory structure, auto-loading framework-specific skills, or analyzing multi-stack fullstack projects (e.g…

    285 GitHub stars~5.4k tokensUpdated 7 mo ago
    Auto-check passed
  • Content Optimizer

    MadAppGang/claude-code

    On-page SEO optimization techniques including keyword density, meta tags, heading structure, and readability.

    285 GitHub starsUsed in 1 repo~694 tokens
    Auto-check passed
  • Keyword Cluster Builder

    MadAppGang/claude-code

    Techniques for expanding seed keywords and clustering by topic and intent.

    285 GitHub starsUsed in 1 repo~674 tokens
    Auto-check passed
  • Serp Analysis

    MadAppGang/claude-code

    SERP analysis techniques for intent classification, feature identification, and competitive intelligence.

    285 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Agent Coordination Discipline

    MadAppGang/claude-code

    A skill your agent uses when deciding whether to launch an agent, selecting which agent to use, or coordinating multiple agents.

    285 GitHub stars~3.8k tokensUpdated 7 mo ago
    Auto-check passed

Categories

Questions about Testing Strategies

What does Testing Strategies do?

A skill your agent uses when writing tests, setting up test frameworks, implementing mocking strategies, or establishing testing best practices (unit, integration, E2E) across any technology stack. Testing Strategies is an agent skill from MadAppGang/claude-code. Use when writing tests, setting up test frameworks, implementing mocking strategies, or establishing testing best practices (unit, integration, E2E) across any technology stack.

When should I use Testing Strategies?

Testing Strategies fits situations like: setting up test frameworks; implementing mocking strategies; establishing testing best practices (unit; E2E) across any technology stack.

How do I install Testing Strategies in Claude Code?

Run `npx skills add MadAppGang/claude-code --skill testing-strategies -a claude-code`. Or copy the skill folder (plugins/dev/skills/core/testing-strategies in MadAppGang/claude-code) into .claude/skills/testing-strategies in your project. Claude Code loads it when a task matches its description.

How do I install Testing Strategies in Codex?

Run `npx skills add MadAppGang/claude-code --skill testing-strategies -a codex`. Or copy the skill folder (plugins/dev/skills/core/testing-strategies in MadAppGang/claude-code) into .agents/skills/testing-strategies in your project. Codex loads it when a task matches its description.

Can I use Testing Strategies in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MadAppGang/claude-code --skill testing-strategies -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-strategies, .gemini/skills/testing-strategies, .github/skills/testing-strategies and .opencode/skills/testing-strategies in your project.

What does Testing Strategies need to run?

Going by SKILL.md and its folder, Testing Strategies needs the command-line tools its instructions call (vitest, jest, pytest and go).

Does Testing Strategies access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing Strategies safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing Strategies use?

Testing Strategies is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing Strategies use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing Strategies?

Skills that share tags, products or a category with Testing Strategies: Testing OpenLogi UI (AprilNEA/OpenLogi, 23k stars), Testing Hashql (hashintel/hash, 1.7k stars), Dynamo Unit Testing (DynamoDS/Dynamo, 2k stars) and Handsontable Unit Testing (handsontable/handsontable, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Strategies?

MadAppGang (a GitHub organization) maintains it in MadAppGang/claude-code, which has 285 GitHub stars. The repository holds 69 skills in this directory. The repository was last updated on March 15, 2026.

Source: MadAppGang/claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.