SlideShare a Scribd company logo
1 of 29
Download to read offline
GTC-NL-FXD Rachid Kherazi
Behavior Driven Testing (BDT)
with MS VS2010 & SpecFlow
Confidential
GTC-NL for internal use
Goal of presentation
• Informative
• Share my knowledge w.r.t. Testing and Test tools
In the scope of “did you know?”
Gathered in my daily train trips
Amstelveen Best
Confidential
GTC-NL for internal use
Qeustion 1: what are the following two vegetables?
Subject of today is related to some vegetables
Answer 1: Cucumber Gherkin
Question 2: What is the difference between the two?
Answer 2:
Cucumber: Tool, behavior driven development, …
Gherkin: Language, Business Readable, Domain Specific Language,..
Let start with a Quiz
Confidential
GTC-NL for internal use
Content
• Behavior Driven Development (Development view)
– Agile Iteration and Test Driven Development (TDD)
– What’s all these DD’s? (TFD, TDD, BDD, ATDD and SDD)
– Scenario/Story and Gherkin-syntax
– Executable Specification
– Behavior Driven Development tools
– Live demo with SpecFlow
• Behavior Driven Testing (Test view)
– DDB vs BDT
Confidential
GTC-NL for internal use
http://www.synerzip.com/agile-method.htm
Introduction: Agile iterations and TTD
Confidential
GTC-NL for internal use
ATDD
- Acceptance Test Driven
- Different than BDD?
- Start with the acceptance test
- Examples,
(2) Write the
implementation code to
make the test pass. Keep
it simple
(3) Change the code to
remove duplication in code
and to improve the design
while ensuring that all tests
still pass.
(1) Imagine how the new
code should be called and
write the test as if the code
already existed
Confidential
GTC-NL for internal use
What are the advantages of TDD?
• TDD shortens the programming feedback loop
• TDD provides detailed specification (tests)
• TDD promotes the development of high-quality code
• TDD provides concrete evidence that your software works
• TDD supports evolutionary development
• TDD encourages developers to write code that is easily tested
TDD is used in
Agile development
eXtreme programming
Confidential
GTC-NL for internal use
ATDD
- Acceptance Test Driven
- Different than BDD?
- Start with the acceptance test
- Examples,
Test First
Development
Refactor
TDD
Start from acceptation test
Focus on behavior of feature
S/BDD
Confidential
GTC-NL for internal use
What’s all these DD’s?
TFD Test First Development
TDD Test Driven Development
ATDD Acceptance Test Driven Development
BDD Behavior Driven Development
STDD Story Test Driven Development
TTD = Test First Development + Refactor (remove duplicate, improve design)
Micro view
ATDD start for end user acceptance test
Macro view
BDD focus on the behavior of the feature
Based on user story: a couple of examples on how SUT could be used
Story written in a standard syntax: e.g. Given / When / Then
The [Given, When, Then] syntax is called Gherkin
First create test (Failing test) than create implementation (Test passed)
Given [initial context]
When [event]
Then [an outcome]
Subsequent steps of the same kind can also be specified with the “And “ and “But” keyword
Variations on a Theme
Context
Specification
AAA
User Story
Structure
Establish
Initial Context
Given
Arrange
SetContext
Interact with
SUT
When
Act
BecauseOf
Check the
results
Then
Assert
ItShould
Confidential
GTC-NL for internal use
Example: Application Under Test
(3) Application displays “Hello Best Tester: Password is Correct”
(If password = “Rachid”)
(1) type password “Rachid”
(2) press Login button
(0) start application
“Say Hello Best Tester” a simple application for demo purpose.
According req. of this tool: “Rachid”, “Ali” and ‘Pieter” are correct passwords for login.
Confidential
GTC-NL for internal use
Example: Feature file (Scenario’s: Given When Then)
Feature: Log-In in “Best Tester Application”, check correctness of
password
Scenario: Check Login with correct password
Given Application is started
When correct password is typed
And Login button is pressed
Then Login should be successful
And Messagebox should display "Hello Best Tester: Password Correct"
Describe some piece of functionality of the system
Plain readable text
Features contain one or more scenarios
A scenario describes a single acceptance test for a feature
Most features are composed of multiple scenarios
Tool generates a test for each scenario
The name of the test is generated from the scenario title
Confidential
GTC-NL for internal use
When scenario/story is in place it would be wonderful if there is a
tool that can run this scenario’s to verify that the implementation
actually behaves as specified.
Executable specification that verifies that the implementation behaves as expected, readable by all in the team, and around it
Requirements
/Behavior
In well known
format
e.g.
Given/When/Then
Tool
Implementation
(SUT)
Main benefit
Main benefit is not in the tool!
The benefit is that team get together and write down a common,
shared knowledge in a well known format. In one place.
Confidential
GTC-NL for internal use
Tools
This was the idea of Cucumber tool that first was created in the Ruby-community.
Cucumber can execute scenarios written in the Given/When/Then-syntax.
For .Net framework SpecFlow is known good tool.
Both tools used Gherkin syntax and are free (open source).
Cucumber
Ruby
SpecFlow
.Net
Confidential
GTC-NL for internal use
Behavior Driven Development in one slide
Feature file
(Scenario’s: Given When Then)
Test class (for Nunit)
Generated by SpecFow tool (.cs)
Stepper class
binding with implementation (.cs)
Implementation
(.dll, .exe)
Nunit dll
Nunit
Test
report
Code of Implementation (.cs)
Visual Studio 2010 + SpecFlow
SW developer
Requirements
User
feedback1
2
3
4
5
6
7
8
Confidential
GTC-NL for internal use
Some handy Attributes
Background
With the keyword background you can run some steps before each scenario in the
feature.
Hooks
Hooks are events that is fired in the following order.
And you can “hook in” code here to do useful things:
- Restore a database
- Dump a log on error
- Init variables before steps
Scenario outlines
Data-driven scenarios or scenario templates
Consists of Scenario template specification with data placeholders
Tool generates parameterized test logic for the scenario outline and individual test
method for each example set (using pairwise testing)
Confidential
GTC-NL for internal use
Some handy Attributes
Tag
Can be used to specify “categories” for Nunit or other test runners
e.g. @RegressionTestSet
@ignore tag is a special tag “ignore test”
# is reserved for comment
#language
The language of the feature files can be either specified globally in the
configuration file or in the header of the feature file using “#language” keyword
different ISO languages are supported
Debugging Tests
SpecFlow Visual Studio integration also supports debugging the execution of the
tests. Just like in the source code files of your project, you can also place
breakpoints in the SpecFlow feature files. Whenever you execute the generated
tests in debug mode, the execution will stop at the specified breakpoints and you
can execute the steps one-by-one using the standard “Step Over” (F10)
command or you can go to the detailed execution of the bindings using the “Step
Into” (F11) command.
Confidential
GTC-NL for internal use
SpecFlow configuration file
language
Test runner
Stop at error
Confidential
GTC-NL for internal use
Live demo “SayHello Application”
VS 2010 and SpecFlow Link Nunitdll
Confidential
GTC-NL for internal use
SpecFlow and generated Test Results
SpecFlow tool generates clear and concise report
Report
Confidential
GTC-NL for internal use
Behavior Driven Development in one slide
Feature file
(Scenario’s: Given When Then)
Test class (for Nunit)
Generated by SpecFow tool (.cs)
Stepper class
binding with implementation (.cs)
Implementation
(.dll, .exe)
Nunit dll
Nunit
Test
report
Code of Implementation (.cs)
Visual Studio 2010 + SpecFlow
SW developer
Requirements
User
feedback1
2
3
4
5
6
7
8
Confidential
GTC-NL for internal use
Behavior Driven Testing in one slide
Feature file
(Scenario’s: Given When Then)
Test class (for Nunit)
Generated by SpecFow tool (.cs)
Stepper class
binding with implementation (.cs)
SUT (FlashLite)
Nunit dll
Bello/Nunit
Test
report
Visual Studio 2010 + SpecFlow
Requirements
Tester SW/FW developer
implementation
code
Development
environment
User
SW/FW Implementation
feedback
4
2
3
1
5
Confidential
GTC-NL for internal use
http://www.synerzip.com/agile-method.htm
Behavior driven testing
Development domain
Test domain
Confidential
GTC-NL for internal use
BDD vs BDT
• Behavior Driven Development (BDD)
– Development domain
– White box
– Micro view
– Input = specification (Behavior)
– Output = Implementation
• Behavior Driven Testing (BDT)
– Test domain
– Black box (interface)
– Macro view
– Input = Specification (Behavior)
– Output = Test
Confidential
GTC-NL for internal use
Requirement Based Testing in one slide
Feature file
(Scenario’s: Given When Then)
Test class (for Nunit)
Generated by SpecFow tool (.cs)
Stepper class
binding with implementation (.cs)
SUT (FlashLite)
Nunit dll
Bello/Nunit
Test
report
Visual Studio 2010 + SpecFlow
Requirements
doc
SW/FW developer
implementation
code
Development
environment
User
SW/FW Implementation
feedback
4
3
2
1
5
Spec.doc to Feature file
convertor
(2) = refactor= clean up and improveTester
To be
developed
Confidential
GTC-NL for internal use
Learn more about SpecFlow and BDD
http://blog.dannorth.net/introducing-bdd/
http://www.specflow.org/
https://github.com/techtalk/SpecFlow
http://github.com/techtalk/SpecFlow-Examples
http://github.com/aslakhellesoy/cucumber/wiki
http://www.marcusoft.net/search/label/SpecFlow
https://github.com/marcushammarberg/
https://www.marcusoft.net
Free downloadable book
Confidential
GTC-NL for internal use
1, 2, 3
Given
When
Then
[TestMethod]
public void
Total_Should_Be_1_When_1_Product_Added()
{
var cart = new ShoppingCart("TEST");
cart.AddItem(new Product("SKU"));
Assert.AreEqual(1, cart.TotalItems);
}

More Related Content

What's hot

Writing Test Cases in Agile
Writing Test Cases in AgileWriting Test Cases in Agile
Writing Test Cases in AgileSaroj Singh
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVASrinivas Katakam
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber Knoldus Inc.
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
Cucumber presentation
Cucumber presentationCucumber presentation
Cucumber presentationAkhila B
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
QA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. SeleniumQA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. SeleniumLyudmil Latinov
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Simplilearn
 
Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSmartBear
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#srivinayak
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework DesignsSauce Labs
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development CodeOps Technologies LLP
 

What's hot (20)

Writing Test Cases in Agile
Writing Test Cases in AgileWriting Test Cases in Agile
Writing Test Cases in Agile
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Cucumber presentation
Cucumber presentationCucumber presentation
Cucumber presentation
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
QA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. SeleniumQA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. Selenium
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
Selenium-Locators
Selenium-LocatorsSelenium-Locators
Selenium-Locators
 
Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile World
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Gherkin /BDD intro
Gherkin /BDD introGherkin /BDD intro
Gherkin /BDD intro
 
Test case writing
Test case writingTest case writing
Test case writing
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 

Viewers also liked

Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflowcromwellryan
 
Behaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlowBehaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlowPascal Laurin
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
Brand mangement main
Brand mangement mainBrand mangement main
Brand mangement mainprashhh
 
Abductionexperience
AbductionexperienceAbductionexperience
Abductionexperiencegorin2008
 
Aliens syllabus-2010aliens-syllabus-2010
Aliens syllabus-2010aliens-syllabus-2010Aliens syllabus-2010aliens-syllabus-2010
Aliens syllabus-2010aliens-syllabus-2010gorin2008
 
Delilah Panio - 2012 Un-Resume
Delilah Panio - 2012 Un-ResumeDelilah Panio - 2012 Un-Resume
Delilah Panio - 2012 Un-ResumeDelilahPanio
 
Ad Libitum 07
Ad Libitum 07Ad Libitum 07
Ad Libitum 07soumitroy
 
PeopleZone
PeopleZonePeopleZone
PeopleZoneCodeZone
 
By carolina and julia
By carolina and juliaBy carolina and julia
By carolina and julialola caravaca
 
Presentación david human reproduction
Presentación david human reproductionPresentación david human reproduction
Presentación david human reproductionlola caravaca
 
Landscapes in spain luis
Landscapes in spain luisLandscapes in spain luis
Landscapes in spain luislola caravaca
 

Viewers also liked (20)

Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
 
Behaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlowBehaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlow
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Ecosystems gimena
Ecosystems gimenaEcosystems gimena
Ecosystems gimena
 
Brand mangement main
Brand mangement mainBrand mangement main
Brand mangement main
 
Abductionexperience
AbductionexperienceAbductionexperience
Abductionexperience
 
Bader ufo3
Bader ufo3Bader ufo3
Bader ufo3
 
Crime
CrimeCrime
Crime
 
Aliens syllabus-2010aliens-syllabus-2010
Aliens syllabus-2010aliens-syllabus-2010Aliens syllabus-2010aliens-syllabus-2010
Aliens syllabus-2010aliens-syllabus-2010
 
Delilah Panio - 2012 Un-Resume
Delilah Panio - 2012 Un-ResumeDelilah Panio - 2012 Un-Resume
Delilah Panio - 2012 Un-Resume
 
465
465465
465
 
Ad Libitum 07
Ad Libitum 07Ad Libitum 07
Ad Libitum 07
 
PeopleZone
PeopleZonePeopleZone
PeopleZone
 
Bader ufo3
Bader ufo3Bader ufo3
Bader ufo3
 
By carolina and julia
By carolina and juliaBy carolina and julia
By carolina and julia
 
Presentación david human reproduction
Presentación david human reproductionPresentación david human reproduction
Presentación david human reproduction
 
Nazi
NaziNazi
Nazi
 
Landscapes in spain luis
Landscapes in spain luisLandscapes in spain luis
Landscapes in spain luis
 

Similar to Behavior Driven Development with SpecFlow

TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012Tieturi Oy
 
CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWDVikas Sarin
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
PHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersPHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersAdam Englander
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Gianluca Padovani
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoElad Elrom
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesTao Xie
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginnersAdam Englander
 
Manual testing visonia
Manual testing   visoniaManual testing   visonia
Manual testing visoniaVisoniaTechlab
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Ukraine
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005David O'Dowd
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Gianluca Padovani
 
Katalon Studio - Successful Test Automation for both Testers and Developers
Katalon Studio - Successful Test Automation for both Testers and DevelopersKatalon Studio - Successful Test Automation for both Testers and Developers
Katalon Studio - Successful Test Automation for both Testers and DevelopersKatalon Studio
 
Testing apps with MTM and Tea Foundation Service
Testing apps with MTM and Tea Foundation ServiceTesting apps with MTM and Tea Foundation Service
Testing apps with MTM and Tea Foundation ServiceKevin DeRudder
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 

Similar to Behavior Driven Development with SpecFlow (20)

TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
 
CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWD
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
PHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersPHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for Beginners
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)
 
BDD using Cucumber JVM
BDD using Cucumber JVMBDD using Cucumber JVM
BDD using Cucumber JVM
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and Challenges
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
Manual testing visonia
Manual testing   visoniaManual testing   visonia
Manual testing visonia
 
Resume_shai.docx
Resume_shai.docxResume_shai.docx
Resume_shai.docx
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)
 
Katalon Studio - Successful Test Automation for both Testers and Developers
Katalon Studio - Successful Test Automation for both Testers and DevelopersKatalon Studio - Successful Test Automation for both Testers and Developers
Katalon Studio - Successful Test Automation for both Testers and Developers
 
Testing apps with MTM and Tea Foundation Service
Testing apps with MTM and Tea Foundation ServiceTesting apps with MTM and Tea Foundation Service
Testing apps with MTM and Tea Foundation Service
 
Resume
ResumeResume
Resume
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 

More from Rachid Kherrazi

Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...Rachid Kherrazi
 
Behavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlowBehavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlowRachid Kherrazi
 
Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer Rachid Kherrazi
 
Using task models in model-based testing
Using task models in model-based testingUsing task models in model-based testing
Using task models in model-based testingRachid Kherrazi
 
ASDSpec, Model Based Testing
ASDSpec, Model Based TestingASDSpec, Model Based Testing
ASDSpec, Model Based TestingRachid Kherrazi
 
Rachid kherrazi-testing-asd-interface-compliance-with-asd spec
Rachid kherrazi-testing-asd-interface-compliance-with-asd specRachid kherrazi-testing-asd-interface-compliance-with-asd spec
Rachid kherrazi-testing-asd-interface-compliance-with-asd specRachid Kherrazi
 

More from Rachid Kherrazi (7)

Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...
 
Behavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlowBehavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlow
 
Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer
 
Using task models in model-based testing
Using task models in model-based testingUsing task models in model-based testing
Using task models in model-based testing
 
Model Based Testing
Model Based TestingModel Based Testing
Model Based Testing
 
ASDSpec, Model Based Testing
ASDSpec, Model Based TestingASDSpec, Model Based Testing
ASDSpec, Model Based Testing
 
Rachid kherrazi-testing-asd-interface-compliance-with-asd spec
Rachid kherrazi-testing-asd-interface-compliance-with-asd specRachid kherrazi-testing-asd-interface-compliance-with-asd spec
Rachid kherrazi-testing-asd-interface-compliance-with-asd spec
 

Recently uploaded

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Recently uploaded (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Behavior Driven Development with SpecFlow

  • 1. GTC-NL-FXD Rachid Kherazi Behavior Driven Testing (BDT) with MS VS2010 & SpecFlow
  • 2. Confidential GTC-NL for internal use Goal of presentation • Informative • Share my knowledge w.r.t. Testing and Test tools In the scope of “did you know?” Gathered in my daily train trips Amstelveen Best
  • 3. Confidential GTC-NL for internal use Qeustion 1: what are the following two vegetables? Subject of today is related to some vegetables Answer 1: Cucumber Gherkin Question 2: What is the difference between the two? Answer 2: Cucumber: Tool, behavior driven development, … Gherkin: Language, Business Readable, Domain Specific Language,.. Let start with a Quiz
  • 4. Confidential GTC-NL for internal use Content • Behavior Driven Development (Development view) – Agile Iteration and Test Driven Development (TDD) – What’s all these DD’s? (TFD, TDD, BDD, ATDD and SDD) – Scenario/Story and Gherkin-syntax – Executable Specification – Behavior Driven Development tools – Live demo with SpecFlow • Behavior Driven Testing (Test view) – DDB vs BDT
  • 5. Confidential GTC-NL for internal use http://www.synerzip.com/agile-method.htm Introduction: Agile iterations and TTD
  • 6. Confidential GTC-NL for internal use ATDD - Acceptance Test Driven - Different than BDD? - Start with the acceptance test - Examples, (2) Write the implementation code to make the test pass. Keep it simple (3) Change the code to remove duplication in code and to improve the design while ensuring that all tests still pass. (1) Imagine how the new code should be called and write the test as if the code already existed
  • 7. Confidential GTC-NL for internal use What are the advantages of TDD? • TDD shortens the programming feedback loop • TDD provides detailed specification (tests) • TDD promotes the development of high-quality code • TDD provides concrete evidence that your software works • TDD supports evolutionary development • TDD encourages developers to write code that is easily tested TDD is used in Agile development eXtreme programming
  • 8. Confidential GTC-NL for internal use ATDD - Acceptance Test Driven - Different than BDD? - Start with the acceptance test - Examples, Test First Development Refactor TDD Start from acceptation test Focus on behavior of feature S/BDD
  • 9. Confidential GTC-NL for internal use What’s all these DD’s? TFD Test First Development TDD Test Driven Development ATDD Acceptance Test Driven Development BDD Behavior Driven Development STDD Story Test Driven Development TTD = Test First Development + Refactor (remove duplicate, improve design) Micro view ATDD start for end user acceptance test Macro view BDD focus on the behavior of the feature Based on user story: a couple of examples on how SUT could be used Story written in a standard syntax: e.g. Given / When / Then The [Given, When, Then] syntax is called Gherkin First create test (Failing test) than create implementation (Test passed)
  • 10. Given [initial context] When [event] Then [an outcome] Subsequent steps of the same kind can also be specified with the “And “ and “But” keyword
  • 11. Variations on a Theme Context Specification AAA User Story Structure Establish Initial Context Given Arrange SetContext Interact with SUT When Act BecauseOf Check the results Then Assert ItShould
  • 12. Confidential GTC-NL for internal use Example: Application Under Test (3) Application displays “Hello Best Tester: Password is Correct” (If password = “Rachid”) (1) type password “Rachid” (2) press Login button (0) start application “Say Hello Best Tester” a simple application for demo purpose. According req. of this tool: “Rachid”, “Ali” and ‘Pieter” are correct passwords for login.
  • 13. Confidential GTC-NL for internal use Example: Feature file (Scenario’s: Given When Then) Feature: Log-In in “Best Tester Application”, check correctness of password Scenario: Check Login with correct password Given Application is started When correct password is typed And Login button is pressed Then Login should be successful And Messagebox should display "Hello Best Tester: Password Correct" Describe some piece of functionality of the system Plain readable text Features contain one or more scenarios A scenario describes a single acceptance test for a feature Most features are composed of multiple scenarios Tool generates a test for each scenario The name of the test is generated from the scenario title
  • 14. Confidential GTC-NL for internal use When scenario/story is in place it would be wonderful if there is a tool that can run this scenario’s to verify that the implementation actually behaves as specified. Executable specification that verifies that the implementation behaves as expected, readable by all in the team, and around it Requirements /Behavior In well known format e.g. Given/When/Then Tool Implementation (SUT) Main benefit Main benefit is not in the tool! The benefit is that team get together and write down a common, shared knowledge in a well known format. In one place.
  • 15. Confidential GTC-NL for internal use Tools This was the idea of Cucumber tool that first was created in the Ruby-community. Cucumber can execute scenarios written in the Given/When/Then-syntax. For .Net framework SpecFlow is known good tool. Both tools used Gherkin syntax and are free (open source). Cucumber Ruby SpecFlow .Net
  • 16. Confidential GTC-NL for internal use Behavior Driven Development in one slide Feature file (Scenario’s: Given When Then) Test class (for Nunit) Generated by SpecFow tool (.cs) Stepper class binding with implementation (.cs) Implementation (.dll, .exe) Nunit dll Nunit Test report Code of Implementation (.cs) Visual Studio 2010 + SpecFlow SW developer Requirements User feedback1 2 3 4 5 6 7 8
  • 17. Confidential GTC-NL for internal use Some handy Attributes Background With the keyword background you can run some steps before each scenario in the feature. Hooks Hooks are events that is fired in the following order. And you can “hook in” code here to do useful things: - Restore a database - Dump a log on error - Init variables before steps Scenario outlines Data-driven scenarios or scenario templates Consists of Scenario template specification with data placeholders Tool generates parameterized test logic for the scenario outline and individual test method for each example set (using pairwise testing)
  • 18. Confidential GTC-NL for internal use Some handy Attributes Tag Can be used to specify “categories” for Nunit or other test runners e.g. @RegressionTestSet @ignore tag is a special tag “ignore test” # is reserved for comment #language The language of the feature files can be either specified globally in the configuration file or in the header of the feature file using “#language” keyword different ISO languages are supported Debugging Tests SpecFlow Visual Studio integration also supports debugging the execution of the tests. Just like in the source code files of your project, you can also place breakpoints in the SpecFlow feature files. Whenever you execute the generated tests in debug mode, the execution will stop at the specified breakpoints and you can execute the steps one-by-one using the standard “Step Over” (F10) command or you can go to the detailed execution of the bindings using the “Step Into” (F11) command.
  • 19. Confidential GTC-NL for internal use SpecFlow configuration file language Test runner Stop at error
  • 20. Confidential GTC-NL for internal use Live demo “SayHello Application” VS 2010 and SpecFlow Link Nunitdll
  • 21. Confidential GTC-NL for internal use SpecFlow and generated Test Results SpecFlow tool generates clear and concise report Report
  • 22. Confidential GTC-NL for internal use Behavior Driven Development in one slide Feature file (Scenario’s: Given When Then) Test class (for Nunit) Generated by SpecFow tool (.cs) Stepper class binding with implementation (.cs) Implementation (.dll, .exe) Nunit dll Nunit Test report Code of Implementation (.cs) Visual Studio 2010 + SpecFlow SW developer Requirements User feedback1 2 3 4 5 6 7 8
  • 23. Confidential GTC-NL for internal use Behavior Driven Testing in one slide Feature file (Scenario’s: Given When Then) Test class (for Nunit) Generated by SpecFow tool (.cs) Stepper class binding with implementation (.cs) SUT (FlashLite) Nunit dll Bello/Nunit Test report Visual Studio 2010 + SpecFlow Requirements Tester SW/FW developer implementation code Development environment User SW/FW Implementation feedback 4 2 3 1 5
  • 24. Confidential GTC-NL for internal use http://www.synerzip.com/agile-method.htm Behavior driven testing Development domain Test domain
  • 25. Confidential GTC-NL for internal use BDD vs BDT • Behavior Driven Development (BDD) – Development domain – White box – Micro view – Input = specification (Behavior) – Output = Implementation • Behavior Driven Testing (BDT) – Test domain – Black box (interface) – Macro view – Input = Specification (Behavior) – Output = Test
  • 26. Confidential GTC-NL for internal use Requirement Based Testing in one slide Feature file (Scenario’s: Given When Then) Test class (for Nunit) Generated by SpecFow tool (.cs) Stepper class binding with implementation (.cs) SUT (FlashLite) Nunit dll Bello/Nunit Test report Visual Studio 2010 + SpecFlow Requirements doc SW/FW developer implementation code Development environment User SW/FW Implementation feedback 4 3 2 1 5 Spec.doc to Feature file convertor (2) = refactor= clean up and improveTester To be developed
  • 27. Confidential GTC-NL for internal use Learn more about SpecFlow and BDD http://blog.dannorth.net/introducing-bdd/ http://www.specflow.org/ https://github.com/techtalk/SpecFlow http://github.com/techtalk/SpecFlow-Examples http://github.com/aslakhellesoy/cucumber/wiki http://www.marcusoft.net/search/label/SpecFlow https://github.com/marcushammarberg/ https://www.marcusoft.net Free downloadable book
  • 29. 1, 2, 3 Given When Then [TestMethod] public void Total_Should_Be_1_When_1_Product_Added() { var cart = new ShoppingCart("TEST"); cart.AddItem(new Product("SKU")); Assert.AreEqual(1, cart.TotalItems); }