News for hackers. Stuff that matters.
Re:Why We’re Switching to gRPC by denormalfloat on Monday May 27, 2019 @04:36PM (#20025085)
There is a reason mocking is not supported: It's incredibly error prone. The previous version of gRPC (Stubby) did actually support mocking of the stub/service interfaces. The issue is that people mock out responses that don't map to reality, causing the tests to pass but the system-under-test to blow up. This happened often enough that ability to mock was ripped out, and the InProcess server-client added.

The extra "jibber-jabber" is what makes people confident that their Stub usage is correct.

Some sample bugs NOT caught by a mock:

* Calling the stub with a NULL message

* Not calling close()

* Sending invalid headers

* Ignoring deadlines

* Ignoring cancellation

There's more, but these are real bugs that are trivially caught by using a real (and cheap) server.

There are no comments on this comment yet.