1
submitted 6 months ago by symfonystation@kbin.social to c/php@kbin.social

In the landscape of software testing, the choice between a do-it-yourself (DIY) approach to mocking and utilizing mocking frameworks is a pivotal decision for programmers. While mocking is indispensable for code reliability, its overuse or incorrect implementation can introduce complexities and fragilities within test suites. This article navigates the balance between leveraging mocks effectively and avoiding common pitfalls, including the dangers of writing mocks in a suboptimal manner.

top 2 comments
sorted by: hot top controversial new old
[-] Crell@phpc.social 0 points 6 months ago

@symfonystation You forgot the benefits of anonymous classes. I almost never use a mocking framework anymore since they were added.

https://peakd.com/php/@crell/don-t-use-mocking-libraries

[-] symfonystation@kbin.social 1 points 6 months ago

@Crell I did not write this but I appreciate your point.

this post was submitted on 26 Apr 2024
1 points (100.0% liked)

PHP

1 readers
1 users here now

founded 2 years ago