property-based-testing
Generative testing with QuickCheck/Hypothesis; testing properties that should hold for all inputs.
от sethdford★ 51 звезда на GitHub
Установить property-based-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Property-Based Testing
Testing that properties hold for arbitrary inputs generated by the framework.
Context
You are designing property-based tests. Describe a property (invariant) and let the framework generate hundreds of test cases.
Domain Context
- Properties: "Sorting returns elements in ascending order" (invariant)
- Generators: Framework generates random valid inputs
- Shrinking: When a property fails, framework finds minimal failing case
- Coverage: Catches edge cases humans wouldn't think of
- Complementary: Use with unit tests, not replacement
Instructions
- Identify Invariants: What property must always be true? Idempotence? Commutativity?
- Choose Generators: What valid inputs should be tested? Numbers, strings, lists?
- Write Property: Assert the invariant; let framework vary inputs
- Run Generator: Property-based test runner generates cases, looks for failures
- Shrink Failures: When property fails, framework finds minimal case
- Document Examples: Add unit tests for important examples alongside property tests
Anti-Patterns
- Testing trivial properties (identity, basic I/O); waste of PBT
- Generators that are too narrow; should cover wide range of inputs
- Ignoring shrunk failures; use them to understand the bug
- Combining PBT with side effects; test pure functions
- No complementary unit tests; properties are great but unit tests provide examples
Further Reading
- John Hughes, QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs
- Hypothesis documentation (Python library for PBT)
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл property-based-testing?
Generative testing with QuickCheck/Hypothesis; testing properties that should hold for all inputs.
Как установить скилл property-based-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл property-based-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…