Skip to content
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

[Tracking] Introduce fuzz testing to forc-test #5594

Open
2 tasks
kayagokalp opened this issue Feb 12, 2024 · 1 comment
Open
2 tasks

[Tracking] Introduce fuzz testing to forc-test #5594

kayagokalp opened this issue Feb 12, 2024 · 1 comment
Assignees
Labels
big this task is hard and will take a while enhancement New feature or request forc-test Everything related to the `forc-test` lib and `forc test` command.

Comments

@kayagokalp
Copy link
Member

kayagokalp commented Feb 12, 2024

forc-test should support fuzzing with its testing capabilities. For a given sway unit test, forc-test should be able to fuzz the code to help programmers discover edge cases in their functions/methods etc.

fn add(a: u32, b:u32) -> u32 {
  if (a > 20) {
    assert!(2 == 3)
  }
  a + b
}
#[test(fuzz)]
fn test_add(a: u32, b: u32) {
 assert!(a+b, add(a, b))
}

Fuzzing can be totally random to get things started but eventually we could build something like a concolic execution engine for sway so that fuzzing can be more "informed" while trying random inputs.

TODO

@kayagokalp kayagokalp added enhancement New feature or request big this task is hard and will take a while forc-test Everything related to the `forc-test` lib and `forc test` command. labels Feb 12, 2024
@kayagokalp kayagokalp self-assigned this Feb 12, 2024
@kayagokalp kayagokalp changed the title Introduce fuzz testing to forc-test [Tracking] Introduce fuzz testing to forc-test Feb 12, 2024
@sdankel
Copy link
Member

sdankel commented Sep 6, 2024

Related #5928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
big this task is hard and will take a while enhancement New feature or request forc-test Everything related to the `forc-test` lib and `forc test` command.
Projects
None yet
Development

No branches or pull requests

2 participants