Recommended Tests

Get to know the recommended tests that can help in code testing.

There are two categories of tests that we recommend:

  • Computationally easy to mess up.
  • One where an alternative approach exists.

Computationally easy to mess up

The first is where the code is computing something that is computationally easy to mess up. An example of the first case would be if we implemented a standard cryptographic cipher or hash function. These often involve bit operations and confusing intermediate variables, which both make mistakes very hard to detect. This is why algorithm designers typically also publish reference input-output pairs. If our code agrees on those, we have a lot of evidence to support that our algorithm is correct.

Get hands-on with 1400+ tech skills courses.