Chapter 10

Retrospective on Unit Testing

When should unit testing stop? Here are some possible answers:

  1. When you run out of time

  2. When continued testing causes no new failures

  3. When continued testing reveals no new faults

  4. When you cannot think of any new test cases

  5. When you reach a point of diminishing returns

  6. When mandated coverage has been attained

  7. When all faults have been removed

Unfortunately, the first answer is all too common, and the seventh cannot be guaranteed. This leaves the testing craftsperson somewhere in the middle. Software reliability models provide answers that support the second and third choices; both of these have been used with success in industry. The fourth choice is curious: if you have followed the precepts and guidelines ...

Get Software Testing, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.