Writing tests

History / Edit / PDF / EPUB / BIB
Created: May 25, 2019 / Updated: March 9, 2020 / Status: draft / 1 min read (~104 words)

When joining a new project without tests, here is the value you need to provide through the addition of tests:

  1. the application works and doesn't crash
  2. the application works and supports a few input cases
  3. the application works and supports a variety of input cases
  4. the application works and is robust to most input cases
  • Write a test that tests the common case usage of your function
  • Write tests that cover edge cases of your function
  • Write tests to cover all statements, branches, paths