A question that often arises in our consulting and training practices concerns the relationship between test-driven development (TDD) and acceptance-test-driven development (ATDD). Which one is “really” TDD? Which one should an organization focus on first? Which one should achieve the most attention and resources?
It is common to say that TDD is “developers writing unit tests before the production code”. Yes, that is one form of TDD; but it is a subset of a larger set of ideas and processes.
It is also common to say that ATDD is “acceptance tests being written before the development cycle begins”. Again, while this is correct, it reinforces the idea that it is a thing separate from what the developers do when they are “doing TDD”.
The reality is that they are all “test-driven development.” They are not conducted in the same way nor are they done by the same people. And the value they provide is different. But at the end of the day, TDD is the umbrella under which they fall.
The whitepaper, Test-Driven Development in the Larger Context by Scott Bain compares ATDD and UTDD, describing their differences (audience, creators, language, cadence and automation requirements) and their similarities. Here are a few of the similarities:
- Tests ensure detailed and specific understanding of behavior
- Tests capture knowledge that would otherwise be lost
- Tests ensure quality design
TDD, whether ATDD or UTDD, does not replace traditional testing. The quality control/quality assurance process that has traditionally followed development is still needed. This is because TDD does not test all aspects of the system, only those needed to create it. Usability, scalability, security, and so on still need to be ensured through traditional testing. TDD does contribute some of the tests needed by QA, but certainly not all of them.
In the paper, Scott concludes,
So, the answer is that TDD and ATDD are not distinct from one another, but part of an overall approach to software development that places “a shared understanding of the behavior needed to achieve business value” first and foremost in the process, and that ensures alignment with the understanding in every activity that consumes resources. It also ensures that the knowledge possessed by the organization today will not be lost in the future.