Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

risk-based-testing

/risk-based-testing

Decyduje, co wymaga testu, dobiera najmniejszy uczciwy zakres weryfikacji i nie osłabia sprawdzeń, żeby uzyskać zielony wynik.

Licencja
MIT
Ostatnia zmiana repozytorium
11.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 11.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Decyduje, co wymaga testu, dobiera najmniejszy uczciwy zakres weryfikacji i nie osłabia sprawdzeń, żeby uzyskać zielony wynik.

Oryginalny opis (EN)

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.

Jak działa

  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
Sekcje z nagłówków SKILL.md, w oryginale · 103 linii, 1 063 słów
Podgląd SKILL.md
---
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.

Wersje

RepozytoriumWynikLicencja
Ta strona · iWiiCK/iwiick-ai-agent-plugin100MIT
proffesor-for-testing/agentic-qe100MIT
petrkindlmann/qa-skills100MIT
qa-aman/claude-skills90MIT

Migawka bazy z 13.11.2026 · wersja paczki f589f1da4460 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100hollowtest
    Pisze testy, które nie przechodzą przy błędnym kodzie, i nigdy nie osłabia testu, żeby zmienić czerwony wynik na zielony.
  • 90test-design
    Pisze testy jednostkowe i integracyjne, które zawodzą z właściwego powodu: asercje na poziomie zachowania, wartości brzegowe, najmniejszy uczciwy dublet i deterministyczne przygotowanie oraz sprzątanie.
  • 95testing-and-verification
    Podpowiada, jak dobrać zakres weryfikacji zmiany: testy Bun czy Playwright, snapshoty, lint, formatowanie i typowanie.
  • 90eng-testing
    Ustala, czy zmiana wymaga testu, gdzie go umieścić, co ma sprawdzać i którą najmniejszą kontrolę uruchomić przed zakończeniem.
  • 100testing-strategy
    Planuje testy zmiany w kodzie: ocenia ryzyko i wybiera najmniejszy zestaw dowodów, od testów jednostkowych po ewaluację agentów.
  • 90cmux-testing
    Dobiera zakres testów cmux, dodaje testy zachowania i sprawdza cele testowe Swift w konfiguracji.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.