sway icon indicating copy to clipboard operation
sway copied to clipboard

[Tracking] Introduce fuzz testing to forc-test

Open kayagokalp opened this issue 1 year ago • 1 comments

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

  • [ ] #5595
  • [ ] #5593

kayagokalp avatar Feb 12 '24 01:02 kayagokalp

Related https://github.com/FuelLabs/sway/issues/5928

sdankel avatar Sep 06 '24 22:09 sdankel