Posted on Sep21st2021 by Matthias Noback I've mentioned this several times without explaining: the rule that every class should have a test, or that every class method should have a test, does not make sense at all.

The programmer's job is to extract those classes from the world of ideas and turn them into code that we can run on our computers.

Once we have found such a class (eureka!) we know, because of our team rule, that we have to now also create a test class for it.

Maybe not, because B's behavior is indirectly covered by the test we already have for class A. Maybe yes, because I can mock B and test A and B separately.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners