WHAT IS ATDD?
ATDD is short for Acceptance Test Driven Development. It is one of the development methodologies in which team members playing different roles (Business, Developers, Testers) collaborate to further streamline the requirements in the form of Acceptance Tests. We can trace back the use of this term in Kent Black’s 2003 book titled “Test Driven Development: By Example”. In past few years, ATDD is gaining more popularity among various different industries.
Story Test Driven Development (SDD), Specification by Example or Behavior Driven Development (BDD) are some of the other terms used for ATDD.
WHAT IS ACCEPTANCE TEST?
Acceptance Test is from the Business User’s point of view. Customers / Business own it and it is in the form of DSL (Domain Specific Language). Acceptance Test is in Given/When/Then format.
Example of Acceptance Test: Given User is on Login page And inputs correct Username And invalid Password When User clicks on Login Button Then an error message is displayed – Invalid Username / Password entered
Example of other regular User Story / Requirements: As a User I want to get notified when I enter invalid credentials while logging in the system. Acceptance Criteria: An error message is displayed if a user enters invalid credentials while logging in.
STEPS IN ACCEPTANCE TEST DRIVEN DEVELOPMENT (ATDD)
1. Select User Story and discuss the requirements to write *Acceptance Tests.
2. Implement / Develop the User Story.
3. Run Acceptance Tests.
4. Re-factor, if required.
5. Demo and get Sign-Off.
INTRODUCING THE CONCEPT OF THE 3 AMIGOS
During the discussion on requirements we have group members with 3 different flavors, Business or Product Owner, Developers, and Testers. This concept of bringing in 3 different flavors while discussing requirements is known as The 3 Amigos. George Dinwiddie, in 2009, in one of his blogs titled “If you don’t automate acceptance tests?” coined this term.
Here is the most important aspect of the 3 Amigos concept – Discuss the Requirements and with the collaboration of three different perspectives, the outcome is Acceptance Test.
HOW CAN YOU IMPLEMENT ATDD IN YOUR PROJECT?
Below is the list of things you can consider, follow, and implement in your project.
1. Add a task titled ‘3 Amigos’ in each of the User Stories.
2. Work on the ‘3 Amigos’ task first and complete as a team before moving to other tasks.
3. Distill the requirements to Acceptance Tests.
4. Developers begin the development.
5. Ensure that all the Acceptance Tests pass and flip the User Story to Testers.
6. After all Acceptance Tests pass, demo the User Story to get it accepted by Product Owner / Business.
AUTOMATION AND ATDD
Opposite to what everyone think, we don’t need to automate all Acceptance Tests. This might surprise you. But yes, this is the truth. ATDD never talks about automating the Acceptance Tests. Rather it focuses on collaboration between different team members to distill the ambiguous requirements in form of simplified Acceptance Tests.
I will conclude by saying that – “ATDD is not only a Development Methodology but in fact its’ a complete shift in mindset, the way we work.”