Sending the same event by email, SMS and a database record meant three call sites and three formats to keep in step. 5.3 makes the notification one class…
The same three conditions appear in nine controllers, and when the definition of “active” changes there are nine places to edit and one that gets missed. The naming…
Integrating with a third party whose model does not match yours spreads their vocabulary through your codebase — their status codes, their date format, their idea of what…
Two things make a test unrepeatable, and both are usually called directly from the code under test: the current time and a random number. Neither can be asserted…
Code that calls time() or new DateTime() internally cannot be tested at a chosen moment. The usual workarounds are a sleep() in the test, which makes the suite…
A class named Utils, Helpers or Common has no definition, so nothing can be excluded from it. It grows monotonically, it is imported everywhere, and it ends up…