agentleFS
ldaumeldaume/agentic-engineering-harness/skills/testing/testing-strategies/SKILL.md

testing-strategies

Skill3 starsChanged 3 months agoMITView on GitHub

Plans pragmatic test coverage across unit, integration, contract, e2e, visual, accessibility, performance, and smoke tests based on risk and behavior. Use when deciding what to test, designing a test pyramid, adding coverage for a feature, reducing flaky tests, or reviewing QA strategy.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this when the question is not just "write a test" but "what kind of signal should prove this works?"

    line 8
  2. Distinctive:

    Read existing test commands, frameworks, CI gates, fixtures, test helpers, and coverage conventions.

    line 19
  3. Distinctive:

    Prefer the cheapest test that catches the likely regression.

    line 22
  4. Distinctive:

    Do not chase coverage percentage when behavior risk is elsewhere.

    line 24
  5. Distinctive:

    Test through public interfaces.

    line 44
  6. Distinctive:

    Keep test data explicit and local to the test where possible.

    line 53
  7. Distinctive:

    Run an offline evaluation of an advice, retrieval, or agent system against historical outcomes as of each item's date: only records, …

    line 65
  8. Distinctive:

    Add regression tests before bug fixes when feasible.

    line 73
  9. Distinctive:

    Delete or rewrite tests that only assert implementation trivia.

    line 85
  10. Distinctive:

    no test for auth, migration, or data ownership changes

    line 102

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Testing Strategies

Use this when the question is not just "write a test" but "what kind of signal should prove this works?"

Testing starts while framing behavior and risk, not after implementation. Use examples, experiments, threat or failure models, executable checks, and production signals as one continuous learning system.

Project Fit Check

Before planning tests:

  1. Read existing test commands, frameworks, CI gates, fixtures, test helpers, and coverage conventions.
  2. Identify the changed behavior, risk, blast radius, and public interface.
  3. Prefer the cheapest test that catches the likely regression.
  4. Match the repo's existing layers unless the task is to improve them.
  5. Do not chase coverage percentage when behavior risk is elsewhere.

Risk To Test Mapping

RiskBest signal
pure logicunit test
schema or API contractcontract/schema test
database/repository behaviorintegration test
queue/workflow behaviorworker or workflow fixture test
user journeye2e test
layout/a11y regressionbrowser/accessibility test
deployment boot pathbuild or smoke test
auth, permissions, or abusenegative + integration test
migration or data integrityrehearsal + invariant test
resilience and operabilityfailure, load, recovery, or smoke test
AI behaviorrepresentative eval + guardrail signal

Rules

  • Test through public interfaces.
  • Give behavioral tests explicit Given/When/Then semantics: Given states the relevant preconditions, When applies one meaningful stimulus, and Then asserts observable behavior. Express this through test names, structure, or local helpers; mandatory comments and framework-specific GWT libraries add no value.
  • Apply the same semantics to contract, property, migration, load, recovery, and end-to-end tests: controlled context, action or disturbance, observable result or invariant.
  • Keep test data explicit and local to the test where possible.
  • Mock internals only when the boundary is genuinely external or expensive.
  • Synchronize on the work, not on a duration. Where the interface returns before the work it started is finished - a response that begins streaming while the producer keeps writing, a task that outlives the call - wait for that work to complete before asserting. A sleep that passes at 95 ms and fails at 100 ms is not a flaky test; it is a deterministic race the machine's speed decides, and calling it flakiness sends the fix to the wrong place.
  • A negative assertion needs an instrument that would notice the positive. "Nothing was fetched" proves nothing when the fake signals the breach by throwing and the code under test catches a failure as an ordinary outcome. Count the reaches on the fake and assert zero.
  • Run an offline evaluation of an advice, retrieval, or agent system against historical outcomes as of each item's date: only records, comments, and states that existed before the cutoff, or future knowledge inflates the score. Exclude or flag undated sources. Filter interim or holding replies out of the reference set.
  • Trust a model judge's number only after an explicit rubric (including when "unanswerable" is allowed), a check against a second judge, and agreement with human labels.
  • Add regression tests before bug fixes when feasible.
  • Define the cheapest decisive signal before or with the behavior it guides; do not create a downstream QA handoff.
  • Pair pre-release checks with the telemetry and observation window needed to detect production-only failure and outcome drift.
  • Autonomous gates return bounded, secret-safe, actionable failure context: identify the failed boundary, concise safe reason, correlated evidence, and retry or rollback decision without exposing secrets, untrusted payloads, or unbounded logs.
  • A prototype may prove a learning hypothesis with experiment evidence. It needs production tests and controls before any code is promoted or rebuilt for release.
  • Delete or rewrite tests that only assert implementation trivia.
  • Track flaky tests as product risk, not background noise.

Review Checklist

  • Does the test fail for the bug or risk it claims to cover?
  • Does it still pass if internals are refactored safely?
  • Is setup smaller than the behavior under test?
  • Is the assertion user-, contract-, or system-visible?
  • Can CI run it reliably?

Red Flags

  • coverage added only by testing private helpers
  • brittle snapshots for dynamic UI
  • mocks that make the real integration untested
  • e2e test used where a unit test would be clearer
  • no test for auth, migration, or data ownership changes

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.