3 ms·
>2. There's no documentation as to how something should work, or what functionality a module is trying to express. Unit tests of complex code is often more com
by pmelendez 10y ago
>2. There's no documentation as to how something should work, or what functionality a module is trying to express.
Unit tests of complex code is often more complex and obfuscated than the code itself, hence its usefulness as documentation is very limited.
>3. No one dares to refactor anything ==> Code rottens ==> maintenance hell.
>4. Bugs are caught by costly human beings (often used to execute "system level tests") instead of pieces of code.
Lack of unit tests doesn't necessarily means lack of automated tests. Functional tests when applicable, are far more useful in my opinion than unit tests.
- _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.
- tigershark 10y agoOnly bad unit tests are obfuscated. In the good ones even the users can easily understand what the test is doing and can even add new test cases.