4 ms·
It's too bad Java/C++ were designed after unit testing became commonplace. Some of the advice here will actually improve your production code but a lot of this
by txxxxd 17y ago
It's too bad Java/C++ were designed after unit testing became commonplace. Some of the advice here will actually improve your production code but a lot of this is just a case of the programmer having to work around the language.
For example, the advice to not "instantiate objects using new in the middle of methods" wouldn't be a big deal if if your test code could easily instruct the compiler to replace the concrete object with a mock when the test is run.
- ori_b 17y agoNothing prevents that being implemented in existing compilers. In fact, you can already do that in Java with class paths.