Download presentation
Presentation is loading. Please wait.
Published byJoan Ross Modified over 9 years ago
1
BDD with SpecFlow
2
Why BDD? 1. BDD helps build the right thing. Traditionally there are many handoffs - Requirements, development, component testing, integration testing and finally customer usage. BDD shares a specification through all stages of development.
3
Why BDD? 2. BDD documents what is actually built Documentation reflects how the system actually behaves. Documentation is up-to-date and accurate. Good for long-term maintenance. Good for training new staff. Good for communicating with other teams.
4
How BDD? Up front, Product Managers, developers and QA define the behavior of the system collaboratively. They write a specification. The specification defines what Product Owners want, what developers build and what QA tests. The specification is used as a target for implementation and a means to validate the product.
5
Why not TDD? 1. Details are lost when translating from business requirements to traditional MSTest unit tests. 2. With many handoffs it’s very easy to have a full set of tests and still build the wrong software. 3. MSTest functional tests are inaccessible to product stakeholders.
6
BDD Frameworks: xBehave or xSpec? SpecFlow is xBehave-based xBehave Benefit: stakeholders can read and understand the tests Comparison: http://stackoverflow.com/questions/30 7895/what-is-the-most-mature-bdd- framework-for-net
7
SpecFlow Overview SpecFlow adds a thin layer on top of traditional automated tests. 1. Specification - readable text 2. Binding - maps from readable text- >code 3. MSTest (Behind the scenes) Traditional Automated Tests MSTest -> System SpecFlow Tests Specification -> Binding -> MSTest -> System
8
SpecFlow - One Time Setup 1. Install Visual Studio Plugin 2. nuget: Install-Package SpecFlow 3. Add to app.config:
9
Next Steps Install Visual Studio Plugin : http://visualstudiogallery.msdn.microsoft.co m/9915524d-7fb0-43c3-bb3c- a8a14fbd40ee http://visualstudiogallery.msdn.microsoft.co m/9915524d-7fb0-43c3-bb3c- a8a14fbd40ee Does SpecFlow replace all our functional tests? No... not yet. SpecFlow - Workflow & key examples Traditional Functional Tests - everything else
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.