Bound 5

January 28, 2023 ยท View on GitHub

Original source

Given a 5-tuple of lists of 16-bit integers, we want to test the property that if each list sums to less than 256, then the sum of all the values in the lists is less than 5 * 256. This is false because of overflow. e.g. ([-20000], [-20000], [], [], []) is a counter-example.

The interesting thing about this example is the interdependence between separate parts of the sample data. A single list in the tuple will never break the invariant, but you need at least two lists together. This prevents most of trivial shrinking algorithms from getting close to a minimum example, which would look somethink like ([-32768], [-1], [], [], []).

Implementors

LibraryCodeReport
AmericiumBound5Spec.scalabound5.md
jqwikBound5Properties.javabound5.md
FsCheckBound5.fsxbound5.md
fast-checkbound5.jsbound5.md
CsCheckShrinkingChallengeTests.csbound5.md
elm-testBound5.elmbound5.md