Art of unit testing

On twitter I read this post:


Since I have a wordpress blog and like a challenge, here is the daily post in my Zero to Hero sequence.

Publish a post that includes a new element

Roy Osherove has written a book called “Art of unit testing”. It’s a good read when starting with unit testing. The website called artofunittesting.com contains even more information.

Below I want to share a basic principle about unit testing I’ve adopted from Roy.

In more detail:

  • Readable, make sure the developer that reads the tests after you’ve moved on, knows what you mean,
  • Trustworthy, you must be able to rely on the outcome of the tests,
  • Fast, since you’ll be writing a lot of tests make sure they don’t take a lot of time to run (think milliseconds),
  • Maintainable, use stubs in stead of mocks, write helper methods and other tips to avoid rewriting lots of tests.

The first slide is from a video you can find here.

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Test and tagged , , , . Bookmark the permalink.

One Response to Art of unit testing

  1. Pingback: Unittest NServiceBus saga | .NET Development by Eric

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s