ATDD in practiceAndrei Marukovichandrei.marukovich@lunarfrog.comTwitter @amarukovich      : Blog: lunarfrog.com/blog
Agenda• What is Acceptance Test Driven  Development?• ATDD in depth• SpecFlow demo                                   2
Story of ProjectX• Ingredients of success  •   Dedicated team and comfortable schedule  •   Continues integration server  ...
Project was rejected by the customer“Actually, we asked for something different”                                          ...
Reason of the failure                  1. Initial                  requirements                                      Sales...
ATDD is about…• Communication• Collaboration• Process improvements• Better specifications                          6
ATDD is not about frameworks                               7
Definition• TDD helps to develop product right• ATDD helps to develop right product• Other names:  • Behavior Driven Devel...
ATDD and TDD                            Refactor           Red                                       TDD   Specify        ...
SpecifyAll stakeholders collaborate on specification   Domain    Developers     Testers   Specification Define     Clarify...
Workshop types• Full team• Mini-team  • 1 domain expert + 1 developer + 1 tester• Pairing  • Useful for extending existing...
Specification• Use domain language• Testable• Includes scenarios and examples                                    12
Specification exampleFeature: New user registration  In order to be able to use site  As a new user  I want to be able to ...
Executable specification benefits• Better definition of scope and “done”• More scenarios identified upfront• Preventing de...
What to specify• User Interface?• Business logic?• Data access layer?• Algorithms? Everything, if it make sense for custom...
Consider maintenance cost  Business logic and DAL   UI and Algorithms                                               16
How to specify• Define system behavior, not steps  • Simplifies long term maintenance  • Captures domain knowledge• Do not...
What’s next? It’s time to automate your specifications                                             18
Frameworks - FIT                   19
Fixture implementation                         Production  FIT        Fixture                            Code             ...
FIT Action fixture                     21
Given-When-Then frameworks• Cucumber• Cuke4Nuke• SpecFlow                             22
Gherkin style specificationFeature: New user registration  In order to be able to use site  As a new user  I want to be ab...
DemoSpecFlow demo                24
Test maintenance• Automation code is code – follow all good  habits• Document building blocks• Split the test – fast, slow...
Way for a better specifications• Collaborative approach• Specify behavior, not implementation• Testable requirements• Auto...
Thank you! lunarfrog.com/blog   @amarukovich                      27
Upcoming SlideShare
Loading in …5
×

ATDD in practice

2,539 views

Published on

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,539
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
54
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

ATDD in practice

  1. 1. ATDD in practiceAndrei Marukovichandrei.marukovich@lunarfrog.comTwitter @amarukovich : Blog: lunarfrog.com/blog
  2. 2. Agenda• What is Acceptance Test Driven Development?• ATDD in depth• SpecFlow demo 2
  3. 3. Story of ProjectX• Ingredients of success • Dedicated team and comfortable schedule • Continues integration server • High Unit Tests coverage • Regular architecture reviews • Metrics analyzes 3
  4. 4. Project was rejected by the customer“Actually, we asked for something different” 4
  5. 5. Reason of the failure 1. Initial requirements Sales Customer Department 3. Wrong product 2. Adjusted Development requirements Team Lack of communication 5
  6. 6. ATDD is about…• Communication• Collaboration• Process improvements• Better specifications 6
  7. 7. ATDD is not about frameworks 7
  8. 8. Definition• TDD helps to develop product right• ATDD helps to develop right product• Other names: • Behavior Driven Development • Specification by example • Executable specification 8
  9. 9. ATDD and TDD Refactor Red TDD Specify Develop Green ATDD Deliver 9
  10. 10. SpecifyAll stakeholders collaborate on specification Domain Developers Testers Specification Define Clarify Verify Specification based on common understanding 10
  11. 11. Workshop types• Full team• Mini-team • 1 domain expert + 1 developer + 1 tester• Pairing • Useful for extending existing specifications 11
  12. 12. Specification• Use domain language• Testable• Includes scenarios and examples 12
  13. 13. Specification exampleFeature: New user registration In order to be able to use site As a new user I want to be able to register an accountScenario: Successful registration Given I am on Registration page When I entered unique name And I entered valid password Then a new account is created 13
  14. 14. Executable specification benefits• Better definition of scope and “done”• More scenarios identified upfront• Preventing defects is cheaper than fixing them• Prevents system regression 14
  15. 15. What to specify• User Interface?• Business logic?• Data access layer?• Algorithms? Everything, if it make sense for customer 15
  16. 16. Consider maintenance cost Business logic and DAL UI and Algorithms 16
  17. 17. How to specify• Define system behavior, not steps • Simplifies long term maintenance • Captures domain knowledge• Do not rely on implementation details• Test should be self-describing • Define allowed and disallowed scenarios • Provide right and failing examples• Use iterative approach • Start with defining of the happy path• Use domain language 17
  18. 18. What’s next? It’s time to automate your specifications 18
  19. 19. Frameworks - FIT 19
  20. 20. Fixture implementation Production FIT Fixture Code 20
  21. 21. FIT Action fixture 21
  22. 22. Given-When-Then frameworks• Cucumber• Cuke4Nuke• SpecFlow 22
  23. 23. Gherkin style specificationFeature: New user registration In order to be able to use site As a new user I want to be able to register an accountScenario: Successful registration Given I am on Registration page When I entered unique name And I entered valid password Then a new account is created 23
  24. 24. DemoSpecFlow demo 24
  25. 25. Test maintenance• Automation code is code – follow all good habits• Document building blocks• Split the test – fast, slow, stable• ATDD can be used for integration but keep integration and functional tests separately 25
  26. 26. Way for a better specifications• Collaborative approach• Specify behavior, not implementation• Testable requirements• Automate specification tests• Control specification maintainability 26
  27. 27. Thank you! lunarfrog.com/blog @amarukovich 27

×