Testing as a Driver for Software Development: TDD, ATDD & BDD Explained
Here the emphasis is on the team creating tests before creating code. This approach has several benefits:
To write a test, the requirements must be understood. This in effect gives us the shift-left approach. By shifting left, defects may be discovered earlier in the lifecycle, allowing early fixing and savings in time and money
If the tests are thought through from different perspectives, there is an improved chance of delivering a product that meets customer needs
The team, when working together, will gain a better understanding of the system requirements, which should increase individual and thus team productivity.
These approaches have proven useful in iterative development models. Variations include:
Test-driven development – the developer creates the tests, code is written to pass the tests, and then refactoring of both tests and code takes place if required.
Acceptance test-driven development – tests here are derived from the acceptance criteria agreed for a system when it is being designed, before developing the code.
Behaviour-driven development – here the test cases are written in the natural language of the stakeholders so that they are easier to understand. A typical format for these test cases is the Given/When/Then format.