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 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

Working in a DevOps team is the best thing that happened to me. 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.

1 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: Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.