property-based-testing
/property-based-testing
Generuje wiele danych wejściowych do testowania niezmienników w całej dziedzinie, a shrinking redukuje porażki do minimalnego przypadku.
- Autor
- Amey-Thakur ↗
- Repozytorium
- AI-SKILLS ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 05.09.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Generuje wiele danych wejściowych do testowania niezmienników w całej dziedzinie, a shrinking redukuje porażki do minimalnego przypadku.
Oryginalny opis (EN)
Generate many inputs to test invariants that must hold across a whole domain, and let shrinking reduce failures to a minimal case. Use when a rule should hold for all inputs, not just the few examples you would think to write.
Jak działa
- Method
- Checks
- Boundaries
Podgląd SKILL.md
--- name: property-based-testing description: Generate many inputs to test invariants that must hold across a whole domain, and let shrinking reduce failures to a minimal case. Use when a rule should hold for all inputs, not just the few examples you would think to write. --- # Property-based testing Example tests check the cases you thought of. Property-based testing checks the ones you did not: a framework generates hundreds of inputs and asserts a property that must hold for every one. It is how you surface the empty string, the max integer, the surrogate-pair character, and the leap second that break code passing all your hand-picked examples. The work is stating properties worth checking and writing generators that reach the interesting inputs. ## Method 1. **Assert invariants, not specific outputs.** Strong properties are relations true for all inputs: `decode(encode(x)) == x` for a round trip, `sort(xs)` is ordered and a permutation of `xs`, output never exceeds a bound. You rarely predict the exact result, you constrain it. 2. **Reach for known property shapes.** Round trip, invariant preservation, a comparison against a slow but obvious oracle, and idempotence (`f(f(x)) == f(x)`) cover most cases. Pick the shape before you write the generator. 3. **Write generators that hit the corners.** Use Hypothesis, fast-check, or QuickCheck to build inputs, and bias them toward zero, empty, negatives, Unicode, and boundary sizes. A generator that only makes tidy medium values tests nothing your examples missed. 4. **Trust shrinking, then read the minimal case.** On failure the framework reduces the input to the smallest that still fails, `""` or `[0, 0]` rather than a 300-element mess. That minimal case usually names the bug outright, so read it before touching the code. 5. **Pin every failure as a regression example.** The framework records the failing seed, but also add the shrunk input as an explicit example test so the exact case stays covered after you fix it and the generator moves on. 6. **Constrain to the valid domain, not past it.** Filter or construct inputs to the precondition with `assume(n > 0)` or a positive-int generator. Over-wide generators either drown in discards or test behavior the function never promised. ## Checks - Does the property still read as one sentence about all inputs, or is it secretly a single example? - When it fails, does the shrunk case point at the real bug rather than incidental noise? - Do the generators actually produce empty, boundary, and out-of-order inputs, confirmed by inspecting a sample? ## Boundaries Properties complement example tests, they do not replace them: keep readable example tests for the documented behaviors and add properties where a rule spans the domain. To grade how strong the resulting tests are, defer to mutation-testing. Generator libraries differ, so follow the project's.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · Amey-Thakur/AI-SKILLS | 100 | MIT |
| laurigates/claude-plugins | 100 | MIT |
| craftos-dev/craftbot | 100 | MIT |
| bdfinst/agentic-dev-team | 100 | MIT |
| TomerAberbach/claude-config | 100 | MIT |
| vibeeval/vibecosystem | 100 | MIT |
| jacob-balslev/skill-graph | 100 | Apache-2.0 |
| foryourhealth111-pixel/Vibe-Skills | 95 | Apache-2.0 |
| redhatproductsecurity/prodsec-skills | 91 | Apache-2.0 |
Migawka bazy z 28.10.2026 · wersja paczki 627fc74c5b95 (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
- 90hegel
Pisze testy oparte na właściwościach w Ruście, Go, C++, TypeScript, Javie i OCaml, sprawdzające niezmienniki na wielu danych. - 95hypothesis-testing
Prowadzi testowanie własności biblioteką Hypothesis do wykrywania przypadków brzegowych i walidacji niezmienników w złożonej logice z wieloma danymi wejściowymi. - 100property-based-test
Pisze testy oparte na własnościach, modelu i warunkach wyścigu dla niezmienników na wielu danych (parsery, serializery, arytmetyka dat, sortowanie, automaty stanów, współbieżność) we frameworku repozytorium. - 100cscheck
Pomaga pisać i upraszczać testy właściwości, testy oparte na modelu i wykonywalne specyfikacje w C# z CsCheck: generatory, shrinking, sekwencje poleceń i odtwarzanie błędów. - 100pbt-strategy
Pomaga pisać testy oparte na własnościach w Pythonie z Hypothesis: szuka niezmienników, pisze strategie @given i testuje systemy stanowe. - 90quality-property-based-testing
Podpowiada w testach opartych na właściwościach: testach generatywnych, fuzzingu, QuickCheck i fast-check oraz testowaniu niezmienników.