3 ms·
> 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
by rocqua 6y ago
> 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?
- jrockway 6y agoChanging 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.
- rocqua 6y agoPersonally 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.