Acceptance TestDrivenDevelopment                RégisWith VS 2012               Laurent                           Director...
Oh Brother, Where Did We Go Wrong?                                   … And                                 what was       ...
ATDD - A Bridge Over Troubled GapUsing Tests As Specification!•   Collaborative specification•   Using examples to illustr...
So many names …#td2013fi
Quick Overview                             This is a team effort!               Requirement                               ...
Constraints Matter Too!                   Acceptance                     Criteria                                 Function...
What actually gets driven by ATDD?   Architecture                           Collaboration     Design   Testable!          ...
Two Examples of ATDD Tools                                                  Fit            SpecFlow                       ...
Specification by Example in SpecFlow                                           Feature                                    ...
SpecFlow Overview     SpecFlow           SpecFlow FeatureAuto-Generated Code        (Gherkin)                  VS2012 Test...
SpecFlow in Action 1: Examples with Gherkin
SpecFlow in Action 2: Generating Steps
SpecFlow in Action 3: Implementation in C#
SpecFlow in Action 4: Running scenarios
The Hamlet Dilemma To test through the UI or not to test – oh what a question.                 Well … it depends …
Where To Look For Verification?           System Under Test            Presentation             Business Logic   Data     ...
From ATDD to Test Driven Development (TDD)                         TDD Cycle                         - Design with tests  ...
Specification by Example with Fit                                        <table> Fit uses the classic HTML tables to      ...
FIT OverviewHTML Tables                                  Presentation Layer- Examples                                     ...
Fit in Action 1: Examples as HTML Table
Fit in Action 2: Fixture Code
Fit in Action 3: Execution Command
Fit in Action 4: Result as HTML Table
Watch Your Language!                      Specification and examples         should use the Customer’s language and termin...
But                   something                     else is                  needed too!Building the RIGHT solution …     ...
Q&A      t
Thank you for coming! Feedback can be given via mobile or laptop through techdays.fi seminar schedule. © 2013 Microsoft Co...
Upcoming SlideShare
Loading in …5
×

TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012

824 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
824
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
25
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012

  1. 1. Acceptance TestDrivenDevelopment RégisWith VS 2012 Laurent Director of Operations, Global KnowledgeJuhani Lind 5-Mar-2013 Competencies include: Gold Learning Silver System ManagementTieturi Oy
  2. 2. Oh Brother, Where Did We Go Wrong? … And what was finally delivered. What the Customer described …
  3. 3. ATDD - A Bridge Over Troubled GapUsing Tests As Specification!• Collaborative specification• Using examples to illustrate• Driving the development• Validating frequentlyUltimate Benefits!• Executable specification• Living, up-to-date documentation• Learning by getting feedback
  4. 4. So many names …#td2013fi
  5. 5. Quick Overview This is a team effort! Requirement Specification Implementing + by Examples Acceptance Examples as Tests Criteria List of DevelopmentRequirements Next Requirement (incl. implementation, testing and reviews)
  6. 6. Constraints Matter Too! Acceptance Criteria Functionality + Examples Requirement Feature Acceptance Performance Criteria/ Usability Constraints Security …
  7. 7. What actually gets driven by ATDD? Architecture Collaboration Design Testable! Implementation Testing
  8. 8. Two Examples of ATDD Tools Fit SpecFlow Framework for Integrated Test Binds business readable Integrates the work of behaviour spesification customers, analysts, and examples to .NET. testers and developers. http://www.specflow.org/specflownew/ http://fit.c2.com/
  9. 9. Specification by Example in SpecFlow Feature Scenario 1 SpecFlow uses a business-readable Given domain specific language called Gherkin When to express examples and their Then - preconditions (Given) - actions (When) Scenario 2 - verification steps (Then) Given When Then
  10. 10. SpecFlow Overview SpecFlow SpecFlow FeatureAuto-Generated Code (Gherkin) VS2012 Test Explorer Runs tests Implemented by System Under Test Code Calls Unit Test Provider User Written (e.g. NUnit) Feature Code in .NET
  11. 11. SpecFlow in Action 1: Examples with Gherkin
  12. 12. SpecFlow in Action 2: Generating Steps
  13. 13. SpecFlow in Action 3: Implementation in C#
  14. 14. SpecFlow in Action 4: Running scenarios
  15. 15. The Hamlet Dilemma To test through the UI or not to test – oh what a question. Well … it depends …
  16. 16. Where To Look For Verification? System Under Test Presentation Business Logic Data External System
  17. 17. From ATDD to Test Driven Development (TDD) TDD Cycle - Design with tests - Implement tests - Run one test to see it fail! - Implement the simplest solution ATDD TDD - Run the test to see it pass! - Refactor, repeat This RED – GREEN – Refactor cycle applies to both.
  18. 18. Specification by Example with Fit <table> Fit uses the classic HTML tables to <tr> express examples. <td> </td> The structure of HTML tables specify <td> </td> - a Fit fixture <td> </td> - preconditions and actions <td> </td> - verification rules </tr> </table>
  19. 19. FIT OverviewHTML Tables Presentation Layer- Examples  Action Fixture- ResultInjection to public variables. Calls to public methods. Business Layer  Column FixtureUser WrittenFit Fixture <dll > Data Layer  Row FixtureSystemUnderTest
  20. 20. Fit in Action 1: Examples as HTML Table
  21. 21. Fit in Action 2: Fixture Code
  22. 22. Fit in Action 3: Execution Command
  23. 23. Fit in Action 4: Result as HTML Table
  24. 24. Watch Your Language! Specification and examples should use the Customer’s language and terminology.SpecFlow FitGherkin itself has been translated to The names of40 languages. - public variables andThe language is set in the config file - public methodswith the <language> element. in Fit fixtures should be as close to the Customer’s language as<language feature = ”fi-FI” /> possible.
  25. 25. But something else is needed too!Building the RIGHT solution … … the RIGHT way! ATDD!
  26. 26. Q&A t
  27. 27. Thank you for coming! Feedback can be given via mobile or laptop through techdays.fi seminar schedule. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentations. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.#td2013fi

×