Skip to main content

Adaptive fuzzing for property-based tests

Project description

hypofuzz

Adaptive fuzzing of Hypothesis tests.

Property-based approaches help you to write better tests which find more bugs, but don't have great ways to exchange much more CPU time for more bugs. The goal of this project is to bring togther the best parts of fuzzing and PBT.

Motivation

You can run a traditional fuzzer like AFL on Hypothesis tests to get basic coverage guidance.

  • This does actually work, which is pretty cool
  • It's very slow though, and often fails to parse the bytes into an example
  • Installing, configuring, and connecting all the parts is a pain
  • Also assumes one fuzz target per core, which doesn't scale very far

Alternatively, you can just run Hypothesis with a large max_examples setting. This also works pretty well, but doesn't get the benefits of coverage guidance (i.e. avoiding the exponential scaling cliff by learning from feedback) and also occupies one fuzz target per core.

(turns out that you can emulate coverage guidance with hypothesis.target(), which appears to work well enough as a starting point)

(also Hypothesis used to have coverage guidance built in, but we took it back out because of performance and ecosystem integration problems - as a rule of thumb it's just not worth the trouble for less than a thousand inputs. see here.)

Features

  • Interleave execution of many test functions
  • Prioritise functions where we expect to make progress
  • Coverage-guided exploration of your system-under-test
  • Seamless python-native and CLI integrations

(see personal notes for more plans, and papers I'm cribbing from)

Changelog

Patch notes can be found in CHANGELOG.md.

License

This is an active research project as part of my (Zac Hatfield-Dodds) PhD.

Unlike Hypothesis, it is not open source and I am not seeking external contributions.

As a complement to users of free, world-class PBT tools, I'm planning to sell licenses in order to fund ongoing work on both this project and Hypothesis itself. Please contact me if you are interested.

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

hypofuzz-21.12.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

hypofuzz-21.12.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file hypofuzz-21.12.1.tar.gz.

File metadata

  • Download URL: hypofuzz-21.12.1.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for hypofuzz-21.12.1.tar.gz
Algorithm Hash digest
SHA256 f4ae16e2ee3764c4128eb85df3d02e759e99a5eb88e259902e416dad2648b545
MD5 cc0978cb20abf2af5307802fc2f3f0bc
BLAKE2b-256 675a2029f58edd8b1787e30139e80b1ab61264c06f3a005648c88015646f5a86

See more details on using hashes here.

Provenance

File details

Details for the file hypofuzz-21.12.1-py3-none-any.whl.

File metadata

  • Download URL: hypofuzz-21.12.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for hypofuzz-21.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98cffef20f8d1809db46f1a485eca21fa4549a99e6fad51eaf4d596730347ad1
MD5 a4cbac72c838066f56c0e1f8acd64c04
BLAKE2b-256 7a084b37454073dfa300de1ac5d7790e5c796e742f8610d1d0b4caf23e97bd5a

See more details on using hashes here.

Provenance

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