Skip to content

Comment on To Kill a Mockingtest

Comments

It baffles me that the original comments for the article express so much agreement. "Exhibit A" doesn't have anything to do with mocking. In "Exhibit B" he tries to test operations on values with mocks, which is never a good idea. Ironically, the multiplication example at the bottom shows how constructed his example is. Of course I've seen people in the "mocking world" who write code like this, but that's not an argument against mocking. I think "Exhibit C" is actually valid, but his solution requires a self written AOP framework and the test still relies on implementation details.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.