--- title: TDD doesn't mean you know everything upfront date: 2024-01-30 permalink: archive/2024/01/30/tdd-doesnt-mean-you-know-everything-upfront snippet: | Test-Driven Development doesn't mean you need to know everything upfront. tags: - software-development - automated-testing - test-driven-development --- I'm in the final phase of a Drupal development project for a customer. It has some custom modules and code I wrote with automated tests and test-driven development. Today, the client reported a bug. But, instead of something working incorrectly, this was a use case I hadn't considered. The tests were passing, but there wasn't one for this. I wrote the code for the use cases I was aware of when I started, and now I'm aware of another, I can add a test for it and ensure it's tested and working. To do test-driven development, you don't need to know all the use cases and functionality upfront. Write for what you know at the time, then expand and iterate in the future.