Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

principle-test-behavior-not-implementation

/principle-test-behavior-not-implementation

Ustala w testach to, co widzą użytkownicy kodu, aby test padał, gdy zachowanie się psuje, a przechodził przy zmianach wnętrza.

Repozytorium
clients ↗
Licencja
MIT
Ostatnia zmiana repozytorium
10.11.2026

Ocena i bezpieczeństwo

81/ 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ść16 / 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 10.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

Ustala w testach to, co widzą użytkownicy kodu, aby test padał, gdy zachowanie się psuje, a przechodził przy zmianach wnętrza.

Oryginalny opis (EN)

Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change. Use for /principle-test-behavior-not-implementation.

Jak działa

SKILL.md bez nagłówków drugiego poziomu · 17 linii, 418 słów

Podgląd SKILL.md
---
name: principle-test-behavior-not-implementation
description: "Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change. Use for /principle-test-behavior-not-implementation."
---
# Test Behavior, Not Implementation

A test is a claim about what the code does for its users: a caller, an end user, or another service. Behavior is what those users can observe through the interface they use. That includes return values, errors, state they can read back, and effects on systems outside the code, such as a request sent, a row written, or a message emitted. Implementation is what they cannot observe: private helpers, internal call order, intermediate data, and which internal collaborator did the work.

Slash `/principle-test-behavior-not-implementation` only. Not a session flag.

Judge each test against two imagined edits:

- **Break the behavior.** Make the code return a wrong value, skip an effect, or do the effect twice. If the test still passes, it proves nothing. The usual causes are an assertion looser than the contract, an expected value computed by the code under test, a restated constant or prompt string that never runs the code that reads it, and an assertion on data that the test built itself.
- **Change the internals.** Keep every observable result the same and restructure the code underneath. If the test now fails, it is pinned to the implementation. It will need a rewrite on every refactor and still catches no bug.

Keep a test that catches the first edit and survives the second. Rewrite or delete the rest. To write a test that does both, drive the code through its users' interface with a concrete input. Derive the expected value from the requirement, not from a run of the code. Assert what the contract promises, no less and no more.

The contract decides, not the shape of the assertion. When "an empty cart never charges" is the promise, an assertion that the payment client got no call is behavior. Pair it with a case where the charge happens, so that the test shows it can see a call. The payload that a mocked external service receives is behavior, because that service observes it. A call to an internal helper is implementation, because no user can see it. An empty list is the exact answer when no record matches, and a hollow check when the test only needs some result. An exact error message pins wording that no caller reads. The error type that callers branch on is the contract.

A test can pin an invariant instead of a call, such as a key that must exist in two tables or a compile-time type check. The invariant is the behavior.

Wersje

RepozytoriumWynikLicencja
Ta strona · workerstack/clients81MIT
koolamusic/claudefiles96MIT
alexanderop/pstack96MIT
requie/endostack90MIT
chmonitor/chmonitor86GPL-3.0
tommy-ca/pstack86MIT
arjitj2/open-pstack81MIT
michael-denyer/pstack-claude81MIT
xinhi6716/axiom-atropos81MIT

Migawka bazy z 13.11.2026 · wersja paczki c7e453bd17b9 (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

  • 100principle-test-behavior
    Pisze lub przegląda testy sprawdzające zachowanie, którego wymaga wymaganie, przez publiczny interfejs kodu, i wykrywające prawdziwy błąd.
  • 100write-tests
    Pisze testy sprawdzające zachowanie produktu, bez zależności od szczegółów implementacji i wartości konfiguracji.
  • 100write-tests
    Pisze testy sprawdzające zachowanie produktu, bez zależności od szczegółów implementacji i wartości konfiguracji.
  • 90write-tests
    Pisze testy, które przypinają realne zachowanie zamiast szczegółów implementacji, wartości konfiguracji czy szczęśliwych próbek, także przy testach regresji i naprawie kruchych lub niestabilnych testów.
  • 90test-the-site
    Pisze testy, które sprawdzają prawdziwe zachowanie zamiast szczegółów implementacji, wartości konfiguracji i przypadkowych próbek.
  • 90write-tests
    Pisze testy zachowania produktu zamiast szczegółów implementacji i wartości konfiguracji, a także naprawia kruche testy.

Uwagi i zgłoszenia

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