columbia-applied-data-science/rosetta

Write better tests

Opened this issue · 0 comments

I (langmore) made some mistakes when writing initial test suites, and future tests could be improved.

Test behavior, not implementation.

  • Test the public API in more depth.
  • Test private functions/methods only when necessary. These tests are hard to maintain and have no reason to hold up under refactoring...the most important time for a test to hold up is when you refactor.

Use descriptive test names

  • The test name should make it clear what use case the test is testing.