Acceptance Test-Driven Development (ATDD)
Acceptance Test-Driven Development (ATDD) is a process where teams write acceptance tests before the development process starts. It emphasises a shared understanding of requirements among the team, and stakeholders to ensure that the software meets user needs.
Goal
The goal of ATDD is to improve product quality and write cleaner, more testable code. It seeks to minimise misunderstandings and reduce rework by clarifying end user expectations upfront.
Context
When writing a feature you cna get bogged down in the technicalities and lose sight of the end goal. ATDD helps to keep the focus on the end user and their needs.
Comparison between TDD
ATDD and Test-Driven Development (TDD) are different activities that serve different purposes. It is not an either-or option but rather a combination of both that can help teams deliver high-quality software.
Category | TDD (Test-Driven Development) | ATDD (Acceptance Test-Driven Development) |
---|---|---|
Focus | Writing tests for small units of code (e.g., functions or methods) before writing the code itself. | Writing tests for the usability of the feature as a whole. |
Scope | Concentrates on the technical aspects and internal design of the application, ensuring code correctness. | Centers on the functionality and behaviour of the system from the user's perspective, ensuring the system meets business and user needs. |
Participants | Primarily involves developers, although can include more in cross-functional teams. | Involves the full team. |
Test Creation | Developers write unit tests. | Collaboratively created by team members. |
Primary Goal | To ensure that individual units of code work as expected and facilitate refactoring. | To ensure that the software as a whole satisfies the specified acceptance criteria and meets user and business needs. |
Inputs
Artifact | Description |
---|---|
User Stories | Detailed descriptions of the functionality, performance criteria, and interfaces needed for each component. |
Outputs
Artifact | Description | Benefits |
---|---|---|
Test Suite | A collection of tests that validate the functionality of the software. | A safety net for refactoring and maintaining the codebase. |
Unvalidated Code | A feature that has been implemented but not yet validated with users. | A working product that can be tested and validated with users. |
Anti-patterns
- Failing to involve the full team: Not involving all relevant stakeholders in the ATDD process can lead to misaligned expectations.
- Covering too much functionality in a test: This can lead to overly complex tests that are difficult to maintain and understand.