On software testing

These are key principles for software testing:

  1. Code without tests automatically becomes legacy code
  2. Tests are not a target in themselves
  3. Code coverage is not a target in itself (Goodhart's law)
  4. Do not write tests when prototyping
  5. Every code path and use-case can be tested
  6. It is easier to test a non-existing code
  7. Code must, not should
  8. Try to keep tests isolated and streamlined
  9. Test helpers make tests harder to understand
  10. Write tests similar to the user interaction
  11. Use Arrange-Act-Assert test structure:
  12. Use Red-Green-Refactor development cycle: