Your SlideShare is downloading. ×
0
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Automated ui testing with Specflow and WaTiN
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Automated ui testing with Specflow and WaTiN

3,316

Published on

Test Driven Development is a phenonemon every developer should be aware of by now. I can't believe I've been developing professionally without it, and have been using it in every project since I …

Test Driven Development is a phenonemon every developer should be aware of by now. I can't believe I've been developing professionally without it, and have been using it in every project since I discovered it 5 years ago. But, applying TDD on UI logic can be challenging, even if you apply patterns like MVC, MVP or Presentation Model. Creating readable and maintainable unit tests that drive a Presentation, ViewModel or Controller is a big maintenance burden.

That's why our ASP.NET WebForms/MVC project jumped on the SpecFlow and WaTiN bandwagon. Using this beautiful combination we can now smoke test the overall behavior of the system, in addition to the large coverage of automated unit tests. Granted, this isn't the same as Acceptance Test Driven Development, but those smoke tests have been really worth their money. The functional abstraction that SpecFlow offers has proven to be a valuable aspect that allows us to keep our UI tests maintainable. In fact, the Gherkin matra Given-When-Then has even found its way to our test professionals.

During this talk, I'd like to share some of the basic principles behind SpecFlow and the most important aspects of WaTiN. Just like with TDD, there's a whole lot you can do wrong. That's why I want to focus on some of the best practices that worked for us. Anyway, if you're serious about building high quality products and system, check out what I have to share.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,316
On Slideshare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
33
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Automated Testing With SpecFlow and WaTiN Dennis Doomen© 2012 Aviva Solutions dennis.doomen@avivasolutions.nl 30 augustus 2012
  • 2. About Me • Principal Consultant • 15 years IT experience • C++ origins but C# since 2001 • Specialties • .NET Architecture • Scrum/XP • ALM • Speaker • Public initiatives • Silverlight Cookbook • C# Coding Guidelines • Fluent Assertions • Internet • www.dennisdoomen.net • DZone MVB • @ddoomen© 2012 Aviva Solutions Dennis Doomen 30 augustus 2012
  • 3. Challenges of User Interface Automation© 2012 Aviva Solutions 30 augustus 2012
  • 4. Levels of UI Automation Stability Functional User Workflow Technical Activity© 2012 Aviva Solutions 30 augustus 2012
  • 5. Smoke Specification Tests Performance by Example Tests Given a ninja has a third level black-belt When attacked by Chuck Norris Then the ninja should run for his life Living Behavior Driven Documentation Development Characteristics Tests© 2012 Aviva Solutions 30 augustus 2012
  • 6. ATDD combined with TDD Image from Growing Object-Oriented Software, Guided by Tests© 2012 Aviva Solutions 30 augustus 2012
  • 7. Deep Dive Demo© 2012 Aviva Solutions 30 augustus 2012
  • 8. Stability Gherkin Scenarios Functional Step Definitions User Workflow WaTiN Technical Activity© 2012 Aviva Solutions 30 augustus 2012
  • 9. Required Skills Scenarios Coding Skills Testing Skills Step Definitions Support Code WaTiN© 2012 Aviva Solutions 30 augustus 2012
  • 10. Features • Represent functional slices • Use Ubiquitous Language • Name liked a book or chapter • Organized by Epic User Stories Feature: Hosting Dinners In order to increase my business network As a entrepeneur I want to host dinners with interesting people from the community© 2012 Aviva Solutions 30 augustus 2012
  • 11. Scenarios • Key Examples of the Feature • Stakeholder perspective • UI agnostic • != test scripts • Manually executable • Grammatically correct Scenario: Attempting to host a dinner as a registered user Given a registered user When you want to host a dinner Then you should be able to schedule a dinner© 2012 Aviva Solutions 30 augustus 2012
  • 12. Steps • Global over all features • Don’t combine • Given = state • When = actions • Then = visible change Scenario: Attempting to host a dinner as a registered user Given a registered user When you want to host a dinner Then you should be able to schedule a dinner© 2012 Aviva Solutions 30 augustus 2012
  • 13. Step Definition • Grouped by entities, entity groups or domain concepts • Always use Page/Control pattern • No private helper methods© 2012 Aviva Solutions 30 augustus 2012
  • 14. Tables Scoped Scenario Bindings Outlines Hooks Advanced Topics Tags Step-Argument Conversion Step Definitions Data Sharing Assist Helpers© 2012 Aviva Solutions 30 augustus 2012
  • 15. Reading Material • Demo Code https://github.com/dennisdoomen/specflowdemo • The Cucumber Book http://pragprog.com/book/hwcuc/the-cucumber-book • The Secret Ninja Cucumber Scrolls http://cuke4ninja.com/toc.html • Death by UI Test Automation http://gojko.net/2010/07/29/the-sine-of-death-by-ui-test-automation/ • Code-to-Test Ratios, TDD and BDD http://www.infoq.com/articles/virtual-panel-tdd-bdd • Growing Object-Oriented Software, Guided by Tests http://www.amazon.com/Growing-Object-Oriented-Software-Guided- Tests/dp/0321503627© 2012 Aviva Solutions 30 augustus 2012
  • 16. Email dennis.doomen@avivasolutions.nl Twitter @ddoomen Blog www.dennisdoomen.net© 2012 Aviva Solutions 30 augustus 2012

×