Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Bdd and spec flow

5,917 views

Published on

This is the slide deck from my devtea

Published in: Technology
  • If you are looking for trusted essay writing service I highly recommend ⇒⇒⇒WRITE-MY-PAPER.net ⇐⇐⇐ The service I received was great. I got an A on my final paper which really helped my grade. Knowing that I can count on them in the future has really helped relieve the stress, anxiety and workload. I recommend everyone to give them a try. You'll be glad you did.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Finally found a service provider which actually supplies an essay with an engaging introduction leading to the main body of the exposition Here is the site ⇒⇒⇒WRITE-MY-PAPER.net ⇐⇐⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ♥♥♥ http://bit.ly/2Q98JRS ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ♥♥♥ http://bit.ly/2Q98JRS ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Your GCSE Maths program has helped me immensely in maths. I am much more confident with this subject and I'm striving for better grades. I really appreciate the time you took in making this program because it has boosted many students self-confidence with their exams. ★★★ http://t.cn/AirrSv7D
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Bdd and spec flow

  1. 1. BDD with Visual Studio 2010, SpecFlow and WATIN Charles Nurse Senior Architect, DotNetNuke Corp.
  2. 2. BDD with Visual Studio 2010, SpecFlow and WATINWho Am I• ASP.NET MVP (since Jan 2007)• ASPInsider (since Jan 2008)• Senior Architect, DotNetNuke Corporation• Web: www.dotnetnuke.com• Blog: www.charlesnurse.com• Email: charles.nurse@dnncorp.com• Twitter: @cnurse
  3. 3. BDD with Visual Studio 2010, SpecFlow and WATINAgenda• Intro to BDD• Gherkins• SpecFlow• WatiN
  4. 4. BDD with Visual Studio 2010, SpecFlow and WATINPart I – Behavior Driven Development• Developed by Dan North• Response to some issues with TDD  Where to start  What to test and what not to test  How much to test in one go  What to call the tests  How to understand why a test failsBDD is a second-generation, outside–in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes acycle of interactions with well-defined outputs, resulting in the delivery ofworking, tested software that matters. Dan North
  5. 5. BDD with Visual Studio 2010, SpecFlow and WATINPart I – Behavior Driven Development• Driven by Business Value• Realized through the Interface (GUI)• Tests are defined in a natural language (Gherkins)
  6. 6. BDD with Visual Studio 2010, SpecFlow and WATINPart I – Behavior Driven Development• BDD Practices  Establish the goals of different stakeholders  Drawing out features which will achieve those goals using feature injection  Involve stakeholders through outside–in software development  Use examples to describe the behavior of the application  Automate those examples to provide feedback and regression testing  Use should when describing the behavior of software  Use ensure when describing responsibilities of software  Use mocks to stand-in for modules of code which have not yet been written
  7. 7. BDD with Visual Studio 2010, SpecFlow and WATINPart 2 – Gherkins• Natural Language definition of tests.  TDD – Arrange, Act, Assert• Gherkin – Given, When, Then  Given – defines the conditions that must exits for the test to be run  When – defines the action a “user” will execute  Then – defines the expectations of the Test• Gherkins Frameworks  Cucumber – Ruby  Lettuce – Python  Specflow - .NET
  8. 8. BDD with Visual Studio 2010, SpecFlow and WATINPart 2 – Gherkins• Example – "Refunded or exchanged items should be returned to stock.“• Customer, Product Manager, Developer or QA engineer might clarify the requirements by breaking this down into specific scenarios• Scenario 1: Refunded items should be returned to stock• Scenario 2: Replaced items should be returned to stock
  9. 9. BDD with Visual Studio 2010, SpecFlow and WATINPart 2 – Gherkins• Scenario 1: Refunded items should be returned to stock  Given a customer previously bought a black sweater from me  and I currently have three black sweaters left in stock  When he returns the sweater for a refund  Then I should have four black sweaters in stock
  10. 10. BDD with Visual Studio 2010, SpecFlow and WATINPart 2 – Gherkins• Scenario 2: Replaced items should be returned to stock  Given that a customer buys a blue garment  and I have two blue garments in stock  and three black garments in stock.  When he returns the garment for a replacement in black,  Then I should have three blue garments in stock  and two black garments in stock
  11. 11. BDD with Visual Studio 2010, SpecFlow and WATINPart 2 – Gherkins• Programmer-domain examples• Example 1: New lists are empty  Given a new list  Then the list should be empty• Example 2: Lists with things in them are not empty  Given a new list  When we add an object  Then the list should not be empty
  12. 12. BDD with Visual Studio 2010, SpecFlow and WATINPart 3 – SpecFlow• SpecFlow aims at bridging the communication gap between domain experts and developers by binding business readable behavior specifications to the underlying implementation. SpecFlow.org• Visual Studio Extension – to support Gherkin language tests  www.specflow.org  https://github.com/techtalk/SpecFlow• SpecFlow Demo
  13. 13. BDD with Visual Studio 2010, SpecFlow and WATINPart 3 – SpecFlow• Demo Summary• Review of SpecFlow in VS 2010  Reviewed the Extension Manager Addin  Reviewed the Nuget Package (SpecFlow/NUnit) integration)  Added a SpecFlow Feature  Run SpecFlow Scenarios  Added Steps File  Updated Feature  Updated Steps File
  14. 14. BDD with Visual Studio 2010, SpecFlow and WATINPart 4 – WatiN• Browser Automation Framework  Web Application Testing in .NET  http://watin.org/• Inspired by WatiR (Web Application Testing in Ruby)• Supports IE (6+) or Firefox (2+)• Licensed under Apache License 2.0• Available as a Nuget package
  15. 15. BDD with Visual Studio 2010, SpecFlow and WATINPart 4 – WatiN• Automate all major HTML elements with ease• Find elements by multiple attributes• Native support for Page and Control model.• Supports AJAX website testing• Supports creating screenshots of webpages• Supports frames (cross domain) and IFrames
  16. 16. BDD with Visual Studio 2010, SpecFlow and WATINPart 4 – WatiN• Handles popup dialogs like alert, confirm, login etc..• Supports HTML dialogs (modal and modeless)• Easy to integrate with your favorite (unit) test tool• Can be used with any .Net Language• Downloaded more than 120,000 times.• Since its open source you can add/contribute new features yourself!
  17. 17. BDD with Visual Studio 2010, SpecFlow and WATINPart 4 – WatiN• Demo• Finish the Tests
  18. 18. BDD with Visual Studio 2010, SpecFlow and WATINPart 4 – WatiN• Demo Summary• Review of SpecFlow in VS 2010  Reviewed the Nuget Package (WatiN) integration)  Completed the SpecFlow Scenario  Added a second SpecFlow Scenario  Reviewed a real Scenario in a real Application
  19. 19. BDD with Visual Studio 2010, SpecFlow and WATINNext Steps• Get Specflow  www.specflow.org  https://github.com/techtalk/SpecFlow• Get WatiN • http://watin.org/
  20. 20. BDD with Visual Studio 2010, SpecFlow and WATINThank You• Email: charles.nurse@dnncorp.com• Blog: www.charlesnurse.com• Twitter: @cnurse

×