3 ms·
Ah, yes, the "I don't have to write tests because I'm perfect" school of programming. Well, I'm not perfect, but I aspire to write perfect code, that is, code
by andreyf 17y ago
Ah, yes, the "I don't have to write tests because I'm perfect" school of programming.
Well, I'm not perfect, but I aspire to write perfect code, that is, code which has no bugs. One way of doing that is writing unit tests - telling the computer what to do, and then telling it how to check what I just told it to do. A better way is making sure I'm using abstractions that match my intentions.
Aside: I see TDD as a little different from regression testing, which seems to make a little more sense.
- kscaldef 17y agoAnd an even better way is to do both. You've created a completely false dichotomy.
- andreyf 17y agoGood point. I'd argue that either one discourages the other, however. The messier and more complex your architecture, the more valuable tests are. Conversely, the more unit tests you have, the sloppier you can make your architecture.
- kscaldef 17y agoAnd I'd argue the opposite. Messy, complex designs are hard to unit test. Writing unit tests encourages clean, well-defined, orthogonal interfaces.