boofun.testing
Testing utilities and validation tools for BooFun library.
This module provides comprehensive testing tools for Boolean function analysis, including property validation, representation consistency checks, and performance testing.
Functions
|
Quick validation of a Boolean function. |
|
Quick validation of a representation implementation. |
Classes
|
Comprehensive validator for Boolean function implementations. |
Performance profiler for Boolean function operations. |
|
Comprehensive test suite for Boolean function properties. |
|
|
Specialized tester for Boolean function representations. |
- class boofun.testing.BooleanFunctionValidator(function: BooleanFunction, verbose: bool = False)[source]
Comprehensive validator for Boolean function implementations.
Validates correctness, consistency, and performance of Boolean functions across different representations and operations.
- __init__(function: BooleanFunction, verbose: bool = False)[source]
Initialize validator.
- Parameters:
function – Boolean function to validate
verbose – Whether to print detailed validation messages
- validate_all() Dict[str, Any][source]
Run comprehensive validation suite.
- Returns:
Dictionary with validation results
- class boofun.testing.RepresentationTester(representation: BooleanFunctionRepresentation)[source]
Specialized tester for Boolean function representations.
Tests individual representations for correctness, performance, and compliance with the representation interface.
- __init__(representation: BooleanFunctionRepresentation)[source]
Initialize representation tester.
- Parameters:
representation – Representation to test
- class boofun.testing.PropertyTestSuite[source]
Comprehensive test suite for Boolean function properties.
Tests various mathematical properties and their detection algorithms.
- class boofun.testing.PerformanceProfiler[source]
Performance profiler for Boolean function operations.
Measures timing and memory usage of various operations.
- boofun.testing.quick_validate(function: BooleanFunction, verbose: bool = False) bool[source]
Quick validation of a Boolean function.
- Parameters:
function – Function to validate
verbose – Whether to print detailed results
- Returns:
True if validation passed, False otherwise
- boofun.testing.validate_representation(representation: BooleanFunctionRepresentation, n_vars: int = 3) Dict[str, Any][source]
Quick validation of a representation implementation.
This is a utility function for validating representation implementations, not a pytest test.
- Parameters:
representation – Representation to validate
n_vars – Number of variables for testing
- Returns:
Validation results dictionary