Test Design logo

Test Design

Community
adamentwistle
test-design

What to test and how — regression test fails first, boundary tables, behavior over implementation, boundary-only mocks, the mock-echo trap, proving new tests can fail. Use when writing or reviewing tests, adding regression coverage for a fix, asked "is this tested?", raising coverage, or judging whether a green suite protects anything. Not for deciding whether the code itself is correct — that is debugging.

Overview

Publisheradamentwistle
Repositoryfable-skills
Skill nametest-design
Stars
98
Forks
11
Bundled files
Instructions only
LicenseMIT
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 adamentwistle on GitHub. Read the source before you install it.

Installation

Install the Test Design 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/adamentwistle/fable-skills/tree/main/test-design
  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/adamentwistle/fable-skills.git /tmp/fable-skills
mkdir -p .claude/skills
cp -r /tmp/fable-skills/test-design .claude/skills/test-design
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Test Design 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 Test Design 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 Test Design 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.

Test Design

Weak test design looks like: mirror the happy path, assert the code did what it does, mock everything so it runs fast, call it covered. Strong test design asks of every test: "what realistic mistake would make this fail?" A test no plausible mistake can fail is ballast.

What to test (priority order)

  1. The bug you just fixed — a regression test that fails on the pre-fix code. Write it FIRST, run it, paste the failing assertion, then fix. If you fixed first, revert the fix (git stash or comment it out), run the test, confirm red, restore. A "regression test" that was never seen red proves nothing.
  2. The contract, at its boundaries — for each input: empty/zero/null, one, many, max, just-past-max, wrong type/shape, duplicate, unicode/whitespace where strings. Write it as a table: input → expected. Boundaries are where implementations disagree with intentions.
  3. The failure paths — what the code does when its dependency errors, times out, returns malformed data. Untested error handling is usually broken error handling.
  4. The invariant — a property that must hold across all inputs (sorted output stays sorted, money sums preserved, scrubbed text contains no digits). One property test or loop-over-cases beats five example tests.

Test behavior, not implementation

Assert on observable outcomes (return values, emitted events, state visible to callers, rendered output) — not on internals (which private method was called, call order, intermediate structure). Implementation-coupled tests break on every refactor while catching no bugs, training everyone to update tests reflexively — which is how real regressions slip through.

Heuristic: could someone rewrite the function body correctly and keep your test green? They should be able to.

Mock discipline

  • Mock at the boundary you don't own (network, clock, randomness, filesystem) — not your own logic. Mocking your own modules tests the mocks.
  • The mock-echo trap: a test that stubs getX to return 42 and then asserts the result contains 42 tests nothing but the stub. Every mocked test needs real logic under test between stub and assertion.
  • Fix time and randomness explicitly (injected clock/seed) — tests that pass "most of the time" are worse than no tests.
  • Keep mock shapes honest: when the real dependency's response shape changes, grep for its mocks — a green suite against a stale mock is a false green.

Structural rules

  • One behavior per test; the name states the expectation ("rejects expired proposal") not the method ("test handleProposal 2").
  • Arrange–act–assert, visible in the test body. Shared setup helpers are fine; shared assertions hidden in helpers obscure what's protected.
  • Assert a specific value. not.toThrow(), toBeDefined(), is not None, or a snapshot nobody read are near-zero-information assertions.
  • Tests must not depend on each other or on execution order; each builds its own state and cleans up (or uses fresh fixtures).
  • Deterministic first: no real network, no real sleeps (use fake timers), no shared global state across files.

Before reporting

  1. Confirm the runner collected them: the reported test count rose by the number you added. A misnamed file or unregistered module produces a green run that ran nothing.
  2. Prove one can fail: for each new group, break the code under test deliberately (flip a comparison, return a constant), rerun, see red, revert — even when no bug is being fixed.
  3. Report the gap: name each test and the mistake it catches, and list the paths you consciously left untested. "Added tests" without this is not a coverage claim.

Calibrate quantity

A tiny pure function needs 1–3 boundary cases, not twelve. A gnarly state machine or money-handling path deserves the full table, failure paths, and an invariant. Match the project's existing test idioms and runner conventions — a beautifully designed test in the wrong framework style is a maintenance burden.

Frequently asked questions

What does the Test Design AI skill do?

What to test and how — regression test fails first, boundary tables, behavior over implementation, boundary-only mocks, the mock-echo trap, proving new tests can fail. Use when writing or reviewing tests, adding regression coverage for a fix, asked "is this tested?", raising coverage, or judging whether a green suite protects anything. Not for deciding whether the code itself is correct — that is debugging.

Why use Test Design on TypingMind?

Because you install it once and use it with any model. Test Design 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 Test Design in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/adamentwistle/fable-skills/tree/main/test-design. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Test Design?

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 Test Design?

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

Is the Test Design AI skill free?

Yes. It is published on GitHub by adamentwistle under the MIT 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 👇