Difference between TDD, BDD, ATDD
Could someone help me understand how these are uniquely different? Isn't the end goal of all these to ensure the code is working as expected? Where does it deviate to be distinguished as TDD, BDD and ATDD?
I've seen different explanations online, so I think I have an understanding of the differences, but, I was hoping I could get some consistent answers and advice here. If anyone has any reference to reliable sources that describe these, that will also be much appreciated. Thanks.
Test-Driven Development (TDD) is a form of testing that has a specific flow. First, a test is written. Then, the tests are run to prove that the test fails - this is called "red". Code is written such that the test passes - this is called "green". Finally, the code is refactored and the test suite is run and is kept "green" since the tests continue to pass. The process repeats. In TDD, the tests are typically written at a unit level, testing individual methods or functions or classes. TDD works to drive the design of the code with respect to its interfaces.
Acceptance Test-Driven Development (ATDD) is an extension to TDD. The tests that are written are written at an acceptance test level. Rather than encoding tests at the level of methods or functions or classes, they are written to define system behaviors. ATDD tests tend to help capture requirements and ensure that the system has the intended behavior.
Neither TDD nor ATDD require a particular format for tests. However, Behavior-driven development focuses on encoding the intended behavior using domain language. BDD tools take advantage of tools that allow tests to be written in a language that includes domain-specific terms, resulting in tests that are readable to both technical and non-technical stakeholders.
So, TDD and ATDD are levels of testing. TDD focuses on lower levels - unit and perhaps integration tests. ATDD focuses on system tests. Either of these can be combined with BDD to express tests to be more widely accessible to the variety of stakeholders involved in system development.