#MockObjects

Sebastian Bergmann :phpunit:sebastian@phpc.social
2024-05-31
Screenshot of title slide of "Testing with Doubles" presentations
2023-02-28

Developers should consider using #FakeObjects instead of #MockObjects!

Fake objects offer similar isolation benefits while driving high confidence, clear documentation & loose coupling between implementation and test code.

#InfoQ article by Tyson Gern: bit.ly/3mfL9Wc

#UnitTesting #SoftwareTesting #DevOps

J. B. Rainsberger (he)jbrains
2023-01-12

You can use () without using a library/framework just the same as you can use without a container.

You don't need to feel stuck, even though I can guess how to reached the point of believing you were.

J. B. Rainsberger (he)jbrains
2022-12-05

Further to my recent discussion about / in design, I remember asking this question at a SoCraTes event in Rochegude, France:

"Are method/function expectations an disease?"

(Or something similar.)

The short answer seemed to be this: it's quite OO, but maybe not a disease. In FP we sometimes contort ourselves to turn complicated custom workflows into straightforward function composition, and it's not always worth the effort.

J. B. Rainsberger (he)jbrains
2022-12-03

Further to this idea, whose videos on "evolutionary design without / " would you endorse? I mean you really like them. You found them compelling and convincing. They don't have to be free.

mastodon.social/@jbrains/10943

2022-12-01

@jbrains I would attend. I'm still a fan of using #MockObjects. My experience has been that the people who follow the "London" testing style (Nat Pryce and others) tend to like using them, while the people who follow the "Chicago" testing style (Sandi Metz, David Bernstein, and others) tend to not like using them.

J. B. Rainsberger (he)jbrains
2022-12-01

I'm mulling hosting an open discussion about the widespread antipathy towards (""), because I'd like to understand more about why others have this and I don't.

I'm worried about doing this, because people can act in a way that I prefer not to experience, especially when we try to discuss such issues.

I'm curious about three things:

- Would you attend this?
- Would you watch a recording of this after the fact?
- How would you handle the "bad behavior" issue?

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst