3 ms·
Testability as a design metric didn't seem to be mentioned in all this. When I started looking into Unit testing & TDD, I was surprised I didn't see any sort o
by lallysingh 18y ago
Testability as a design metric didn't seem to be mentioned in all this.
When I started looking into Unit testing & TDD, I was surprised I didn't see any sort of style guide for it. Lots of stuff like that available for OO, C++ templates, etc. But I wasn't satisfied with what I saw in this area.
It's only now that I really appreciate a REPL for this purpose. Some sort of way for a developer to interact with live running code, without having to trace it in a debugger, is very, very useful.
But, REPLs aren't available for many languages. Instead, you end up designing code that's easy to test. I'll test every class with logic in it, but only the methods with real code in them (+ a little extra, b/c I don't trust my ego on this).
The code tends to feel dumber, but the development process becomes more linear, as I get it more right at the time of that initial test development than I would otherwise. E.g. I don't have to go back to it to fix bugs later, which is more painful as I've already forgotten my thinking on some of that stuff.