1. 17

  2. 6

    Other “small” datatypes that can be exhaustively tested:

    • 32-bit integers (obviously)
    • Shorter ints and floats
    • Pairs of 16-bit or shorter ints or floats (e.g. testing comparison)
    • IPv4 addresses
    • UTF-8 code points
    • Strings of four or fewer bytes
    • Registered domains (getting hold of a complete list may be difficult, but adequately large and diverse subsets should be available)

    In general, exhaustive testing should probably be more widely used. If the number of possible permutations of input data is less than a few billion, it’s usually feasible; less than a few trillion if the operation being tested is very, very fast. It circumvents the old canard that tests can only prove the existence of bugs!

    1. 2

      You do need to have a good dataset (or known good function) to test against, though.