Comment Re:True that (Score 1) 551
I like unit testing as a tool but I get turned off by a lot of pro-unit testing comments because people tend to describe in terms of something that must always be done or the code is of questionable quality. There are many situations where unit tests can't be made in a meaningful way.
The system I work on depends on real-time data streams to provide the context that defines how something is processed. Yes I could make unit tests for each of the simple operations, but what is complicated is the way the real-time data can trigger those simple operations in so many combinations and permutations. It is not practical to write a set of unit tests where each has a precondition of setting the full system state. The typical response I get is 'Well at least write unit tests for the part that is unit testable.' My response is that the part that isn't unit testable is the interesting part. Any technique is a trade off between the effort to use it and value it returns. Writing unit tests for simple code that can be verified through visual inspection is unlikely to return the value that justifies the effort.
Unit tests are great where they can be applied effectively but like any technique should not be applied slavishly to every situation.