3 ms·
> Unit tests of complex code is often more complex and obfuscated than the code itself, hence its usefulness as documentation is very limited. I've found that
by _asummers 10y ago
> Unit tests of complex code is often more complex and obfuscated than the code itself, hence its usefulness as documentation is very limited.
I've found that expressing unit tests in the language of the problem domain and never stressing implementation details wherever possible is the ONLY way to prevent this from happening. Avoid mocking and test doubles where possible, but sometimes they're the right tool. The tests should be treated as production code that gets boyscout rule'd as people go into it for whatever reason.
- pmelendez 10y ago>"Avoid mocking and test doubles where possible, but sometimes they're the right tool. The tests should be treated as production code that gets boyscout rule'd as people go into it for whatever reason." I agree, but a lot of people (at least in my environment) would play the "that's not an unit test" card, which is fine to me, we should care about the least intrusive way to automate code tests regardless of the philosophy behind it.