eat, sleep, code, repeat, unit test, unit testing, programming

The Business Case for Unit Testing – Part 2

In the previous part, we learned valuable lessons on how often to push code into production and studied how Facebook handles this. Let’s continue, and get on top of business!

5. QA Has Time to Focus on Other Types of Tasks and Testing

Here’s another subtle benefit, and it has to do with how the QA group spends its time.  Specifically, they can spend their time doing higher value things.

If you have a robust unit test suite, it’s going to do an excellent job catching regression that would otherwise escape as defects, making their way over to QA and potentially to production.  Now consider what happens over in QA when a regression defect appears.

Sure, they have to run through their testing paces whether they find defects or not.  But when they find one, they probably run the software a few times, in a few different ways, to confirm.  Then they log a defect report and wait for someone in the software group to come over to talk to them about it.  This might involve some back and forth until the team member fixes the defect and submits for re-testing.

This is a lot of effort across a lot of people and a lot of defects.  Now imagine freeing up their time.  What if instead of all of this, they could engage in higher value activities, such as perhaps doing exploratory testing, performance testing, or stress testing?

When the development team automates its testing efforts, it takes the burden off of other groups.

6. You Improve Your Reputation Through Greater Software Quality

Here’s another benefit to the test suite that will tend to speak to leadership, particularly when your software is part of your company’s offering.   You look better.

This can be a bit hard to quantify compared to, say, labor and time savings, but it’s no less important.  Your reputation is critical, and it affects sales and customer retention.  Think of your own experience with a SaaS or an app you’ve downloaded.  With each additional annoyance, a bit of flakiness, or obvious bug, a subconscious timer ticks away in your head.  Eventually, it counts down to “zero” and you shake your head in disgust and delete the app or purchase a competitor’s offering.

With a unit testing suite guarding against regressions and defects you extend, or even eliminate, this timer.  Unit tests obviously won’t prevent all defects all the time.  Nor will they singlehandedly make your users satisfied with your product.  But they will go a long way toward cementing you in your users’ minds as a company that makes good, dependable software that is worth their time and money.

7. You Have Flat Feature Development Time

I’ll close with the benefit that is, in my experience, nearest and dearest to management’s heart.  I’m talking about the idea of keeping the cost of change and feature development time flat.  Let me explain what I mean.

In software groups that struggle with quality, the delivery time for comparable features follows sort of a hockey stick graph over the course of months and years.  In other words, when the project starts, an average feature might take a few days to implement.  But as the project goes on, those same sorts of features start to take weeks and eventually months.

This is what happens when you have a codebase that is rotting and incurring technical debt.  A well-maintained unit test suite goes a long way toward preventing this situation.  So teams with good unit testing practice tend to be able to deliver features predictably and consistently over the course of time.

So as you and your organization evaluate whether or not to adopt a unit testing practice, think of the business case.  Unit testing helps the development team, sure.  But it also frees up other personnel and helps your organization deliver software consistently and predictably.