Not If But When

I hear this over and over and over. “We didn’t have time to write automated unit tests and now regression bugs are killing us.”

People always struggle with the cost of quality, but the cost of quality can’t be avoided. It can only bey delayed, and as it is delayed it compounds. To keep the cost low, you need to address it immediately.

If you’re going to build and design as you go (more on that in another post) then you have to be free to change your design as you go. And if you don’t have automated unit tests changing your design is a crap-shoot early in the project and somewhere between trouble and disaster later in the project. In addition, as you go you know you will need to refactor your code and you have to have good automated unit testing to know the refactor was successful.

Can’t you just test manually? You can if it’s a simple and small application. But with each build the regression demand increases. With any but the smallest application your time required to test a build will eventually overwhelm the time available to run the tests. Automated unit tests are the only way to keep up.

If your current project doesn’t have good automated test coverage then you are caught in a very difficult place. I recommend paying the penalty as soon as possible since it only becomes more expensive with time.

More importantly, I want to convince you to never start another project without including comprehensive automated unit testing. Use test-driven development if at all possible. If you can’t do that then make a full automated set of tests a part of your definition of done.

But what if you aren’t very good at coming up with test assertions? If that’s the case, find a mentor or do some studying and improve. But until then write the best test cases you can. At least you’ll have those to help you minimize bugs. If you add a test for every bug found in later testing your suite will quickly become the suite you need it to be.

Advertisements
This entry was posted in Quality Assurance and tagged , , , , , . Bookmark the permalink.

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