Skip to content

Instantly share code, notes, and snippets.

@minimal
Last active November 2, 2023 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minimal/efc488678d6942ff0a43 to your computer and use it in GitHub Desktop.
Save minimal/efc488678d6942ff0a43 to your computer and use it in GitHub Desktop.

property tests

how to choose properties

different paths, same destination

  • commutativity
  • associativity
  • map
  • monad & functor laws

there and back again

  • serialization/deserialization
  • addition/subtraction
  • write/read
  • setprop/getprop

some things never change

  • size of collection
  • contents of coll
  • balanced trees

the more things change, the more they stay the same

Idempotence:

  • sort
  • filter
  • event processing
  • required for distributed designes

solve a smaller problem first

  • dived and conquer algorithms (e.g. quicksort)
  • structural induction (recursive data structures)

hard to prove easy to verify

  • prime number factorization
  • tokenizer

the test oracle

  • compare optimized with slow brute-force version
  • compare parallel with single thread version
@minimal
Copy link
Author

minimal commented Nov 2, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment