While I see your point, if you ever find yourself wishing for monkey patching while writing a test in a statically typed language, it&#x27;s a code smell. You&#x27;ve not abstracted things enough. If you need to modify things that way but can&#x27;t, you should consider abstracting over it and making it possible at runtime.<p>That way, not only do you get to write a <i>better</i> test - a whole class of errors is gone, just not possible anymore - you also have a more modular system, the components of which you can test individually.