SpecFlow and some things I've picked up

1,533 views

Published on

These are the slides for my SpecFlow presentation. This particular version was given as part of my "I'm telling you for the last time"-series (see http://www.marcusoft.net/2013/11/ImTellingYou.html).

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,533
On SlideShare
0
From Embeds
0
Number of Embeds
37
Actions
Shares
0
Downloads
56
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

SpecFlow and some things I've picked up

  1. 1. SpecFlow, Gherkin and some things I’ve picked up using them Marcus Hammarberg
  2. 2. Specification by example is not about the tools ! it’s about communication
  3. 3. Whether we choose to call it BDD or ATDD or Specification by Example, we want the same result – a shared common understanding of what is to be built to try to build the ‘thing’ right the first time. ! We know it never will be, but the less rework, the better. ! Janet Gregory
  4. 4. Hence: Let’s talk tools! http://boulderblimp.com/blimpwp/wp-content/uploads/2012/03/Craftsman-Toolbox.jpg
  5. 5. http://www.youtube.com/aptitudsthlm
  6. 6. Bandung
  7. 7. It’s not in the tool http://www.barbellsandbacon.com/wp-content/uploads/2010/02/mlss_mario-hammer.jpg
  8. 8. Tools
  9. 9. How does this work?
  10. 10. How does this work? [Given("I am on the Activity list")] public void ThisNameIsNotImportantToSpecFlow() ! [When("I click the Create New link")] public void SpecFlowUsesTheAttirbutesPerDefault() ! [Then("I should be on the Create Activity page")] public void SoItDoesntEvenCareWhatYouCallThese()
  11. 11. Gherkin
  12. 12. Feature http://www.lushtshirts.co.uk/images/products/bug-feature.jpg
  13. 13. Feature http://www.lushtshirts.co.uk/images/products/bug-feature.jpg
  14. 14. Feature http://www.lushtshirts.co.uk/images/products/bug-feature.jpg
  15. 15. Scenario http://images2.fanpop.com/images/photos/7000000/Friends-33-friends-7046166-1280-1024.jpg
  16. 16. Scenario http://images2.fanpop.com/images/photos/7000000/Friends-33-friends-7046166-1280-1024.jpg
  17. 17. Scenario http://images2.fanpop.com/images/photos/7000000/Friends-33-friends-7046166-1280-1024.jpg
  18. 18. Step in time!
  19. 19. Step in time!
  20. 20. Expressions
  21. 21. Expressions When I withdraw $20
  22. 22. Expressions When I withdraw $20 [When(@“I withdraw $(d+)“)] public void Withdraw(int amount)
  23. 23. Expressions When I withdraw $20 [When(@“I withdraw $(d+)“)] public void Withdraw(int amount) (.*) => string (d+) => integer
  24. 24. Background
  25. 25. Hooks
  26. 26. Hooks
  27. 27. Tags
  28. 28. Tags
  29. 29. @ignore
  30. 30. [Given("I have the following persons")] public void IHaveTheFollowingPersons (Table personsTable)
  31. 31. SpecFlow.Assist
  32. 32. SpecFlow.Assist
  33. 33. Scenario outline
  34. 34. Scenario outline
  35. 35. Language
  36. 36. ScenarioContext.Current
  37. 37. Do I have time for more? http://appyourmac.com/wp-content/uploads/2009/06/Awaken.png
  38. 38. Code here: http://bit.ly/SpecFlowDemos
  39. 39. Cuke Envy
  40. 40. Gherkin
  41. 41. Gherkin Step definition
  42. 42. Gherkin Step definition DSL
  43. 43. Gherkin Step definition DSL Automation code
  44. 44. Gherkin Step definition DSL Automation code SUT
  45. 45. Here’s one I’ve prepare earlier
  46. 46. Here’s one I’ve prepare earlier http://media.kansascity.com/smedia/2013/02/13/13/33/meBc3.St.81.jpeg
  47. 47. Structure
  48. 48. Structure Coding by intention
  49. 49. Structure Coding by intention Pushing the HOW down
  50. 50. Structure Coding by intention Pushing the HOW down DSL Swap
  51. 51. A special thank you to my friends: - Cucumber • SpecFlow(specflow.org) on .NET, great Visual Studio integration • NancyFx - Minimalistic web framework, with great testing capabilities (nancyfx.org) • Simple.Data - simple data access, that’s all (github.com/markrendle/Simple.Data) • FluentAutomation - UI Automation, wraps Selenium/Watin/etc (fluent.stirno.com)
  52. 52. Code here: http://bit.ly/CukeEnvy
  53. 53. Learn more
  54. 54. Learn more • http://blog.dannorth.net/introducing-bdd/
  55. 55. Learn more • http://blog.dannorth.net/introducing-bdd/ • http://www.specflow.org/
  56. 56. Learn more • http://blog.dannorth.net/introducing-bdd/ • http://www.specflow.org/ • http://cukes.info
  57. 57. Learn more • http://blog.dannorth.net/introducing-bdd/ • http://www.specflow.org/ • http://cukes.info • https://github.com/marcusoftnet/SpecFlowDemos
  58. 58. Learn more • http://blog.dannorth.net/introducing-bdd/ • http://www.specflow.org/ • http://cukes.info • https://github.com/marcusoftnet/SpecFlowDemos • http://skillsmatter.com/podcast/agile-testing/refuctoring-yourcukes
  59. 59. Learn more • http://blog.dannorth.net/introducing-bdd/ • http://www.specflow.org/ • http://cukes.info • https://github.com/marcusoftnet/SpecFlowDemos • http://skillsmatter.com/podcast/agile-testing/refuctoring-yourcukes • http://skillsmatter.com/podcast/agile-testing/bdd-as-its-meantto-be-done
  60. 60. Learn more • http://blog.dannorth.net/introducing-bdd/ • http://www.specflow.org/ • http://cukes.info • https://github.com/marcusoftnet/SpecFlowDemos • http://skillsmatter.com/podcast/agile-testing/refuctoring-yourcukes • http://skillsmatter.com/podcast/agile-testing/bdd-as-its-meantto-be-done • http://skillsmatter.com/podcast/agile-testing/cuke-envy-a-dotnet-programmers-attempt-to-catch-up
  61. 61. www.marcusoft.net @marcusoftnet marcus.hammarberg@aptitud.se
  62. 62. www.marcusoft.net @marcusoftnet marcus.hammarberg@aptitud.se
  63. 63. Recording of this talk http://www.youtube.com/ aptitudsthlm

×