Code & Analysis & Testing
Implement property-based testing framework
Type the command in Claude Code to trigger it. Some commands accept arguments (shown as <arg>). Commands run specialized workflows or prompts to help with specific tasks.
Step 1: Add the marketplace (one-time)
Step 2: Install the Code & Analysis & Testing commands
/add_property_based_testing Implement property-based testing framework
- Analyze current codebase to identify functions suitable for property-based testing
- Identify mathematical properties, invariants, and business rules to test
- Assess existing testing infrastructure and integration requirements
- Determine scope of property-based testing implementation
- Plan integration with existing unit and integration tests
- Choose appropriate property-based testing framework:
- **JavaScript/TypeScript**: fast-check, JSVerify
- **Python**: Hypothesis, QuickCheck
- **Java**: jqwik, QuickTheories
- **C#**: FsCheck, CsCheck
- **Rust**: proptest, quickcheck
- **Go**: gopter, quick
- Install framework and configure with existing test runner
- Set up framework integration with build system
- Define mathematical properties and invariants for core functions
- Implement property tests for data transformation functions
- Create property tests for API contract validation
- Set up property tests for business logic validation
- Define properties for data structure consistency
- Configure generators for primitive data types
- Create custom generators for domain-specific objects
- Set up composite generators for complex data structures
- Configure generator constraints and boundaries
- Implement shrinking strategies for minimal failing examples
- **Roundtrip Properties**: Serialize/deserialize, encode/decode operations
- **Invariant Properties**: Data structure consistency, business rule validation
- **Metamorphic Properties**: Equivalent operations, transformation consistency
- **Model-Based Properties**: State machine testing, system behavior validation
- **Oracle Properties**: Comparison with reference implementations
- Integrate property-based tests with existing test suites
- Configure test execution order and dependencies
- Set up property test reporting and coverage tracking
- Configure test timeout and resource management
- Implement property test categorization and tagging
- Set up stateful property testing for complex systems
- Configure model-based testing for state machines
- Implement targeted property testing for known issues
- Set up regression property testing for bug prevention
- Configure performance property testing for algorithmic validation
- Configure test case generation limits and timeouts
- Set up shrinking parameters and strategies
- Configure random seed management for reproducibility
- Set up test distribution and statistical analysis
- Configure parallel test execution and resource management
- Configure property-based tests in continuous integration
- Set up test result reporting and failure analysis
- Configure test execution policies and resource limits
- Set up automated property test maintenance
- Configure property test performance monitoring
- Create comprehensive property-based testing documentation
- Document property definition patterns and best practices
- Create examples and templates for common property patterns
- Train team on property-based testing concepts and implementation
- Set up property test maintenance and evolution guidelines
- Document troubleshooting procedures for property test failures