I was wondering if really great programmers (Knuth, Kernighan, Torvalds, etc) are advocates of extensive unit testing. I can imagine large projects they've worked on adding them to deal with collaboration scaling issues, but did, say, Knuth use unit tests in TeX? And this doesn't weigh on my decision to use them, it's just a matter of curiosity.
In this interview Knuth explains he's not a fanatic unit-tester:
"unit tests" appeals to me only rarely, when I’m feeling my way in a totally unknown environment and need feedback about what works and what doesn’t
That's in the same response where he explains how he won a Stanford programming competition (race) while being the only contestant to use punched cards on a batch mainframe -- all others were using these new-fangled interactive terminals on a timesharing system, so of course the second place finisher took over an hour longer than Knuth did.
If (perhaps with the exception of exploratory programming in a totally unknown environment) you're more comfortable with punched cards and batch mainframes than interactive terminals and time sharing, I think it will indeed follow that unit tests won't fit your style;-).
Joshua Bloch does:
InfoQ: Do you believe that other tools and processes such as unit testing, Test-driven development or pair programming also aid in programming effectively in Java?
Joshua Bloch: Absolutely. Unit testing is key. And writing your tests first is a great thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With