-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TODOs #2
Comments
|
I'm going to try implementing the fuzzers from aiken/fuzz/math/rational. Is there a distribution you'd recommend for building these fuzzers from scratch, or can I just compose them with the int() fuzzers? |
Using the base fuzzer primitives is a good idea, unless you really need to squeeze in more performances but for rational that should be okay. As a rule of thumb for building fuzzers, make sure to make your most wanted scenarios associated with small values. Because the integrated shrinking strategy will simplify towards 0. |
I have added a new PR #19 with the rational fuzzers implemented. |
@adrian052 -> back then, when we first discussed the matter with @waalge, we weren't sure where the best place would be for generators that refer to stdlib components. There's an argument for putting them in the Back then, I leaned more towards defining fuzzers like those in #19 in In addition to that, stdlib has substantially grown, with governance, pairs and bls stuff. And I am afraid that adding a whole new set of fuzz-related modules will simply add noise and make stdlib scarier for new joiners. So, adding them here sounds reasonable. Sorry for the long rant, I just wanted to bring some context and give clarification before merging your PR, as this is a topic we did discuss several times with @waalge. |
Understood, so with the smarter dependency graph, we now avoid circular package-level dependencies. I believe it would be worthwhile to include a dedicated section about this on the documentation page. |
Note
If you intend to work on one of the following points:
Api
Primitives
aiken/fuzz
fn int_between(min: Int, max: Int) -> Fuzzer<Int>
#8fn int_at_least(min: Int) -> Fuzzer<Int>
fn int_at_most(max: Int) -> Fuzzer<Int>
fn bytearray() -> Fuzzer<ByteArray>
fn bytearray_between(min: Int, max: Int) -> Fuzzer<ByteArray>
fn list_at_least(fuzz_elem: Fuzzer<a>, min: Int) -> Fuzzer<List<a>>
fn list_at_most(fuzz_elem: Fuzzer<a>, max: Int) -> Fuzzer<List<a>>
fn either(fuzz_left: Fuzzer<a>, fuzz_right: Fuzzer<a>) -> Fuzzer<a>
fn both(fuzz_left: Fuzzer<a>, fuzz_right: Fuzzer<b>) -> Fuzzer<(a, b)>
fn map6(fuzz_a: Fuzzer<a>, .., fuzz_f: Fuzzer<f>, f: fn(a, ..., f) -> result) -> Fuzzer<result>
#3fn map7(fuzz_a: Fuzzer<a>, .., fuzz_g: Fuzzer<f>, f: fn(a, ..., g) -> result) -> Fuzzer<result>
#4fn map8(fuzz_a: Fuzzer<a>, .., fuzz_h: Fuzzer<f>, f: fn(a, ..., h) -> result) -> Fuzzer<result>
#5fn map9(fuzz_a: Fuzzer<a>, .., fuzz_i: Fuzzer<f>, f: fn(a, ..., i) -> result) -> Fuzzer<result>
#6Common types
Note
Considering:
aiken/fuzz/dict
fn dict(fuzz_key: Fuzzer<k>, fuzz_value: Fuzzer<v>) -> Fuzzer<Dict<k, v>>
fn dict_between(fuzz_key: Fuzzer<k>, fuzz_value: Fuzzer<v>, min: Int, max: Int) -> Fuzzer<Dict<k, v>>
fn dict_at_least(fuzz_key: Fuzzer<k>, fuzz_value: Fuzzer<v>, min: Int, max: Int) -> Fuzzer<Dict<k, v>>
fn dict_at_most(fuzz_key: Fuzzer<k>, fuzz_value: Fuzzer<v>, min: Int, max: Int) -> Fuzzer<Dict<k, v>>
fn dict_from(keys: Sample<k>, fuzz_value: Fuzzer<v>) -> Fuzzer<Dict<k, v>>
aiken/fuzz/math/rational
fn rational() -> Fuzzer<Rational>
fn rational_between(min: Rational, max: Rational) -> Fuzzer<Rational>
fn rational_at_least(min: Rational) -> Fuzzer<Rational>
fn rational_at_most(max: Rational) -> Fuzzer<Rational>
aiken/fuzz/transaction/value
fn lovelace() -> Fuzzer<Int>
(a bespoke int fuzzer for lovelace quantities)aiken/fuzz/transaction/certificate
fn certificate(delegators: Sample<StakeCredential>, pools: Sample<PoolId>) -> Fuzzer<Certificate>
aiken/fuzz/transaction/credential
fn address(payment_credentials: Sample<PaymentCredential>, delegation_credentials: Sample<DelegationCredential>) -> Fuzzer<Address>
Documentation
Experiments
The text was updated successfully, but these errors were encountered: