Tue 11 Dec 2007
So the boy and I were watching football last night. The game was a little slow so I had the laptop out and was working on some unit tests. He looked over and saw the Clover coverage graph and says “What’s that?”

So we had a discussion (he’s not a software developer at all) about unit testing, codebase confidence, code coverage, test-first, and so forth. Nice. But it took him about 4 seconds to look over at the Clover chart and say “You’re not doing so well, huh?” I came up with some medium-lame explanations about how things in that initial view are divided up into components (java packages) and that I know some of the packages are more important than others. After bringing the codebase from basically no tests coverage to 45% coverage in the last year, it was a snap back to reality. 45% code coverage is not bad, really. I’ve been snooping at some large OSS projects that use Clover and we are up there with the big boys. But there’s a long way to go. And face the facts man: if you exercise some code but don’t assert the right stuff, you might as well not be doing anything at all.
So I explained a little more about code coverage to the boy and showed him how Clover allows me to drill down to the class and see where I need to write more tests. I showed him how the counts on the left show how many times each line was executed and that the red background means it didn’t get tested. It took him 1.8 seconds to notice an “if” statement that had an execution count greater than one but was red. So we had to have a discussion about execution paths.
Pretty sharp kid.
One point eight seconds, huh? That’s pretty precise!
Nice seeing you in blogland.