AgentStack
SKILL verified MIT Self-run

Testing Principles

skill-wtsi-hgi-agentskills-testing-principles · by wtsi-hgi

Shared guidance for behaviour-focused tests in TDD, regression fixes, acceptance-test implementation, flaky test fixes, and test review. Use when writing, updating, stabilizing, or reviewing tests, or briefing another agent about tests, especially when deciding whether a cleanup/removal request needs a new test.

No reviews yet
0 installs
3 views
0.0% view→install

Install

$ agentstack add skill-wtsi-hgi-agentskills-testing-principles

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Testing Principles? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Testing Principles

Core Rule

Use tests to declare desired behaviour and prove the system has that behaviour. Prefer supported boundaries: public APIs, CLI output, HTTP contracts, rendered UI, persisted state, emitted files, errors, or other effects visible to users, callers, or downstream steps.

Avoid

Do not write tests whose only claim is an implementation detail: private helpers, source layout, filenames, imports, CSS classes, deleted files, removed functions, removed routes, removed modules/processes, or the mere absence of an old feature.

Flaky Tests

Treat a flaky test as a bug in the test suite or product, not as a reason to skip coverage. Do not skip, quarantine, xfail, delete, or loosen the test until it no longer proves behaviour.

You may reimplement a flaky test to make it deterministic when the replacement preserves the spirit of what the original test was trying to prove. Prefer stable user-visible boundaries and remove nondeterminism by controlling clocks, randomness, ordering, external services, async waits, or fixture setup.

Cleanup and Removal

If a user asks to remove obsolete implementation or get rid of a previously implemented feature, first identify the desired behaviour after the change.

  • If supported behaviour changes, write a failing test for the new desired

behaviour.

  • If supported behaviour does not change, do not invent a new test that asserts

old artifacts are gone. State why no new test is appropriate, then run the existing behavioural tests and quality gates.

Review Rule

Reject tests that pass by coupling to implementation details, hardcoded results, stubs that bypass the behaviour under test, or assertions that only prove old artifacts are absent. Accept a cleanup/removal with no new test only when the implementor explicitly justifies that no supported behaviour changed and the existing behavioural tests and quality gates pass. Reject flaky-test changes that merely skip, quarantine, delete, or weaken the check instead of preserving its behavioural intent.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.