nw-pbt-fundamentals

Solid

Property-based testing core concepts, property taxonomy, and strategy selection (language-agnostic)

Testing & QA 526 stars 55 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 95/100

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

Skill Content

# PBT Fundamentals Core property-based testing knowledge, language-agnostic. Load language-specific skills for framework syntax. ## What PBT Is Instead of specifying individual test cases, define properties (rules for all valid inputs) and let the framework generate hundreds of random inputs to attempt falsification. On failure, framework automatically shrinks input to minimal reproducing case. PBT complements example-based tests. Use both. ## Property Types Taxonomy ### Decision Table: Choosing Property Types | Property Type | Use When | Example Domain | |--------------|----------|----------------| | Invariant | Output has structural guarantees regardless of input | sort preserves length, tree stays balanced | | Idempotency | Applying operation twice equals applying once | formatting, deduplication, HTTP PUT | | Round-trip | Two operations are inverses | encode/decode, serialize/deserialize, compress/decompress | | Oracle | Simpler reference implementation exists | optimized algo vs naive, new parser vs stdlib | | Metamorphic | Can't verify single output but can relate multiple outputs | ML classifiers, search engines, numeric computation | | Commutativity | Operation order shouldn't matter | set operations, independent migrations | | Inductive | Property holds for base case and each incremental step | recursive data structures, incremental builds | | Hard-to-find, easy-to-verify | Solution expensive to compute but cheap to check | pathfinding, factorization, compilat...

Details

Author
nWave-ai
Repository
nWave-ai/nWave
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category