What to test

How extensive tests should be is debatable. Striving for 100% code coverage does not necessarily mean a block of code has been effectively tested.

Consider testing:

  • Any complex conditions
  • Acceptance of different input or expected values; including complex parameter validation
  • Exit conditions (especially raised errors or exceptions)
  • When writing a unit test, resist the temptation to test other functions or commands. A unit test is not responsible for making sure every command it calls works. That comes later
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.239.44