Keith Devens .com |
Monday, December 1, 2008 | ![]() |
| Whereof one cannot speak, thereof one must be silent. – Ludwig Wittgenstein (Tractatus Logico-Philosophicus) | ||
|
| ← Weblog URLs | PyMeld → |

Reverend Jim (http://revjim.net/) wrote:
Marcus Baker (http://www.lastcraft.com) wrote:
You have to try it!
You say you ran a comparison test. Did you use diff on the results or inspect it by eye? If you typed diff at the keyboard then you can make it a script. If you make it a script, you can run it again, perhaps after trying out a change.
Did you break anything? No? Try another change. hey, you don't have to think so much anymore. Did you break it this time? Yes? Where is the bug? It's in the line you just changed so debugging has become easier.
When the test works, you get faster, when it fails debugging is faster. Why throw it away the test? It's just so damn useful!
(Oh yes, you don't have to write the tests at the end so you save even more time)
yours, Marcus.
p.s. Sorry to sound preachy, but really - you have to try it. Eric Gamma describes it as test infected.
Simon Willison (http://simon.incutio.com/) wrote:
The best explanation of unit testing I've ever seen is the one in Dive Into Python:
http://diveintopython.org/roman_divein.html
It has a superb example and describes the unit testing process in depth. That said, I am yet to use the technique myself (although I really need to try it out some time this weekend for a university project).
J$ (http://alpha-geek.com/right) wrote:
I had the same sort of reaction to unit testing and test driven development until I forced myself to give it a shot. I have been blogging about my experiences with it so far -- my first baby steps into unit testing and test driven development, the first time TDD and unit testing actually saved me some development work and caught an odd bug, a short, simple tutorial on what TDD is at its most basic form.
So, far, it is slowly turning me into a convert.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.544s.
(Used 8 db queries)

Don't feel bad. I don't get it either. I understand how to write a test for a parser. Write a test document. Deduce the expected results. Run the parser against the test document. Compare the results. I guess this could come in handy if you make lots of changes to your parser code, and want to make certain that it is parsing correctly. But, for guys like you and me, just running it once will tell me whether it's parsing correctly: I don't need a unit test to tell me that.
Maybe I've missed the point, some how.