Increase Unit Testing ROI: Keep Unit Tests in Synch with Your App
Posted on Thu, May 12, 2011

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:
- Get the latest code from source control.
- Run the entire unit test regression test suite.
- Determine what assertions failed as a result of the day’s modifications.
- Figure out which developer caused each assertion failure.
- 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.
***
To learn more about ways to get real value from unit testing, you might also want to review the unit testing white papers, videos, and articles available in our Unit Testing Resource Center. Or, see our unit testing information sheet.
Photo credit: Patrick Hoesly