3 ms·
Yeah, things like "dependency injection" are generally good practice and enable you to write unit tests without a mocking framework. In the Java world we have t
by Jach 8y ago
Yeah, things like "dependency injection" are generally good practice and enable you to write unit tests without a mocking framework. In the Java world we have tools like PowerMock that rewrite bytecode to enable things like mocking private static final methods... useful in certain circumstances, as I assume elfspy patching is (or using LD_PRELOAD as I've seen done) but you're almost always going to be better served by refactoring the code so you don't need such tools.