Skip to main content

Analyze Python code for correctness using symbolic execution.

Project description

CrossHair

Join the chat at https://gitter.im/Cross_Hair/Lobby Check status Downloads

An analysis tool for Python that blurs the line between testing and type systems.

THE LATEST NEWS:
Check out the new crosshair cover command which finds inputs to get you code coverage.

If you have a function with type annotations and add a contract in a supported syntax, CrossHair will attempt to find counterexamples for you:

Animated GIF demonstrating the verification of a python function

CrossHair works by repeatedly calling your functions with symbolic inputs. It uses an SMT solver (a kind of theorem prover) to explore viable execution paths and find counterexamples for you. This is not a new idea; a Python approach was first described in this paper. However, to my knowledge, CrossHair is the most complete implementation: it supports symbolic lists, dictionaries, sets, and custom classes.

Try CrossHair right now, in your browser, at crosshair-web.org!

CrossHair has IDE integrations for VS Code, PyCharm, and more.

Want to do me a favor? Sign up for email or RSS updates. There are other ways to help too.

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crosshair-tool-0.0.26.tar.gz (301.4 kB view hashes)

Uploaded Source

Built Distribution

crosshair_tool-0.0.26-py3-none-any.whl (341.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page