agentleFS
pvnarppvnarp/agent-skills/skills/testing/SKILL.md

testing

Skill1 starsChanged 9 months agoMITView on GitHub

Defines testing strategy and helps write tests. Covers what is unit testable, what requires manual or integration testing, test structure, and testing principles. Use when writing tests, deciding what to test, or reviewing test coverage.

123 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use oss-pr, pr-automation and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CES-LtdSkill

    oss-pr

    Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.

    Also in 3 projects that use this

  • CES-LtdSkill

    pr-automation

    PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    cicd

    Continuous integration and delivery pipelines

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    networking

    Practical application and coding skills for Networking

    Also in 3 projects that use this

  • Cogni-AI-OUSkill

    dotfiles

    Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.

    Also in 3 projects that use this

  • pluginagentmarketplaceSkill

    microservices

    Microservices architecture patterns and best practices. Service decomposition, inter-service communication, and distributed data management.

    Also in 3 projects that use this

  • +2 more from CES-Ltd

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 105 edited versions we read keep these.

  • 5

    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:

    Test logic, not framework: Don't test that the framework works.

    line 38
  2. Distinctive:

    Every important constant gets a test: If someone accidentally changes a threshold, rate, or limit, a test should catch it.

    line 39
  3. Distinctive:

    Tests run in CI: Every PR must pass tests before merge.

    line 41
  4. Distinctive:

    No flaky tests: If a test sometimes fails, delete it and write a better one.

    line 42
  5. Distinctive:

    No mocking internals: Test the public interface.

    line 44

“Common” is measured: kept by at least 6 in 10 of the 105 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 Strategy

Know what to test automatically and what to test manually. Don't write flaky tests for inherently non-deterministic or subjective things.

What IS Unit Testable

Pure logic with no external dependencies:

  • Business rules: Calculations, validation, state transitions, algorithms
  • Data transformations: Parsing, formatting, mapping, serialization
  • Edge cases: Boundary values, empty inputs, overflow, null handling
  • Configuration: Feature flags, threshold values, constants that affect behavior

What Needs Integration Tests

  • Database queries and migrations
  • API request/response cycles
  • Authentication and authorization flows
  • File system operations
  • Message queue producers/consumers

What is NOT Automatically Testable (Manual Only)

AreaWhyHow to Test
Visual appearanceSubjective qualityEyes on screen
UX flowSubjective feelUser testing
Performance feelHardware-dependentProfiling + real usage
Third-party integrationsExternal stateStaging environment

Testing Rules

  1. Test logic, not framework. Don't test that the framework works. Test that your logic produces correct results.
  2. Every important constant gets a test. If someone accidentally changes a threshold, rate, or limit, a test should catch it.
  3. Boundary tests everywhere. Off-by-one errors are the most common bugs. Test both sides of every boundary.
  4. Tests run in CI. Every PR must pass tests before merge. No exceptions.
  5. No flaky tests. If a test sometimes fails, delete it and write a better one. Flaky tests are worse than no tests.
  6. Keep tests fast. Unit test suite should complete in seconds. No sleeps, no network, no unnecessary I/O.
  7. No mocking internals. Test the public interface. Mock external dependencies only.
  8. Test behavior, not implementation. Tests should pass even after refactoring internals.

Test Structure

src/
  ├── main/          # Production code
  └── test/          # Tests mirror the source structure
      ├── unit/      # Fast, isolated, no external deps
      ├── integration/  # Requires running services
      └── e2e/       # Full system tests

Utility Scripts

  • scripts/coverage_gaps.sh [dir] - Find source files that have no corresponding test file.

Coverage Targets

AreaTargetRationale
Core business logic> 90%Bugs here directly impact users
Data transformations> 90%Wrong data = wrong behavior
API handlers> 70%Test happy path + key error paths
UI components~30%Test logic, verify manually
Configuration/glue~0%Low value, test indirectly

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.