Go to the U of M home page

Thursday, January 11, 2024

Tony's tech terms: Test Driven Development

What does Test Driven Development (TDD) mean? In short, it means that we write an automated test before we write new code. That test will fail, of course, because the code we want doesn’t exist yet. Then, we begin writing the code to make the test pass. The test defines the behavior and functionality we want. When the test passes, we know that our code is doing what it’s supposed to do.

The Application Development Team works on complex systems. Adding or changing code can have unexpected consequences. Having good test coverage protects us from that. Our test suites are our safety net for adding new behavior, fixing bugs, and doing upgrades. If new or changed code results in an unexpected change in the system, it’s likely that a previously-written test will pick that up and alert us by failing. This helps ensure a high level of stability in our applications, although it doesn't entirely eliminate the possibility of introducing new bugs—as many of you can attest.

Take the Tuition and Fee Management System (TFMS), for example. It is over ten years old, has over 1,200 tests, and has code written by developers who are long gone. However, when we add new features or do an upgrade, our tests will tell us whether or not all of that code is still working as expected. It’s vital to the stability of the application because there’s no way we can all know the complete context of changes over the last ten years. Tests provide safety. That’s why we spend time writing them.

No comments:

Post a Comment