Imagine this…​

If you’re putting a fire extinguisher in your house to prevent fire, but the extinguisher has a broken handle.

Will that help at all in an emergency?

Obviously no.

Having a broken fire extinguisher is almost the same as having no fire extinguishers at all.

It’s the same with unit testing.

A lot of developers think if they have unit tests, then they’re safe from bugs.

But that’s not true.

Not all unit tests are created equal.

Some of them are valuable and contribute a lot to overall software quality. Others don’t.

Bad unit tests raise false alarms, don’t help you catch regression errors, and are difficult to maintain.

The result for projects with bad tests or no tests is the same. They either get released with a lot of bugs (because the test suite doesn’t provide enough protection against those bugs) or stagnate (because you spend a lot of time on manually testing each version).

You may see such tests turning red and going back to green for no explicit reason. They are also easily broken by refactoring.

Don’t fall into the trap of writing unit tests for the sake of unit testing.

It’s important to understand what code to test and why you should do that, instead of just the technical side of how to write a unit test.

I listed 4 pillars of a good unit test in my book Unit Testing Principles, Practices, and Patterns.

If you follow these 4 pillars, you can write effective unit tests that help avoid project stagnation and maintain the development pace over time.

This book is a culmination of my over 15 years of research, trial, and error — compiled, refined, and distilled.

If you don’t have much experience with unit testing, you’ll understand what makes a good unit test and how unit tests enable sustainable growth of your project. You’ll see which tests contribute to the quality of that project and which must be refactored or eliminated.

If you’re an experienced programmer, this book will help you look at unit testing in a new light. It will help you articulate why the techniques and best practices you’ve been using all along are so helpful. You’ll have a logical foundation behind unit testing best practices.

If you want to write unit tests with minimum pain and avoid all the trial and error that I’ve gone through…​

(Again, the discount code is nwsentr40.)

Take care,

Vlad.

P.S. After you grab the book, I’ll give you another bonus.

It’s my course, 5 Non-Obvious Tips for Writing Better Unit Tests.

All you need to do is forward the book purchase receipt to my email book@enterprisecraftsmanship.com, and I’ll enroll you in the course as a bonus.

P.P.S. If you really like the book and want to consult with me, reply to this email with the word "consult", and we can chat more.