Skip to content
Skills Library
Programming · Testing

risk-based-testing

/risk-based-testing

Decide what deserves a test and what does not, choose the smallest honest verification scope, and never weaken a check to get green. Use whenever adding, changing, running, pruning or reporting on tests, and when deciding how much to verify before handing work back.

Licence
MIT
Last repository change
11.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Decide what deserves a test and what does not, choose the smallest honest verification scope, and never weaken a check to get green. Use whenever adding, changing, running, pruning or reporting on tests, and when deciding how much to verify before handing work back.

Original author description

Decide what deserves a test and what does not, choose the smallest honest verification scope, and never weaken a check to get green. Use whenever adding, changing, running, pruning or reporting on tests, and when deciding how much to verify before handing work back.

How it works

  1. What deserves a test
  2. Verification scope — what to run before handing back
  3. Never weaken a check
  4. Writing a test that is worth having
  5. Reporting
  6. Forbidden
Original SKILL.md headings · 103 lines, 1,063 words
SKILL.md preview
---
name: risk-based-testing
description: Decide what deserves a test and what does not, choose the smallest honest verification scope, and never weaken a check to get green. Use whenever adding, changing, running, pruning or reporting on tests, and when deciding how much to verify before handing work back.
---

# Risk-based testing

Test count is not a quality target. Coverage percentage is not a quality target. The only thing worth optimising is **the chance that a real regression is caught before a user sees it**, divided by the cost of maintaining the tests that catch it.

Two separate questions, answered separately:

1. **What deserves a test?** — risk tiers, below.
2. **What must I run before handing back?** — verification scope, below.

Craft questions — is this test fast, isolated, clear, asserting one concept — belong to `clean-tests`.

## What deserves a test

### Mandatory — a regression here is a real incident

Cover the changed invariant with a focused test, every time:

- **Authorisation and access control** — who may do what, and what happens when they may not.
- **Tenancy, account or ownership boundaries** — anything that could leak one customer's data to another. Assert the scoping, not just the happy path.
- **Query construction and parameter binding** — injection safety, and that the scope predicate is actually present.
- **Money** — payments, pricing, fees, totals, currency, rounding, tax.
- **Persistence and migrations** — data that must survive, and transformations that cannot be re-run.
- **Integration payloads** — the shape you send to and accept from another system.
- **Shared utilities with many consumers** — the blast radius does the arguing for you.
- **Any bug you just fixed** — a test that fails on the old code and passes on the new.

### Judgement — test when the logic can break silently

Stores, resolvers, reducers, state machines, non-trivial component logic, data transformations, caching and invalidation, concurrency and ordering. Add a focused test when there is meaningful branching, a race, a transformation that could silently corrupt, or a failure mode that produces wrong output rather than an error.

A new file or function is not, by itself, a reason for a test.

### Do not test — the cost exceeds the value

Labels, copy, styling, class names, layout, render-only wrappers, prop pass-through, routine wiring of a field into an established form, and anything a type checker already proves. Use typecheck for shape errors and review or manual inspection for appearance.

The exception that is **not** presentational: if the change affects accessibility behaviour, permissions, what is submitted, or what is stored, it is behaviour. Test the behaviour, not the markup.

### Before writing any test, answer this

> *What realistic regression does this catch, and does existing coverage already catch it?*

If you cannot name the regression, do not write the test. If existing coverage catches it, extend that test rather than adding a file.

## Verification scope — what to run before handing back

Pick the smallest scope that honestly covers the behavioural risk, and **say which you picked and why**. Scope follows risk, never file count or which directory you happened to edit.

- **Presentation only** — review the diff, check the affected surface manually where possible. Run existing tests only where they exercise behaviour you actually changed.
- **Scoped behaviour (the default)** — every new or changed test file, plus existing tests covering the changed behaviour and its directly affected consumers. Select by real dependency and failure risk, not by everything that imports a shared barrel.
- **Critical behaviour** — the mandatory list above. Verify the affected safety properties and the relevant end-to-end boundaries with targeted tests. Shared contracts and test infrastructure also need a representative consumer check and a state-reset check.

Plus whatever the project requires always: formatting, lint, typecheck for the changed packages and for consumers when a shared contract changed.

**The full suite is CI's job, not a routine local gate.** Run everything locally only when the human asks, or when a specific cross-cutting risk genuinely cannot be bounded by a focused scope — and explain that risk before you start. Touching a core package, editing three files, or changing test configuration is not by itself a reason to run everything.

Run the chosen scope **once, at the end** of a multi-phase change, not between phases (`implementation`).

## Never weaken a check

Not under any deadline, not to get a green run:

- No skipping, no `only`, no commenting out, no quarantining without agreement.
- No widened timeouts, tolerances or retries to mask flakiness. A flaky test is a bug report about the code or the test — treat it as one.
- No deleted assertions, especially the safety ones.
- No snapshot that replaces a real assertion.
- No loosened types or disabled lint rules to get past a failure.

Fix the production bug rather than changing the expectation — **unless** the behaviour change was deliberate, in which case update the test and say clearly in the handoff that you changed an expectation and why.

Pruning tests is legitimate — obsolete, redundant or purely presentational coverage can go — but only with an explicit rationale and the human's approval for the named deletions. Deleting a *failing* test is never pruning.

## Writing a test that is worth having

Assert outcomes and safety properties, not implementation structure. A test coupled to internals fails when you refactor and passes when you break behaviour — the exact opposite of useful.

Each test should be able to fail for one real reason. Prefer deterministic inputs over randomness; inject the variable rather than depending on real bucketing, real clocks, real networks or real databases. Use the project's existing fakes and stubs; never reach a live service from a unit test.

Mirror the project's test layout and naming conventions exactly.

## Reporting

```
Risk tier:    <tier> — <why it applies>
Ran:          <exact commands, and results>
New coverage: <what it protects, and the regression it catches>
Not run:      <what you deliberately skipped, and why that is acceptable>
Failures:     <each one, classified: my regression / pre-existing / environment>
```

If you added no tests, say why in one line. That is a legitimate outcome, but silence is not.

## Forbidden

- Writing a test without being able to name the regression it catches.
- Adding tests to satisfy a count, a quota or a coverage target.
- Testing labels, classes, layout or prop pass-through.
- Reporting a pass broader than what you ran.
- Skipping, weakening or deleting a check to get green.
- Deleting a failing test instead of investigating it.
- Connecting to a live service from a unit test.

Versions

RepositoryScoreLicence
This page · iWiiCK/iwiick-ai-agent-plugin100MIT
proffesor-for-testing/agentic-qe100MIT
petrkindlmann/qa-skills100MIT
qa-aman/claude-skills90MIT

Database snapshot: 13.11.2026 · package version f589f1da4460 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100hollowtest
    Write tests that actually fail when the code is wrong, and never make a red test green by weakening it. Use whenever you write, change, fix, or review tests (Jest, Vitest, Mocha, node:test, Playwright, Testing Library), when asked to "add tests", "increase coverage", or "make…
  • 90test-design
    Write unit and integration tests that fail for the right reason — behaviour-level assertions, boundary values, the smallest honest double, deterministic setup and teardown. Use when adding tests for new code, pinning a bug before fixing it, or repairing tests that stay green…
  • 95testing-and-verification
    Use when adding or running tests, checking snapshots, choosing between Bun tests and Playwright, running lint/format/typecheck, or deciding the verification scope for a change.
  • 90eng-testing
    Decide whether a change needs a test, where it lives, what it asserts, and which check to run before calling it done. Use when adding, moving, or reviewing a unit, component, integration, story, or end-to-end test, or choosing the smallest check to run before a PR.
  • 100testing-strategy
    Use when planning or reviewing tests for a code change, choosing between unit, focused regression, integration, contract, end-to-end, performance, security, property-based, or agent-evaluation checks; classify change risk first and select the smallest evidence set that proves…
  • 90cmux-testing
    Choose scoped cmux verification, add behavioral tests, and validate Swift test targets and wiring. Use when adding tests or deciding what local/CI evidence a change needs.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.