9.5 Code reviews

Testing is the most widely used technique for finding bugs in programs. However, it suffers from three fundamental problems:

  1. You can only test code against your understanding of what that code should do. If you have misunderstood the purpose of the code, then this will be reflected in both the code and the tests.

  2. Tests are sometimes difficult to design, with the consequence that the tests you write may not provide coverage of all the code you have written. This is most often a problem with code that handles rarely occurring errors and exceptions. One of the arguments for TDD is that it avoids this problem. You always have code associated with each test. However, TDD simply changes this problem. Instead of test incompleteness, ...

Get Engineering Software Products: An Introduction to Modern 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.