Hacker News new | ask | show | jobs
by zmimon 6190 days ago
I think it depends a lot on context. There are some kinds of code where unit testing is just about the only way to test it at all and makes a huge amount of sense. There are other situations where unit testing verges on being a complete waste of time. One of those is that which the author describes, where you are writing what is essentially glue code between several large, complex components. Your code is simple while the components are complex. Mocking the complex components in order to test the simple code usually ends up having very low value to effort ratio. Instead, a functional or integration test that verifies that all the components work together correctly is simpler to make and more useful in terms of the results it produces.