gchq / coreax

A library for coreset algorithms, written in Jax for fast execution and GPU support.
Apache License 2.0
19 stars 2 forks source link

Use property based testing (use Hypothesis) #692

Open tc85324 opened 2 months ago

tc85324 commented 2 months ago

What's the new feature?

Use Hypothesis for property-based testing.

See the Hypothesis docs for further information https://hypothesis.readthedocs.io/en/latest/index.html

What value does this add?

Better tests allow for better code. Property-based testing allows our tests to be a more accurate specification for the program behaviour/intent. In an ideal world, this would allow us to precisely specify all code behaviour with a reduced set of more comprehensive tests.

Is there an alternative you've considered?

It may be possible to avoid the use of Hypothesis.

Additional context

Converting the tests to utilise Hypothesis will take a lot of time. This is a forward looking change that will pay future dividends, by reducing the number of edge-case bugs (not caught by existing tests) and more precisely defining program intent.

bk958178 commented 1 month ago

Blocked pending #717