property-based-testing

Solid

Use when writing tests for serialization, validation, normalization, or pure functions - provides property catalog, pattern detection, and library reference for property-based testing

Testing & QA 218 stars 27 forks Updated 3 weeks ago

Install

View on GitHub

Quality Score: 80/100

Stars 20%
78
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
0
Description 5%
100

Skill Content

# Property-Based Testing ## Overview Property-based testing (PBT) generates random inputs and verifies that properties hold for all of them. Instead of testing specific examples, you test invariants. **When PBT beats example-based tests:** - Serialization pairs (encode/decode) - Pure functions with clear contracts - Validators and normalizers - Data structure operations ## Property Catalog | Property | Formula | When to Use | |----------|---------|-------------| | **Roundtrip** | `decode(encode(x)) == x` | Serialization, conversion pairs | | **Idempotence** | `f(f(x)) == f(x)` | Normalization, formatting, sorting | | **Invariant** | Property holds before/after | Any transformation | | **Commutativity** | `f(a, b) == f(b, a)` | Binary/set operations | | **Associativity** | `f(f(a,b), c) == f(a, f(b,c))` | Combining operations | | **Identity** | `f(x, identity) == x` | Operations with neutral element | | **Inverse** | `f(g(x)) == x` | encrypt/decrypt, compress/decompress | | **Oracle** | `new_impl(x) == reference(x)` | Optimization, refactoring | | **Easy to Verify** | `is_sorted(sort(x))` | Complex algorithms | | **No Exception** | No crash on valid input | Baseline (weakest) | **Strength hierarchy** (weakest to strongest): ``` No Exception -> Type Preservation -> Invariant -> Idempotence -> Roundtrip ``` Always aim for the strongest property that applies. ## Pattern Detection **Use PBT when you see:** | Pattern | Property | Priority | |---------|----------|---------...

Details

Author
ed3dai
Repository
ed3dai/ed3d-plugins-testing
Created
3 months ago
Last Updated
3 weeks ago
Language
Python
License
None

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Featured

playwright-skill

Battle-tested Playwright patterns for writing, debugging, and scaling reliable test suites. Use when you need guidance for E2E, API, component, visual, accessibility, or security testing, plus CI/CD, CLI automation, page objects, and migration from Cypress or Selenium. TypeScript and JavaScript.

254 Updated today
testdino-hq
Testing & QA Solid

playwright-core

Battle-tested Playwright patterns for writing and debugging reliable E2E, API, component, visual, accessibility, and security tests. Use when you need locator strategy, assertions, fixtures, network mocking, auth flows, trace debugging, or framework recipes for React, Next.js, Vue, and Angular. TypeScript and JavaScript.

254 Updated today
testdino-hq
Testing & QA Featured

dotnet-test-frameworks

Reference data for .NET test framework detection patterns, assertion APIs, skip annotations, setup/teardown methods, and common test smell indicators across MSTest, xUnit, NUnit, and TUnit. DO NOT USE directly — loaded by test analysis skills (test-anti-patterns, exp-test-smell-detection, exp-assertion-quality, exp-test-maintainability, exp-test-tagging) when they need framework-specific lookup tables.

3,060 Updated today
dotnet
Testing & QA Featured

exp-dotnet-test-frameworks

Reference data for .NET test framework detection patterns, assertion APIs, skip annotations, setup/teardown methods, and common test smell indicators across MSTest, xUnit, NUnit, and TUnit. DO NOT USE directly — loaded by test analysis skills (exp-test-smell-detection, exp-assertion-quality, exp-test-maintainability, exp-test-tagging) when they need framework-specific lookup tables.

3,060 Updated today
dotnet
Testing & QA Listed

unit-testing

Unit testing patterns: Vitest config with v8 coverage, Testing Library behavior testing, MSW for HTTP mocking (vs jest.mock), it.each parametrized tests, spies vs mocks vs stubs, testing async code, snapshot testing guidelines. Use when writing unit and component tests.

13 Updated 2 months ago
rnavarych