Skip to content

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

License

Notifications You must be signed in to change notification settings

Rik-de-Kort/CrossHair

 
 

Repository files navigation

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:
Marko Ristin just published several new IDE integrations for CrossHair, including plugins for VS Code and PyCharm.

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; an approach for Python was first described in this paper. However, to my knowledge, CrossHair is the most complete implementation of the idea: it supports symbolic lists, dictionaries, sets, and even symbolic instances of your own classes.

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

NOTE: CrossHair is in an experimental state right now. You can help though!

Documentation

Available at https://crosshair.readthedocs.io/

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%