property-based-testing

Solid

Property-based testing with fast-check (TypeScript/JavaScript) and Hypothesis (Python). Generate test cases automatically, find edge cases, and test mathematical properties. Use when user mentions property-based testing, fast-check, Hypothesis, generating test data, QuickCheck-style testing, or finding edge cases automatically.

AI & Automation 2,210 stars 164 forks Updated 1 weeks ago Apache-2.0

Install

View on GitHub

Quality Score: 97/100

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

Skill Content

# Property-Based Testing Expert knowledge for property-based testing - automatically generating test cases to verify code properties rather than testing specific examples. ## Core Expertise **Property-Based Testing Concept** - **Traditional testing**: Test specific examples - **Property-based testing**: Test properties that should hold for all inputs - **Generators**: Automatically create diverse test inputs - **Shrinking**: Minimize failing cases to simplest example - **Coverage**: Explore edge cases humans might miss **When to Use Property-Based Testing** - Mathematical operations (commutative, associative properties) - Encoders/decoders (roundtrip properties) - Parsers and serializers - Data transformations - API contracts - Invariants and constraints ## TypeScript/JavaScript (fast-check) ### Installation ```bash # Using Bun bun add -d fast-check # Using npm npm install -D fast-check ``` ### Basic Example ```typescript import { test } from 'vitest' import * as fc from 'fast-check' // Traditional example-based test test('reverse twice returns original', () => { expect(reverse(reverse([1, 2, 3]))).toEqual([1, 2, 3]) }) // Property-based test test('reverse twice returns original - property based', () => { fc.assert( fc.property( fc.array(fc.integer()), // Generate random arrays of integers (arr) => { expect(reverse(reverse(arr))).toEqual(arr) } ) ) }) // fast-check automatically generates 100s of test cases! ``` ### Built-i...

Details

Author
foryourhealth111-pixel
Repository
foryourhealth111-pixel/Vibe-Skills
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category