Today, Elisabeth Hendrickson has a blog post out titled How Much to Automate? Agile Changes the Equation. In this post, she points out the value of timely, reliable automated test results:
But teams that do practice TDD and ATDD wind up with large suites of automated tests as a side effect. (Yes, it’s a side effect. Contrary to what some people think, TDD is a design technique, not a testing technique. We do TDD because it leads to clean, well-factored, malleable, testable code. The automated tests are just a nice fringe benefit.)
Moreover, the resulting set of automated tests is so much more valuable because the test results are typically reliable and trustworthy. When the tests pass, we know it means that the code still meets our expectations. And when the tests fail, we’re genuinely surprised. We know it means there’s something that broke recently and we need to stop and fix it.
Upon reflection, I realize that I may have assumed too much in my recent discussion (see here and here) with a colleague about his company’s automated tests. I explained the cost/benefit of creating and maintaining different types of automated tests, but I did not discuss the cost and benefit of the information that they provide; I made some assumptions in this regard.
If I had it to do over again, I would have asked him about the value that his group receives from having and running the automated UI tests. From there, we could have discussed more explicitly the value they would derive from having a robust set of unit tests and running them regularly.
As it was, I assumed that the relative worth of unit tests was much higher than the GUI tests. For reasons that I’m unaware of, that may not be the case; Or, more likely, my colleague may not have thought about the value derived from different types of tests and my exploration of that aspect would have lent additional credibility to my recommendations.