SlideShare ist ein Scribd-Unternehmen logo
1 von 18
BDD WITH VISUAL STUDIO
2010, SPECFLOW AND WATIN
CHARLES NURSE
SENIOR ARCHITECT, DOTNETNUKE CORP.
CHARLES.NURSE@DNNCORP.COM
@CNURSE




                             DotNetNuke Corp. Confidential © 2011 All rights reserved.
AGENDA
•   Intro to BDD
•   Gherkins
•   SpecFlow
•   WatiN
•   Demos




                   DotNetNuke Corp. Confidential © 2011 All rights reserved.   2
PART 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 fails

BDD is a second-generation, outside–in, pull-based, multiple-stakeholder,
multiple-scale, high-automation, agile methodology. It describes a cycle of
interactions with well-defined outputs, resulting in the delivery of working,
tested software that matters.
                   Dan North

                            DotNetNuke Corp. Confidential © 2011 All rights reserved.   3
PART I – BEHAVIOR DRIVEN DEVELOPMENT
• Driven by Business Value
• Realized through the Interface (GUI)
• Tests are defined in a natural language (Gherkins)




                        DotNetNuke Corp. Confidential © 2011 All rights reserved.   4
PART 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
                       DotNetNuke Corp. Confidential © 2011 All rights reserved.   5
PART 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


                             DotNetNuke Corp. Confidential © 2011 All rights reserved.   6
PART 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




                       DotNetNuke Corp. Confidential © 2011 All rights reserved.   7
PART 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




                             DotNetNuke Corp. Confidential © 2011 All rights reserved.   8
PART 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




                            DotNetNuke Corp. Confidential © 2011 All rights reserved.   9
PART 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




                            DotNetNuke Corp. Confidential © 2011 All rights reserved.   10
PART 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



                           DotNetNuke Corp. Confidential © 2011 All rights reserved.   11
PART 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




                           DotNetNuke Corp. Confidential © 2011 All rights reserved.   12
PART 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

                            DotNetNuke Corp. Confidential © 2011 All rights reserved.   13
PART 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


                       DotNetNuke Corp. Confidential © 2011 All rights reserved.   14
PART 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!
                         DotNetNuke Corp. Confidential © 2011 All rights reserved.   15
PART 4 – WATIN
• Finish the Tests




                     DotNetNuke Corp. Confidential © 2011 All rights reserved.   16
PART 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




                            DotNetNuke Corp. Confidential © 2011 All rights reserved.   17
THANK YOU
• For more info:
   »   www.specflow.org
   »   https://github.com/techtalk/SpecFlow
   »   http://watin.org/
   »   www.dotnetnuke.com


• Feedback
   »   https://www.surveymonkey.com/s/GHLYGSS


• Email: charles.nurse@dnncorp.com
• Blog: www.charlesnurse.com
• Twitter: @cnurse


                           DotNetNuke Corp. Confidential © 2011 All rights reserved.   18

Weitere ähnliche Inhalte

Was ist angesagt?

Enterprise CI as-a-Service using Jenkins
Enterprise CI as-a-Service using JenkinsEnterprise CI as-a-Service using Jenkins
Enterprise CI as-a-Service using JenkinsCollabNet
 
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...CloudBees
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradleSwain Loda
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaEdureka!
 
How to Achieve more through Collaboration
How to Achieve more through Collaboration How to Achieve more through Collaboration
How to Achieve more through Collaboration Damien Garros
 
Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019Alan Pearson Mathews
 
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...Lucas Sacramento
 
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerMukta Aphale
 
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)CloudBees
 
Transforming Organizations with CI/CD
Transforming Organizations with CI/CDTransforming Organizations with CI/CD
Transforming Organizations with CI/CDCprime
 
Continuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardContinuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardTechWell
 
Perforce Innovations Showcase 
Perforce Innovations Showcase Perforce Innovations Showcase 
Perforce Innovations Showcase Perforce
 
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...Marcin Grzejszczak
 
Building a loosely coupled toolchain with Rundeck and Puppet
Building a loosely coupled toolchain with Rundeck and PuppetBuilding a loosely coupled toolchain with Rundeck and Puppet
Building a loosely coupled toolchain with Rundeck and Puppetsmeunier114
 
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...Gene Kim
 
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec JenkinsJournée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec JenkinsPublicis Sapient Engineering
 
JUC NY - Advanced Continuous Deployment with Jenkins
JUC NY - Advanced Continuous Deployment with JenkinsJUC NY - Advanced Continuous Deployment with Jenkins
JUC NY - Advanced Continuous Deployment with JenkinsXebiaLabs
 

Was ist angesagt? (20)

Enterprise CI as-a-Service using Jenkins
Enterprise CI as-a-Service using JenkinsEnterprise CI as-a-Service using Jenkins
Enterprise CI as-a-Service using Jenkins
 
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Scaling Jenkins
Scaling Jenkins Scaling Jenkins
Scaling Jenkins
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradle
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
 
How to Achieve more through Collaboration
How to Achieve more through Collaboration How to Achieve more through Collaboration
How to Achieve more through Collaboration
 
Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019
 
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...
 
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and Docker
 
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
 
Transforming Organizations with CI/CD
Transforming Organizations with CI/CDTransforming Organizations with CI/CD
Transforming Organizations with CI/CD
 
Continuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardContinuous Performance Testing: The New Standard
Continuous Performance Testing: The New Standard
 
Perforce Innovations Showcase 
Perforce Innovations Showcase Perforce Innovations Showcase 
Perforce Innovations Showcase 
 
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
 
From Continuous Integration to DevOps
From Continuous Integration to DevOpsFrom Continuous Integration to DevOps
From Continuous Integration to DevOps
 
Building a loosely coupled toolchain with Rundeck and Puppet
Building a loosely coupled toolchain with Rundeck and PuppetBuilding a loosely coupled toolchain with Rundeck and Puppet
Building a loosely coupled toolchain with Rundeck and Puppet
 
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
 
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec JenkinsJournée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
 
JUC NY - Advanced Continuous Deployment with Jenkins
JUC NY - Advanced Continuous Deployment with JenkinsJUC NY - Advanced Continuous Deployment with Jenkins
JUC NY - Advanced Continuous Deployment with Jenkins
 

Ähnlich wie BDD Visual Studio SpecFlow Watin

Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...Flink Forward
 
Mobile Quality Night Vienna 2015 - Mobile UI Testautomation mit Specflow
Mobile Quality Night Vienna 2015 - Mobile UI Testautomation mit SpecflowMobile Quality Night Vienna 2015 - Mobile UI Testautomation mit Specflow
Mobile Quality Night Vienna 2015 - Mobile UI Testautomation mit SpecflowRudolf Grötz
 
Interoperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About ThemInteroperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About ThemMark Voelker
 
DevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CD
DevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CDDevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CD
DevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CDDevOps_Fest
 
Staying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsStaying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsVagif Abilov
 
Use Docker to Enhance Your Testing
Use Docker to Enhance Your TestingUse Docker to Enhance Your Testing
Use Docker to Enhance Your TestingTechWell
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsMichael Lihs
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAdam Getchell
 
Enabling DevOps for IoT software development, powered by Open Source, OW2onli...
Enabling DevOps for IoT software development, powered by Open Source, OW2onli...Enabling DevOps for IoT software development, powered by Open Source, OW2onli...
Enabling DevOps for IoT software development, powered by Open Source, OW2onli...OW2
 
Pm deep dive scope management
Pm deep dive   scope managementPm deep dive   scope management
Pm deep dive scope managementNiraj Agarwal
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOpsCisco DevNet
 
DotNetNuke – CMS redefined
DotNetNuke – CMS redefinedDotNetNuke – CMS redefined
DotNetNuke – CMS redefinedCharles Nurse
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemBruno Borges
 

Ähnlich wie BDD Visual Studio SpecFlow Watin (20)

Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
 
Mobile Quality Night Vienna 2015 - Mobile UI Testautomation mit Specflow
Mobile Quality Night Vienna 2015 - Mobile UI Testautomation mit SpecflowMobile Quality Night Vienna 2015 - Mobile UI Testautomation mit Specflow
Mobile Quality Night Vienna 2015 - Mobile UI Testautomation mit Specflow
 
Interoperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About ThemInteroperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About Them
 
DevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CD
DevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CDDevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CD
DevOps Fest 2020. Kohsuke Kawaguchi. GitOps, Jenkins X & the Future of CI/CD
 
Staying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsStaying Close to Experts with Executable Specifications
Staying Close to Experts with Executable Specifications
 
Use Docker to Enhance Your Testing
Use Docker to Enhance Your TestingUse Docker to Enhance Your Testing
Use Docker to Enhance Your Testing
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
 
Enabling DevOps for IoT software development, powered by Open Source, OW2onli...
Enabling DevOps for IoT software development, powered by Open Source, OW2onli...Enabling DevOps for IoT software development, powered by Open Source, OW2onli...
Enabling DevOps for IoT software development, powered by Open Source, OW2onli...
 
How to debug IoT Agents
How to debug IoT AgentsHow to debug IoT Agents
How to debug IoT Agents
 
Pm deep dive scope management
Pm deep dive   scope managementPm deep dive   scope management
Pm deep dive scope management
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOps
 
DotNetNuke – CMS redefined
DotNetNuke – CMS redefinedDotNetNuke – CMS redefined
DotNetNuke – CMS redefined
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na Nuvem
 
Ci/CD Android
Ci/CD AndroidCi/CD Android
Ci/CD Android
 

Kürzlich hochgeladen

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsZilliz
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Kürzlich hochgeladen (20)

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

BDD Visual Studio SpecFlow Watin

  • 1. BDD WITH VISUAL STUDIO 2010, SPECFLOW AND WATIN CHARLES NURSE SENIOR ARCHITECT, DOTNETNUKE CORP. CHARLES.NURSE@DNNCORP.COM @CNURSE DotNetNuke Corp. Confidential © 2011 All rights reserved.
  • 2. AGENDA • Intro to BDD • Gherkins • SpecFlow • WatiN • Demos DotNetNuke Corp. Confidential © 2011 All rights reserved. 2
  • 3. PART 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 fails BDD is a second-generation, outside–in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. Dan North DotNetNuke Corp. Confidential © 2011 All rights reserved. 3
  • 4. PART I – BEHAVIOR DRIVEN DEVELOPMENT • Driven by Business Value • Realized through the Interface (GUI) • Tests are defined in a natural language (Gherkins) DotNetNuke Corp. Confidential © 2011 All rights reserved. 4
  • 5. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 5
  • 6. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 6
  • 7. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 7
  • 8. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 8
  • 9. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 9
  • 10. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 10
  • 11. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 11
  • 12. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 12
  • 13. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 13
  • 14. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 14
  • 15. PART 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! DotNetNuke Corp. Confidential © 2011 All rights reserved. 15
  • 16. PART 4 – WATIN • Finish the Tests DotNetNuke Corp. Confidential © 2011 All rights reserved. 16
  • 17. PART 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 DotNetNuke Corp. Confidential © 2011 All rights reserved. 17
  • 18. THANK YOU • For more info: » www.specflow.org » https://github.com/techtalk/SpecFlow » http://watin.org/ » www.dotnetnuke.com • Feedback » https://www.surveymonkey.com/s/GHLYGSS • Email: charles.nurse@dnncorp.com • Blog: www.charlesnurse.com • Twitter: @cnurse DotNetNuke Corp. Confidential © 2011 All rights reserved. 18

Hinweis der Redaktion

  1. http://en.wikipedia.org/wiki/Behavior_Driven_Developmenthttp://behaviour-driven.org/
  2. BDD is driven by business value[6]; that is, the benefit to the business which accrues once the application is in production. The only way in which this benefit can be realized is through the user interface(s) to the application, usually (but not always) a GUI.In the same way, each piece of code, starting with the UI, can be considered a stakeholder of the other modules of code which it uses. Each element of code provides some aspect of behavior which, in collaboration with the other elements, provides the application behavior.The first piece of production code that BDD developers implement is the UI. Developers can then benefit from quick feedback as to whether the UI looks and behaves appropriately. Through code, and using principles of good design and refactoring, developers discover collaborators of the UI, and of every unit of code thereafter. This helps them adhere to the principle of YAGNI, since each piece of production code is required either by the business, or by another piece of code already written.BDD focuses on obtaining a clear understanding of desired software behavior through discussion with stakeholders. It extends TDD by writing test cases in a natural language that non-programmers can read. Behavior-driven developers use their native language in combination with the ubiquitous language of domain-driven design to describe the purpose and benefit of their code. This allows the developers to focus on why the code should be created, rather than the technical details, and minimizes translation between the technical language in which the code is written and the domain language spoken by the business, users, stakeholders, project management, etc
  3. Establishing the goals of different stakeholders required for a vision to be implementedDrawing out features which will achieve those goals using feature injectionInvolving stakeholders in the implementation process through outside–in software developmentUsing examples to describe the behavior of the application, or of units of codeAutomating those examples to provide quick feedback and regression testingUsing 'should' when describing the behavior of software to help clarify responsibility and allow the software's functionality to be questionedUsing 'ensure' when describing responsibilities of software to differentiate outcomes in the scope of the code in question from side-effects of other elements of code.Using mocks to stand-in for collaborating modules of code which have not yet been written