Fuzzer icon indicating copy to clipboard operation
Fuzzer copied to clipboard

[question] [swift] Is fuzzer capable of intercepting failures in Swift code?

Open dodikk opened this issue 7 years ago • 3 comments

 NSArray *reports = [runner enumerateMutantsUsingBlock:^(NSDictionary *mutant) {
    [deserializer deserializeUser:mutant];
  }];

We need to check if failures are recorded properly if deserializer is written Swift and mention the status in the readme.


As far as I know, the main sources of failures are

  • force unwrapped optionals (operator !)
  • force exception handlers (try!)
  • force casts (as!)
  • unowned captures in closures

dodikk avatar Mar 21 '17 16:03 dodikk

Good point, I didn't check those cases.

AlexDenisov avatar Mar 22 '17 05:03 AlexDenisov

I've tried

  • force unwrapped optionals
  • fatalError() function

Fuzzer runner fails to intercept both of them and the entire test bundle stops. For some reason the xcode's test report contains more than one test case with a crash and contains no records about other crash-free test cases.

Either xcode it has some treshold or the reason is "XCTest parallelizes test runs".

dodikk avatar Mar 22 '17 09:03 dodikk

Seems like Fuzzer might need an implementation of something like this https://github.com/Quick/Nimble/issues/234

dodikk avatar Mar 22 '17 10:03 dodikk