3 ms·
I agree with you, but I would drop the word "unit". When you start to work on legacy code, you often can't write "real unit" tests. The important thing, at this
by struppi 10y ago
I agree with you, but I would drop the word "unit". When you start to work on legacy code, you often can't write "real unit" tests. The important thing, at this point, is to bring the code under some kind of test harness (Golden Master, executable specs, ...).
Later, when you have some test coverage, you can add unit tests. In some cases, you can even try to refactor without tests first, and then add tests once you have a testable API. That's the whole point of the "BabySteps Timer" kata I have linked in the post...
Still, in the case I described in the post, a test harness would not have helped us. The only thing that would have helped us would have been to ask one of the few users who needed the features. And we didn't know them...