specflow executable specifications
TRANSCRIPT
![Page 1: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/1.jpg)
Agile Continuous Improvement Lunch & Learn
Adventures in SpecFlow
BDD in Data Hub Configuration
(a.k.a. SEC)
![Page 2: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/2.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information2
Agenda - 1 hour
• [10 min] - Introduction to BDD & Executable Specifications
• [05 min] - Overview of .NET BDD Tools
• [05 min] - Introducing SpecFlow
• [20 min] - DEMO / Hands on
• [05 min] - Benefits
• [05 min] - Problems & Pro Tips
• [05 min] - BDD vs. Unit Tests
• [05 min] – Conclusion & further study
![Page 3: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/3.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information3
Agenda - 1 hour
*NO FREE PIZZA*
![Page 4: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/4.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information4
Introduction to BDD & Executable Specifications
![Page 5: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/5.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information5
The Question
What does the Customer want?
![Page 6: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/6.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information6
Not (only) about testing
1. User Story Acceptance Criteria
2. Shared understanding about outcomes
3. Removes implicit expectations (assumptions)
4. Reduces friction in the team
5. What does our solution do and not do?
![Page 7: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/7.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information7
* Driven Development
“Behavior Driven Development” – Dan North
“Specification by Example”
“Executable Specifications”
“Acceptance Test Driven Development” (ATDD)
“Test Driven Development”
![Page 8: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/8.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information8
Overview of .NET BDD Tools
(there are a lot)
![Page 9: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/9.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information9
.NET BDD Frameworks & Libraries
SpecFlow – Cucumber for .NET
NSpec
MSpec
TestStack.BDDify
NBehave
“Vanila” NUnit/MSTest/xUnit.net
![Page 10: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/10.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information10
Explore what’s out there
Have a play and figure out which is best for your team and organisation
SpecFlow is one of many options
A new awesome framework might be released tomorrow
![Page 11: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/11.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information11
Introducing SpecFlow
![Page 12: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/12.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information12
DEMO
CODE
![Page 13: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/13.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information13
Benefits
![Page 14: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/14.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information14
Benefits
Human readable (Gherkin - DSL)
Build Context Incrementally
Specification & Documentation
Early discovery of assumptions in acceptance criteria
Early discovery of technical assumptions
Intermediary (Gherkin) between User Story and Code
![Page 15: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/15.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information15
Problems & Pro Tips
![Page 16: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/16.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information16
Problems & Pro Tips
SpecFlow comes from Cucumber (Ruby)
Sharing state between Steps
Test organisation & structure
Test naming
Mock or end-to-end?
Maintenance
![Page 17: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/17.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information17
BDD and Unit Tests
![Page 18: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/18.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information18
BDD and Unit Tests
Do SpecFlow Specs replace unit tests?
SpecFlow more suited for larger End-to-end tests
Unit Tests for Devs, BDDS for SCRUM Team & Stackholders
SpecFlow generates NUnit tests automatically
DEMO
![Page 19: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/19.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information19
Conclusion
![Page 20: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/20.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information20
Conclusion
Sam’s 3 step guide to success!
1. Capture the User Story Acceptance Criteria as Gherkins
2. Implement SpecFlow Specs and iterate with changes to Gherkins [Acceptance Criteria WILL change]
3. You get detailed and correct acceptance criteria and automated regression tests. Everybody wins.
![Page 21: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/21.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information21
Conclusion
Was it worth it?
Is anyone going to read our Gherkin Specs?
The effort (money) needed to create and maintain the Specs needs to taken into account
The Team needs to be agile & adopt Gherkin and “Spec first mentality”
Change in thinking & culture
![Page 22: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/22.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information22
Further Study
http://stackoverflow.com/questions/307895/what-is-the-most-mature-bdd-framework-for-net
http://www.specflow.org/resources/
Specification by Example [Gojko Adzic, 2011]
The Cucumber Book [Matt Waynne, 2012]
The Art of Unit Testing [Roy Osherove, 2009]
![Page 23: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/23.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information23
Questions?
BE AGILE
![Page 24: SpecFlow Executable Specifications](https://reader035.vdocument.in/reader035/viewer/2022081504/55c5a039bb61eb43468b45df/html5/thumbnails/24.jpg)
© Copyright 2011 ADP, Inc. Proprietary and Confidential Information24
Thank you