Home > Articles > Data

  • Print
  • + Share This
Like this article? We recommend #8: Keep a Complete Unit Test Suite

#8: Keep a Complete Unit Test Suite

TDD does a lot to support an agile environment. It helps you think about the problem you are solving in an interesting way. It helps you communicate the design decisions you’ve made. It forces you to think about a class from the perspective of its clients first and in terms of its private implementation details second.

All of those benefits are individually great. Together, they are really helpful. However, if you combine together the value of every benefit of TDD save for one, the resulting sum would still be far outweighed by the simple fact that TDD drives automated test coverage up to nearly 100%. Having a test becomes the rule and not having one becomes an exception that requires a very good explanation.

A full panel of unit tests for a database design–or any design, really—will tell you in seconds or minutes if you have unintentionally broken an existing behavior. That short cycle is paramount because the cost of fixing a defect is related to the delay between when you introduce it and when you find it. If it’s only been a few minutes, the repairs are easy or trivial. If it’s been a few weeks, the repairs are hard and sometimes even border on impossible.

Furthermore, with a test for every behavior in your database design, you can keep your class of databases in full working order and, therefore, releasable at all times. Keeping your software—all your software—working and bug free at all times is essential to supporting an agile process. In fact, it is part of the very definition of one.

  • + Share This
  • 🔖 Save To Your Account