Re:Unit Testing: Is There Really Any Debate Any Longer?
by jerf on Wednesday September 12, 2012 @09:38AM
(#4510556)
I'm sitting here significantly refactoring a HTML-generating class hierarchy that I made a couple of foundational mistakes on a couple of years ago, causing excessively slow rendering. It has about 100 classes, and is used in over 1000 screens. Most of them trivial, but the non-trivial ones are definitely non-trivial. Fortunately, it happens that there is a very clean input and output that is, by design and by network structure, isolated, making it feasible to test. I've got decent automated test coverage on the existing set, and I'm in the process of adding an automated test that will verify that both the old and the new system emit byte-for-byte identical output. Without this test, this would be a hopeless exercise and I'd have to just live with the outcome forever.
I find myself wondering how many people complaining about unit tests work on leaf-node sorts of programming projects, because for me, many of the tasks I routinely take on in my environment where about a dozen projects are building on the code I am writing mean that the question isn't whether unit tests are "better" or "worse". It's a question of whether the task is possible or not.
I find myself wondering how many people complaining about unit tests work on leaf-node sorts of programming projects, because for me, many of the tasks I routinely take on in my environment where about a dozen projects are building on the code I am writing mean that the question isn't whether unit tests are "better" or "worse". It's a question of whether the task is possible or not.