LeoColman
12/05/2019, 6:09 PMfun execute(str: String) {
if(str.length > 3) throw RuntimeException()
}
Then in your property tests, you'll probably run with Gen.string(). Due to the random behavior of a generator, let's say, for instance, that it generates the following strings: ["a", "ab", "abc", "aaa", "", "b", "ajajisjcimqweijriansdfijqwer"] . Obviously, that last string generated will crash our code, and thus the test will fail.
What is the issue in my code that makes it not accept that String? We're not sure. So we'll try to reduce that string to the minimum failing example, so that you can investigate your failure better. This reduction is what we call shrinking. We try to shrink the failure to a point where it's easier to identify the error
So we would run your function with, for example, ajajisjcimqwei (aproximately half of the original string size). That will fail too, so we'll shrink it once again, and again, and again, until we either find the smallest failing example or a limit is reached (i believe the default is 1000 shrinks)