The value of unit tests

submited by
Style Pass
2024-04-24 14:30:03

Seems like testing and podcasts are in the air... First, I was interviewed on Brian Okken’s Python Test podcast. I wasn’t sure what to expect. The conversation went in a few different directions, and it was really nice to just chat with Brian for 45 minutes. We talked about coverage.py, testing, doing presentations, edX, and a few other things.

On that episode, Brian does a good job arguing against some of the prevailing beliefs about testing. For example, he explains why unit tests are bad, and integration tests are good. His argument boils down to, you should test the promises you’ve made. Unit tests mostly deal with internal details that are not promises you’ve made to the outside world, so why focus on testing them? The important thing is whether your product behaves right from the outside.

I liked this argument, it made sense. But I don’t think I agree with it. Or, I completely agree with it, and come to a different conclusion.

Leave a Comment