What to test

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

Consider testing the following:

  • Parameters
  • 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 that every command that 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
18.118.164.151