© Hive Studios 2011 Behaviour Driven Development Visual Studio 2010 & SpecFlow Ivan Pavlović, Hive Studios Visual C# MVP, Certified ScrumMaster

Slides:



Advertisements
Similar presentations
1 19-Jan-14 © Copyright: City Boy Salary : Simon Powers : 2014 Brown Bag – Behaviour Driven Development with Specflow Brown Bag – Behaviour Driven Development.
Advertisements

Use-Cases.
Use Case Diagrams Damian Gordon.
(Advanced) Web Application Development Test Driven Development with Ruby and Rails Bruce Scharlau, University of Aberdeen, 2013.
Use Case & Use Case Diagram
Google Confidential and Proprietary Succeeding with Behavior Driven Development (BDD) Testing and Automation Seattle Area Software Quality Assurance Group.
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Story-Based Test Automation Using Free Tools
Acceptance Test Driven Development with SpecFlow and Friends
Tim Scott Jeff Lyon. Automated testing? TDD? BDD?
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
 What is Software Testing  Terminologies used in Software testing  Types of Testing  What is Manual Testing  Types of Manual Testing  Process that.
Software Development, Programming, Testing & Implementation.
SpecFlow & Gherkin Behavior Driven Development. Definitions Behavior Driven Development SpecFlow Structure Gerkin Demo Agenda.
Learn how SpecFlow enables you to do TDD with friction-free plain-English executable tests. Larry Apke Agile Expert
Living Requirements using Behavior Driven Development
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
By Bob Bunson  Simulation of software development project  Fictitious system from Concept to Code  Oriented around the.
TEST-DRIVEN DEVELOPMENT AND MVP Cory Foy and Michael Russo.
Introduction 01_intro.ppt
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
© Hive Studios 2011 Ivan Pavlović, Hive Studios Visual C# MVP, MCT, CSM
JavaScript & jQuery the missing manual Chapter 11
Background The Encyclopedio of Life (EOL) is an ROR open source project to create a free, online reference source and database for every one of the 1.8.
Behaviour Driven Development with Cucumber for Java.
Software Development Stephenson College. Classic Life Cycle.
Effectiveness of different designs of input and out put.
Introducing Reporting Services for SQL Server 2005.
Functional Automation Testing Case Study 360logica Software Testing Services.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
A TEST FRAMEWORK USING PROTRACTOR, CUCUMBER & CUCUMBER SANDWICH
1 After completing this lesson, you will be able to: Transfer your files to the Internet. Choose a method for posting your Web pages. Use Microsoft’s My.
Automated Acceptance Testing and Continuous Delivery Larry Apke Agile Expert
Microsoft Visual Studio 2010 Teacher: Ms. Olifer.
Telerik Software Academy Software Quality Assurance Binding business requirements to.NET code.
© Hive Studios 2011 Ivan Pavlović, Hive Studios Visual C# MVP, MCT, CSM
Chapter 11 Using SAS ® Web Report Studio. Section 11.1 Overview of SAS Web Report Studio.
Connecting with Computer Science2 Objectives Learn how software engineering is used to create applications Learn some of the different software engineering.
Requirements specification Why is this the first major stage of software development? –Need to understand what customer wants first Goal of requirements.
BEHAVIOR DRIVEN TEST DEVELOPMENT Specification by Example.
1 Presentation Title Test-driven development (TDD) Overview David Wu.
Chapter 8A Productivity Software. 8A-2 Acquiring Software Commercial software –Software that must be purchased –Stand alone products Solve one type of.
Word 2007® Business and Personal Communication How can Microsoft Word 2007 help you work with others?
BEHAVIOR DRIVEN TEST DEVELOPMENT Specification by Example All Rights Reserved - Sound Agile Consulting.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
.NET Mobile Application Development XML Web Services.
We Behatin’. INTRODUCTION Behat background 3 Behat prep Getting started
How and why we should use Behat?. About me Bozhidar Boshnakov QA Department FFW Drupal.org – bboshnakov Linkedin.com/in/bboshnakov.
Continuous Delivery and Team Foundation Server 2013 Ognjen Bajić Ana Roje Ivančić Ekobit.
Introduction to Workbot 2.0 Ryan Li  Test automation  ant the Cucumber.
Arklio Studija 2007 File: / / Page 1 Automated web application testing using Selenium
Freshen your test cases Kausikram Krishnasayee
HPE ALM Octane.
BEHAVIOR DRIVEN DEVELOPMENT / TESTING (BDD)
TEST AUTOMATION IN BDD WAY
JRA2: Acceptance Testing senarious
TESTING TOOLS MANUAL APPROACH BY J.ADI SESHU.
Understanding SOAP and REST calls The types of web service requests
Computer Software: Programming
Advantages OF BDD Testing
DevOps - Extreme Automation using Cucumber, Selenium, Ruby
Compile and Execute Requirements in Microsoft .NET
Event loops 17-Jan-19.
API DOCUMENTATION Swetha Mohandas Microsoft Connect 2016
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Open Source Tool Based Automation solution with Continuous Integration and end to end BDD Implementation Arun Krishnan - Automation Manager Maria Afzal-
Introduction to BDD. Introduction to BDD “BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation,
Telerik Testing Framework
Automated browser testing with Selenium and C#
Open Source Tool Based Automation solution with Continuous Integration and end to end BDD Implementation Arun Krishnan - Automation Manager Maria Afzal-
Presentation transcript:

© Hive Studios 2011 Behaviour Driven Development Visual Studio 2010 & SpecFlow Ivan Pavlović, Hive Studios Visual C# MVP, Certified ScrumMaster

© Hive Studios 2011 Agenda A little bit of slides and a lot of examples What is BDD Language Tools Examples

© Hive Studios 2011 Basic Test Types Unit testing Acceptance / Customer testing Integration testing Performance testing Regression testing

© Hive Studios 2011 Behaviour Driven Development One of agile techniques Improves communication between developers and domain experst Example driven specification 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 (

© Hive Studios 2011 Gherkin (kornišon) Domain Specific Language Natural human language Simple syntax – Feature – Background – Scenario, Scenario Outline – Given, When, Then Localized to 35+ languages

© Hive Studios 2011 Example 1: Feature: Some descriptive text of what is desired 2: In order to realize a named business value 3: As an explicit system actor 4: I want to gain some beneficial outcome which furthers the goal 5: 6: Scenario: Some determinable business situation 7: Given some precondition 8: And some other precondition 9: When some action by the actor 10: And some other action 11: And yet another action 12: Then some testable outcome is achieved 13: And something else we can check happens too 14: 15: Scenario: A different situation 16:...

© Hive Studios 2011 Real example Feature: Serve coffee In order to earn money Customers should be able to buy coffee at all times Scenario: Buy last coffee Given there are 1 coffees left in the machine And I have deposited 1$ When I press the coffee button Then I should be served a coffee

© Hive Studios 2011 Tools Tools are file generators that consumes *.feature files and creates test fixtures Cucumber – Ruby, SpecFlow –.NET, – Nunit, MSTest, MBUnit… …and many others

© Hive Studios 2011 How it works 1.BA or user writes a feature and scenarios and agree with dev that it is doable 2.SpecFlow generates one test per scenario 3.Developer implements step definitions 4.Developer writes just enough code to make tests green 5.Move on to the next scenario

© Hive Studios 2011 Step Definition Mapping … 7: Given some precondition 8: And some other precondition 9: When some action by the actor 10: Then some testable outcome is achieved precondition")] public void SomePrecondition() { … do something… } other precondition")] public void SomePrecondition() { … do something… } action by the actor")] public void SomePrecondition() { … do something… } verifiable result”)] Public void VerifyResult() { … do assert… }

© Hive Studios 2011

Arguments - RegEx … 7: Given I have 5 apples 8: And I eat 2 of them 9: When someone asks how many apples I do have 10: Then I should answer “3 apples” have (.*) apples")] public void SomePrecondition(int numberOfApples) { … do something… } I eat (.*) of them")] public void SomePrecondition(int numberOfEatenApples) { … do something… } someone asks how many apples I do have")] public void SomePrecondition() { … do something… } I should answer \“(.*) apples\””)] Public void VerifyResult(int expected) { … do assert of expected … }

© Hive Studios 2011

Table-like Parameters Scenario: Posting a valid entry Given I am on the posting page And I have filled out the form as follows | Label | Value | | Your name | Jakob | | Your comment | Das ist gut! | When I click the button labelled "Post" Then I should be on the guestbook page And the guestbook entries includes the following | Name | Comment | Posted date | | Jakob | Das ist gut! | (within last minute) |

© Hive Studios 2011 Scenario outline Scenario: TC1 Add two numbers Given I have entered 1 into the calculator And I have entered 2 into the calculator When I press add Then the result should be 3 on the screen Scenario: TC2 Add two numbers Given I have entered 2 into the calculator And I have entered 2 into the calculator When I press add Then the result should be 4 on the screen

© Hive Studios 2011 Scenario outline Scenario Outline: TC5 Given I have entered into the calculator And I have entered into the calculator When I press add Then the result should be on the screen Scenarios: addition | x | y | result| | 1 | 2 | 3 | | 2 | 2 | 4 | | 3 | -3 | 0 |

© Hive Studios 2011

What to Put into Step Definitions It is your call Depend on what you want to test 1.Public Interfaces / Components 2.WebUI using browser automation WatiN, Selenium 3.WebUI using Request/Respons Http Get/Post 4.Win UI using automation White / Windows UI Automation

© Hive Studios 2011 Resources Specflow Gherkin White WatiN

© Hive Studios 2011 MSForge.NET Šta je MS Forge? MSForge.net je lokalni web portal i mesto okupljanja svih Windows, SQL Server i.NET fanova, kao i svih onih koji žele da rade sa ovim tehnologijama. MSForge.net daje podršku i omogućava Web prisustvo lokalnim User grupama.lokalnim User grupama Ko čini MS Forge? MSForge.net okuplja ljude koji se profesionalno ili iz hobija bave Microsoft tehnologijama. Člansto na portalu i u User grupama je besplatno i dobrodošli su svi koji žele da saznaju nešto novo i da svoja znanja podele sa drugima. Kako MS Forge može da pomogne Pokretačka ideja koja stoji iza MSForge.net i user grupa je razmena znanja. Odgovore na pitanja možete potražiti kako online (na blogivima ili na forumu) tako i na sastancima User grupa o kojima ćete biti obavešteni putem MSForge portala. Priključi se! Radu MSForge.net portala i User grupa možete i sami da doprinesete. Deljenjem znanja i iskustava na blogovima ili forumima doprinećete ne samo napretku naše online zajednice, već ćete mnogima omogućiti da unaprede svoja znanja. Ukoliko imate interesantnu ideju za predavanje kontaktirajte moderatora User grupe.User grupe