The Test Waste Ratio

Remember the days when bugs were just part of life? I mean a big part.

If you recall those dark ages, we’ve spent most of our time fixing bugs and introducing others. In our spare time, we got to work on new stuff.

Today is different, there are a lot less bugs. So we get to work more on the new stuff, right?

Or have we found a new replacement for them?
 
 

Test Maintenance Is the New Bug

You wake up one morning, and you discover that you spend 25% on maintaining tests. True story.

This doesn’t happen in one day, you feel more work on tests creeping up, and you feel it’s just natural. Part of the work.

Then one day you actually look at the numbers. And someone needs to pick you off the floor.

Nobody Writes Bad Tests Intentionally

So, where do these tests come from?

These tests are the creaky windows in the attic. One gust of wind, and you hear a loud bang. You need to go up there and fix them. Again.

Much like those windows, they don’t give you much protection. Since they break once in a while, you get accustomed to them creaking and banging, you don’t notice them anymore. Which is bad, since sometimes they let some real menaces into the house. Like real bugs. But you won’t know because you’re sure it’s the ol’ window moving in its place.

So until you face reality, it’s not clear how much they cost us. It could amount to a lot.

Back to Test World

Let’s call these bad tests the “wasteful” tests.

Which begs the question: If those cause waste, when are tests valuable? What exactly is this value?

This is hard to quantify. A test is valuable if it catches a bug. It gets points for that. So, ridiculous as it may sound, the time spent on fixing bugs the tests found is an indicator to the value of the test. We can call those tests the “valuable” tests.

Now, here’s the Test Waste ratio:
clip_image0027_thumb2

The denominator is the total time spent due to tests breaking, the valuable and wasteful. The numerator is the wasteful work.

If your wasted time is large, the ratio gets closer to 1. If it’s small, it gets closer to zero.

You want to get a lower ratio as possible. It’s not really up to you, but it’s an indicator. And those numbers can actually be measured.

So Much For Theory

What do you think? Does it make sense? Is it helpful in any way? Do I stand a chance for a Nobel prize?

Let me know.

PS. Next week, I’m going to be at Belgium Testing Days. Apart from the Spaceship I’m smuggling through customs, I’m going to be part of an interactive session, talking about the ROI of test automation.
 

Reference: The Test Waste Ratio from our JCG partner Gil Zilberfeld at the Geek Out of Water blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

One Response to "The Test Waste Ratio"

  1. Mattias says:

    I would argue that tests can be useful in other, more subtle, ways then catching bugs.

    * Documentation of behavior, which should save time for the next developer to understand the system

    * A good test coverage gives the Courage to refactor code to make it Clean. Clean code should be easier to understand and improve further.

    * Tests should drive the design to a more testable state. A testable system is easier to run in isolation. It should lead to a system that is easier to investigate.

    This is all secondary effects to having the system under test, but they all contribute value. But sure, not all tests are valuable. it is still code and can be implemented in crappy ways. There is no silver bullet.

Leave a Reply


4 + = eight



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close