Successfully reported this slideshow.

Acceptance Criteria with SpecFlow

3,390 views

Published on

Automating Acceptance Criteria with SpecFlow

Published in: Technology
  • Be the first to comment

Acceptance Criteria with SpecFlow

  1. 1. Acceptance criteria with SpecFlow project case study June 2010
  2. 2. #1 CONTEXT
  3. 3. Project GQ OSCA Using Scrum core team of 5 started in June 2009 Using XP techniques pair programming TDD
  4. 4. .NET 3.5 C# SQL 2005 TFS 2008 with STS Visual Studio 2008 with Resharper NHibernate Hitachi Framework ASP.NET MVC
  5. 5. #2 EVOLUTION
  6. 6. #3 ACCEPTANCE TESTING
  7. 7. As a GQ OSCA Administrator I want to Create a new EME window for an academic year so that I can configure the assessment material for a paper
  8. 8. Acceptance Criteria • User select 'Add New Window' creates new row for date • User can use Calendar Select to select Start Date, End Date, and Publish Date • For Start Date: Must be within Academic year, and not within another existing window • For End Date: Must be after Start Date, and not within another existing window • For Commentary Publish Date: Must be after End Date, and not within another existing window
  9. 9. Scenario #1 • EME Start Date is outside Academic Year – GIVEN • the EME Start Date is outside of the current Academic Year – WHEN • the GQ OSCA Administrator tries to save the EME Window details – THEN • the form should display an error message stating that the start date must be within the Academic Year
  10. 10. Scenario #2 • EME Start Date is before EME End Date – GIVEN • the EME Start Date is after the EME End Date – WHEN • the GQ OSCA Administrator tries to save the EME Window details – THEN • the form should display an error message stating that the Start Date must be before the End Date
  11. 11. Scenario #3 • Existing EME Window and new EME Window Start Date is in existing EME Window – GIVEN • An EME Window already exists • the new EME Start Date is within the existing EME Window – WHEN • the GQ OSCA Administrator saves the EME Window details – THEN • the form should display an error message stating that the Start Date must not be within another EME Window
  12. 12. Workflow
  13. 13. #4 SPECFLOW
  14. 14. Gherkin
  15. 15. prepare context set state
  16. 16. execute actions
  17. 17. make assertions
  18. 18. #5 MORE EXAMPLES
  19. 19. Challenges • Users writing the acceptance tests • Meaningful tests • Correct granularity of acceptance tests • Coverage
  20. 20. Reference • Gherking http://wiki.github.com/aslakhellesoy/cucumber/ gherkin • Cucumber http://cukes.info/ • SpecFlow http://www.specflow.org/
  21. 21. http://creativecommons.org/licenses/by-nd/2.0/uk/

×