Posted by Tess Rupprecht.
Posted by Tess Rupprecht.
[ ATDD + TDD ] = Agile ++?

Buggy Thoughts for Today
I strongly feel that adding ATDD to TDD is a good testing combination. Given the right focus from all stakeholders, it can drive the entire development process to come up with quality software products whose codes are testable, reliable, stable and easy to maintain. I don’t claim to be an expert on any QA methodology but I try to justify my testing strategy by adequate research, seeking advice from the testing community (online and offline) complemented by my own experience. This will be a series of journey stories to find out if we can truly combine Test Driven Development ( TDD) and Acceptance Test Driven Development (ATDD) to come up with a successful Software Application Project using Agile.
Let the journey begins …
Journey 1 : Thinking about ATDD + TDD
Once upon a time, writing a Test Plan seems an easy task if you are on the same project for the same company for a long time. You just fill up a simple template and you can come up with a completed Test Plan within a day or two.
But this simple one day activity can turn into weeks of planning when you are assigned to a new client ( or company) or a new project. Thou there may be a Test Plan template , it is not as simple as it seems. The area of the Test Plan which I found to be the hardest to come up with is the “Testing Approach and Strategy”. This is where the QA has to describe what is the best way to test the application. Any QA with years of experience will tell you that there is no single one QA process that fits all. This is reality but misunderstood and even mocked. You need to give a serious look into a couple of factors that would affect your choice of testing strategy. This article is not about this issue so I will skip this part.
What I would want to talk about is how I came up with a Test Strategy for one project :
- I started studying the business model and the application to be developed for about 3 days. I gather as much information from the PMs, BAs, other QAs. I read every existing artifacts.
- Then I worked with the Lead Developer alone for another 3 days, brainstorming which approach is do-able given all the resources, time and other known constraints we have. We both believed that we need to “pair” so that the testing approach we picked will be something that we both feel comfortable using. I would give much of the credit to him (SK,thank you ) for analyzing each of the testing activities I suggested and giving his technical opinion. ( Yes, I am truly lucky to work with very brilliant developers who put so much value to testing …)
- On the 7th day, I finalized the first draft of the plan with a high level Testing Approach and Strategy.
The high level strategy is like this (I copied this verbatim from my Test Plan)
- Our Team has agreed to use the Agile methodology where QA Analysts (QA) work closely with Developers, Business Analysts (BA), Project Managers (PM) and other stakeholders all throughout the project life cycle. We will implement Test Driven Development (TDD), continuous integration and pair programming.
- In addition to TDD, to ensure full unit test coverage for developed code, we will also follow the process of Acceptance Test Driven Development (ATDD) to ensure full test coverage. TDD’s approach is technology facing while ATDD is business facing. Acceptance tests are written at the beginning of an iteration and becomes an executable form of the requirements.
- Simple Process Flow of ATDD + TDD
So why ATDD + TDD?
- The Development Team has been using Agile already so everyone is familiar with the iterative development life cycle.
- TDD is now a generally accepted practice so the “Test First” concept is not hard to sell to the developers.
- ATDD strategy will logically complement the PM’s practice of translating requirements into Epic Stories then User Stories.
- Our team has previously agreed that we will rely heavily on Story Acceptance Criteria to mark any task “DONE”. The Story Acceptance Criteria are converted into Automated Acceptance Tests. The story cannot be accepted as complete until the automated acceptance tests for that story pass.
- Other non technical stakeholders like the Business Analysts and the Customers are able to participate in writing automated acceptance tests minus the technical barriers. The write Tests as “Specs” in human readable language.
- The use of ATDD ensures expectations are set around testing. There is no disconnect between what the QAs think should be tested and what the Business think should be tested.
- As each automated acceptance tests are added to the continuous build, a fully automated regression suite is developed as part of the development process.
- The fast feedback mechanism is tremendously beneficial to everyone. The business has visibility into what is tested at all stages of development.
What is ATDD and other concepts
- Common names : Acceptance Test Driven Development, Story Driven Development, Behavior Driven Development, Example Driven Development
- Definition : “ATDD is an advanced extension of TDD, keeping the software’s development guided by the principles of satisfying the customer’s needs through acceptance criteria and automated testing. “ This is so far the best definition of ATDD (1)
- Format of a typical TDD + ATDD acceptance tests:
BDD (What is needed)
Story: [ DESCRIPTION OF STORY]
As a [ROLE]
I want [FEATURE]
So that [MOTIVATION]
ATDD (How is the story supposed to work to arrive at the expected outcome)
Scenario: [SOME DESCRIPTION OF SCENARIO]
Given [SOME CONTEXT]
When [SOME EVENT OCCURS]
Then [ENSURE SOME DESIRED OUTCOME]
- ATDD allows us to take the customer’s stories and scenarios and add them directly into the code
- ATDD is business facing ( software that matters) while TDD is technology facing
- ATDD uses the testing direction of Outside-In
- Our software application now has more “business life” which can easily evolve and change to adapt to unknowns in the future requirements.
Challenges of ATDD + TDD to QA
I would avoid using Pros and Cons in evaluating the ATDD + TDD approach. I’d rather combine them as “challenges” which we might face, but to which we can always find a good solution.
- Management support is essential so we need to be prepared to justify our recommendation. If management is not willing to invest on ATDD, you can still be creative. I have some thoughts on how to go about this but I would reserve that in another post.
- ATDD is somewhat a newer concept so this needs to be explained to the Team before implementation.
- It requires practice and discipline to write acceptance tests especially in a very short iteration cycle of 2 weeks or less.
- During the first few iterations, the team may suffer from poor velocity. So set your initial expectations realistically. As everyone starts getting used to writing acceptance criteria and acceptance tests, the velocity for each story should also improve.
- More tests for the developers ( and QA ) to implement and maintain.
- Automation is a must. ATDD is not as successful if it is manually implemented.
- Lack of automation tools that would fit some applications under test. The most commonly used open source tools are FIT, FITNESSE, Cucumber, NBehave, StoryQ and EasyB. For this project, I have narrowed down the choices to : NBehave and StoryQ . I will let you know in another post which tool I picked.
- Again, the selection of the automation tool is crucial . One team I know had initial success using EasyB for almost one year. Eventually, the maintenance and the load it created on build time seemed to offset some of the positive returns earlier. I have not used EasyB myself, so please don’t take this statement as a bad review for this free tool.
- I highly suggest that the QA works closely with the developer during the testing tool selection. Try a couple, but don’t fall in love with the initial results. Think ahead. Consider refactoring, consider integration with other project streams. Consider the maintenance overhead.
Next, please follow our journey to the bottom of ATDD + TDD
- Journey 2 : Presenting ATDD + TDD to the entire Project Team
- Journey 3 : First Iteration Implementation of ATDD + TDD
Thanks everyone!
Tess Rupprecht
——————
References
(1) http://testdrivendeveloper.com/2008/03/14/ATDDAcceptanceTestDrivenDevelopment.aspx
It is great to see you in our blog Rob! Thanks for the invite to your forum to which I am already a recent poster
Cheers,
Tess Rupprech
Tess,
Glad to hear that you have come across StoryQ. When we wrote StoryQ it was to tackle similar issues. But the main issue is how do we report out of the code base to the business. This is often the reverse that you find in theory – eg story-test driven development creates stories and acceptance up front. Because I work for a company that does project work on contract and in partnerships that daily link between the customer role and delivery team isn’t as close. My problem had been that I can write a lot of acceptance criteria in the form of stories but that it was often difficult to always do this with the customer role and in fact often the person doing the customer role needed to sit down with them independently to think about all the scenarios. Add to that we needed to allow the acceptance tests to evolve and then be reviewed. In this case, I need to generate reports of working tests that we readable outside the code base. We were working in dotnet and hence the creation of storyq.
So my point here is that each of the toolsets you mentioned have their strength and should be used based on your interactions with people in the team and skillsets and actually, the size of the project. Fitnesse is great if the business/testers generate the acceptance and want to update the criteria – otherwise it seems a bit heavy if it is only developers who are reviewing the acceptance criteria. In contrast, the other tools tend to drive towards a developer focus because we review them in code or on the build server. (ps – I would go an have a look at StoryTeller by Jeremy Miller – he’s got his own hybrid)
Personally, and even given what I have just said, I am less worried about the toolset because I can get any of these to work in my favour (with enough patience) because they all work to create an abstraction that talks to my SUT code; they all have a setup/teardown; they all have the notion of a suite of tests.
I am finding Mike Cohn’s Test Automation Pyramid a good way to help explain the test/code strategy.
Great comments Todd! Thanks.
1. Every tool has its own plus and minus, and much of it depends on several factors foremost of which is the AUT. In this case, we will be testing a new REST apps that does not have a GUI that interacts with 2 enterprise applications whose inner architecture no one really knows ;-( The choice for the tool for the Acceptance Test was easier compared to the tool we will be using for Regression and Functional testing. I am leaning towards C#, SOAPUI but that is another story
2. Our customers are actually within the technical teams too, as our AUT is sandwiched between the 2 enterprise apps.
3. I want a toolset that would save me time in writing code so the StoryQ’s Converter comes in handy. My humble expertise is exploratory and usability testing so my time is really well spent outside of the automation area.
I will check on StoryTeller, and give my feedback on it too.
Thanks once again, and would love to hear more from you guys!
Tess Rupprecht
Hi Tess!
Found your blog because you mentioned StoryQ
I really enjoyed reading your posts, i didn’t yet have any tester’s blogs on my RSS feeds. All of this resonates with my attempts as a developer to make agile work.
I am particularly looking forward to your post on gaining management acceptance
If you do find that there’s anything about storyQ you don’t like, please head over to our discussion boards (http://storyq.codeplex.com/Thread/List.aspx), we are always looking for feedback.
Regards – Rob