Go back to blog listing

Increase Unit Testing ROI: Keep Unit Tests in Synch with Your App

Unit Test Maintenance

Once you’ve built up a set of test cases that give you good coverage of your use cases,  you need to ensure that they’re maintained. Unit testing is not just about creating unit test cases. It’s also about maintaining your unit test cases. If you let them grow out of synch with the application, they quickly become useless for regression testing. This  is especially critical  for agile development processes, where change is constant.

To keep the process going, you need a supporting infrastructure and workflow. The ideal infrastructure will automatically perform the following tasks on a daily basis:

  1. Get the latest code from source control.
  2. Run the entire unit test regression test suite.
  3. Determine what assertions failed as a result of the day’s modifications.
  4. Figure out which developer caused each assertion failure.
  5. Distribute this information to the responsible developers.


This can all be automated so that it doesn’t require any development resources at all.

Then, when the developers arrive at work each morning, they can import the results into their desktops or IDEs, review any assertion failures reported for the code they authored, and respond to them. When they respond, they are either addressing functional defects in the code or updating the test to reflect the correct behavior of the code.

With this daily process, a little effort each morning goes a long way in terms of extending the test cases’ value and life span—and also, of course, in terms of exposing unexpected impacts as they are introduced so you can nip them in the bud.

Key takeway: Establishing a supporting unit test maintenance process and an infrastructure to drive this process and keep it on track is essential for getting a good return on investment from your unit testing efforts.


Photo credit: Patrick Hoesly


Stay up to date