CHAPTER 8 Testing

Testing is the process of comparing the invisible to the ambiguous, so as to avoid the unthinkable happening to the anonymous.

—JAMES BACH

WHAT YOU WILL LEARN IN THIS CHAPTER:            

  • Goals of testing
  • Reasons why you might not want to remove a bug
  • How to prioritize bugs
  • Kinds of tests and testing techniques
  • Good testing habits
  • Methods for estimating number of bugs

It’s a software engineering axiom that all nontrivial programs contain bugs. Actually, it’s such an important point that it deserves to be put in its own note and explained with an example.

For example, Windows 2000 was said by some to contain a whopping 63,000+ known bugs when it was shipped. Microsoft quickly retorted that this number didn’t actually count bugs. It included feature requests, notes asking developers to make something work better or more efficiently than it already did, clarification requests, and other nonbug issues. The true bugs, Microsoft explained, were mostly minor issues that wouldn’t seriously hurt users.

No matter how you count them, Windows 2000 contained a lot of “undesirable features” ranging from changes that should probably have been made to indisputable bugs.

You might think that’s the result of shoddy workmanship, but no project of that size could possibly have shipped without any bugs. The industry average number of bugs per thousand lines of code (kilo lines of code or KLOC) is typically estimated at about ...

Get Beginning Software Engineering 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.