News for hackers. Stuff that matters.
Re:Prefer Fakes over Mocks by rocqua on Wednesday October 14, 2020 @06:00AM (#24774934)
> if you can modify the system to make testing against it easier, that's even better.

What do you mean here? Changing your testing system, or changing the real system?

Re:Prefer Fakes over Mocks by jrockway on Wednesday October 14, 2020 @03:27PM (#24780517)
Changing the real system to add the hooks you need. Complexity often exists around waiting for events to happen (the real system doesn't need notifications, but you don't want your tests to run forever when they're failing), clocks (time.Now() is difficult to test), things like that.
Re:Prefer Fakes over Mocks by rocqua on Thursday October 15, 2020 @06:51AM (#24787083)
Personally I am loath to add extra functionality to the real system just to make testing easier. I am massively in favor of keeping the complexity in the real system down. Adding more hooks, or increasing the interface of the real system, just to make it more testable feels wrong.

This is why I'd want test to just have a lot more 'leeway' than normal code. Essentially I want heavy hooking, introspection and reflexivity but only for tests.