|
Friday night, I hung out with a pal who has been learning TDD. He is
naturally full of questions, and one exchange went like this:
"If I have tested all the low-level methods, I don't need to test
the components together, do I?"
"Did you run it to see if it worked?"
"Sure! I tried a few different options, and carefully looked at the
output to be sure it was ok."
"If you had to check it, then you weren't sure it worked. Ergo, you
should have written a test."
"Doh!"
I realized later that this was one of my favorite tricks for getting
people to test. And it provides an easy way forward for them, as often
all they have to do is take their scratch code, chuck it in a test, and
add a few asserts.
What other tricks do you folks have for pushing people forward with XP?
William
|