Catch Problems Early

One of the biggest reasons for all this testing is that you want to catch problems early. If you find a bug while you are writing code, you can easily fix it before anyone else even knows about it. If you don’t find the bug until you perform integration testing, you might have already written other code that relies on your buggy code. To fix the bug, you might have to change your code and the code that relies on your code. If you find a bug that is in software that has already been packaged and shipped to users, you risk losing your users. Perhaps the worst situation is when users start depending on the bugs in your software and then get upset with you when you fix those bugs (see Figure 12.5).

Figure 12.5 Your users probably ...

Get Learning to Program 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.