Analyze Python code for correctness using symbolic execution and SMT solving to automatically find counterexamples for functions with type annotations and contracts.
86
{
"context": "This criteria evaluates how well the engineer uses CrossHair's runtime contract enforcement features to validate user account operations, specifically focusing on the use of contract decorators and runtime enforcement mechanisms.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Contract decorator usage",
"description": "Uses contract decorators from a supported library (icontract, deal, or PEP316 docstrings) to define preconditions and postconditions on methods",
"max_score": 25
},
{
"name": "Runtime enforcement",
"description": "Enables runtime contract enforcement using WithEnforcement decorator from crosshair.runtime or ensures contracts are enforced at runtime through proper configuration",
"max_score": 20
},
{
"name": "Precondition validation",
"description": "Implements preconditions using @require, @deal.pre, or 'pre:' docstrings to validate username format (3-20 alphanumeric chars), age range (18-120), and positive deposit/withdrawal amounts",
"max_score": 25
},
{
"name": "Postcondition validation",
"description": "Implements postconditions using @ensure, @deal.post, or 'post:' docstrings to verify balance changes after deposit/withdraw operations and ensure balance never goes negative",
"max_score": 20
},
{
"name": "Exception handling",
"description": "Correctly raises PreconditionFailed for invalid inputs and ensures postcondition failures are properly caught by the runtime enforcement system",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-crosshair-toolevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10