9.5 Code reviews
Testing is the most widely used technique for finding bugs in programs. However, it suffers from three fundamental problems:
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.
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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access