The ten pros and cons of unit testing

Hi ๐Ÿ‘‹ you're reading a pretty old post! I started writing on here back in high school and this page may not reflect my current views. Recommend checking out related articles and categories down below, I've likely published more recent thoughts on this topic.

Some of you may remember my writing about how unit testing is anti-productive and those of you I have to disapoint, I still dont' think it's the best productivity tool out there.

BUT!

The past few days I had another go at unit testing while developing a "server" for gathering statistics on how people use Twitulater. This was mostly in preparation for making a "server" for syncing Twitulater users, more on that some other day, it was mostly a learning exercise.

What I learned was that:

  1. Unit testing is no guarantee for quality (con)
  2. Unit testing can be really cumbersome to use and more time can be spent finding a test than solving the problem. Like for example: How do you test an app that reads from sys.stdin? (con)
  3. Unit testing only helps with bugs you've anticipated or found

Filed under: ProgrammingTestingTwitulaterSoftware Engineering

Dive deeper with my books