5

Unit Testing

Imagine working on a project without any automated tests with a few other developers, and everything seems to be working fine in production. Then, a bug has been discovered, and one of the developers fixes this bug. The QA department approves the fix and then is pushed to production. A few days later, another bug is reported in production. After investigation, the developers found out that the new bug was introduced by the fix for the other bug. Does that sound familiar?

One small change in the code base can easily change the behavior of software. A single decimal point change can cause millions of dollars worth of incorrect computations. Imagine handballing all these computation checks to the QA department for manual testing ...

Get Test-Driven Development with PHP 8 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.