SlideShare uma empresa Scribd logo
1 de 29
BDD
                         Behavior Driven Development in PHP




                                                                     Slide 1

TEQneers GmbH & Co. KG                                        www.teqneers.de
Development: back then and today
                                                          Slide 2

TEQneers GmbH & Co. KG                             www.teqneers.de
Dirty Hacking
                                                Slide 3

TEQneers GmbH & Co. KG                   www.teqneers.de
Dirty Hacking


             ‣ No documentation
             ‣ No testing
             ‣ No clue if it still working
             ‣ Maintenance doesn’t really matter
             ‣ Code changes are a lottery
             ‣ Easy refactoring impossible



                                                          Slide 4

TEQneers GmbH & Co. KG                             www.teqneers.de
Automated testing
                                                    Slide 5

TEQneers GmbH & Co. KG                       www.teqneers.de
Automated Testing

             ✓Verify code or results
             ✓Can be automated
             ✓Code first, add tests later


             ‣ Time gap between development and testing
             ‣ Test not based on original requirements
             ‣ Tests influenced by code


                                                                 Slide 6

TEQneers GmbH & Co. KG                                    www.teqneers.de
Test-Driven Development
                                                          Slide 7

TEQneers GmbH & Co. KG                             www.teqneers.de
Test-Driven Development




             ✓Tests follow your original requirements
             ✓Code is an easy solution to the problem
             ✓Tests for all code




                                                               Slide 8

TEQneers GmbH & Co. KG                                  www.teqneers.de
Test-Driven Development


             ‣ Write tests first, add code later
             ‣ Feels unnatural
             ‣ Tests written by developers
             ‣ Potential for over-design
             ‣ Customer unable to participate



                                                          Slide 9

TEQneers GmbH & Co. KG                             www.teqneers.de
Behavior-Driven Development
                                                              Slide 10

TEQneers GmbH & Co. KG                                 www.teqneers.de
Audience




        Customer
                                           Slide 11

TEQneers GmbH & Co. KG              www.teqneers.de
Audience




        Customer                    Tester
                                                    Slide 11

TEQneers GmbH & Co. KG                       www.teqneers.de
Audience




        Customer         Developer   Tester
                                                     Slide 11

TEQneers GmbH & Co. KG                        www.teqneers.de
In order to finish a purchase
                             we need to add VAT
                                 to the total.




        Customer                                    Developer   Tester
                                                                                Slide 12

TEQneers GmbH & Co. KG                                                   www.teqneers.de
<?php
                          foreach( $itemList as $item) {
                            $total += $item[price] * $item[quantity];
                          }
                          $total = $sum * 1.19;
                         ?>




        Customer                   Developer                            Tester
                                                                                        Slide 13

TEQneers GmbH & Co. KG                                                           www.teqneers.de
Take all items
                                             add them up
                                           multiply by VAT
                                     total should be sum + VAT




        Customer         Developer                       Tester
                                                                         Slide 14

TEQneers GmbH & Co. KG                                            www.teqneers.de
Translation




                                              Slide 15

TEQneers GmbH & Co. KG                 www.teqneers.de
Translation




                                              Slide 16

TEQneers GmbH & Co. KG                 www.teqneers.de
Goal


             ‣ Common language
                  ‣ Tester writing tests
                  ‣ Customer writing specs
                  ‣ Common dictionary
             ‣ Specs == Tests



                                                     Slide 17

TEQneers GmbH & Co. KG                        www.teqneers.de
Behavior-Driven Development

             ‣ Writing tests first in a customer friendly language
             ‣ Your tests are your specifications and your
               specifications are your tests
             ‣ Dan North: “BDD takes the position that you can
               turn an idea for a requirement into implemented,
               tested, production-ready code simply and
               effectively, as long as the requirement is specific
               enough that everyone knows what’s going on.”


                                                                           Slide 18

TEQneers GmbH & Co. KG                                              www.teqneers.de
Gherkin


             ‣ Feature: Generating an invoice
             ‣ Scenario: Calculating gross total in Germany
                  ‣ Given the customer is from Germany
                  ‣ And the net total is 100 EUR
                  ‣ When I calculate the gross total
                  ‣ Then the final invoice total should be 119 EUR



                                                                           Slide 19

TEQneers GmbH & Co. KG                                              www.teqneers.de
Gherkin Compatible BDD Frameworks


             ‣ Ruby: Cucumber
             ‣ Java: Cucumber-JVM
             ‣ .NET: IronRuby
             ‣ Erlangen: cucumberl
             ‣ PHP: Behat



                                                      Slide 20

TEQneers GmbH & Co. KG                         www.teqneers.de
Behat


             ‣ Extendable PHP BDD Framework
             ‣ Mink: browser testing (e.g. Selenium)
             ‣ Symfony2: integration layer
             ‣ Jira: bug tracker interface
             ‣ Gearman: distributed testing
             ‣ ...



                                                              Slide 21

TEQneers GmbH & Co. KG                                 www.teqneers.de
What’s testable in Behat?


             ‣ Business Intelligence/Models
             ‣ API’s
             ‣ Web Pages
             ‣ Single Scripts
             ‣ Server-Server-Interaction



                                                            Slide 22

TEQneers GmbH & Co. KG                               www.teqneers.de
How does it work?

                                                    Slide 23

TEQneers GmbH & Co. KG                       www.teqneers.de
What BDD is NOT


             ‣ No replacement for TDD
             ‣ Not a “real” spoken language
             ‣ Not a drop in solution
             ‣ Common language needs to be developed
             ‣ Developer still has to write glue code
             ‣ It’s not magic!



                                                               Slide 24

TEQneers GmbH & Co. KG                                  www.teqneers.de
Good Practice


        ‣ Get everyone on board
        ‣ Define common language and syntax
        ‣ Define test scope
        ‣ Build project specific testing environment
        ‣ Don’t expect perfect solution from start
        ‣ Don’t make it too complicated


                                                             Slide 25

TEQneers GmbH & Co. KG                                www.teqneers.de
Questions?

                                             Slide 26

TEQneers GmbH & Co. KG                www.teqneers.de
Thanks for listening



                         contact us if you have any questions

                                email: oliver@php.net

                             email: stefan@teqneers.de


                               Have Fun!
                                                                       Slide 27

TEQneers GmbH & Co. KG                                          www.teqneers.de

Mais conteúdo relacionado

Destaque

Behavior Driven GUI Testing
Behavior Driven GUI TestingBehavior Driven GUI Testing
Behavior Driven GUI TestingAmanda Burma
 
Building the "right" regression suite using Behavior Driven Testing (BDT)
Building the "right" regression suite using Behavior Driven Testing (BDT)Building the "right" regression suite using Behavior Driven Testing (BDT)
Building the "right" regression suite using Behavior Driven Testing (BDT)Anand Bagmar
 
Beyond Testing: Specs and Behavior Driven Development
Beyond Testing: Specs and Behavior  Driven DevelopmentBeyond Testing: Specs and Behavior  Driven Development
Beyond Testing: Specs and Behavior Driven DevelopmentRabble .
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...FalafelSoftware
 
Startup Institute: JS Testing & Behavior Driven Development
Startup Institute: JS Testing & Behavior Driven DevelopmentStartup Institute: JS Testing & Behavior Driven Development
Startup Institute: JS Testing & Behavior Driven DevelopmentConor Sheehan
 
Effective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven DevelopmentEffective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven DevelopmentAlexander Kress
 
Behavior driven development. Testing drupal using behat
Behavior driven development. Testing drupal using behatBehavior driven development. Testing drupal using behat
Behavior driven development. Testing drupal using behatAndrei Jechiu
 
German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...Bastian Seehaus
 
Behavior Driven Testing for Multichannel Enterprise Applications
Behavior Driven Testing for Multichannel Enterprise ApplicationsBehavior Driven Testing for Multichannel Enterprise Applications
Behavior Driven Testing for Multichannel Enterprise ApplicationsBamdad Dashtban
 
Behavior Driven Testing of Web Services
Behavior Driven Testing of Web ServicesBehavior Driven Testing of Web Services
Behavior Driven Testing of Web ServicesSurya Sreedevi Vedula
 
Behavior Driven Development with Rails
Behavior Driven Development with RailsBehavior Driven Development with Rails
Behavior Driven Development with RailsMark Menard
 
Behavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shiftBehavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shiftAspire Systems
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /CapybaraShraddhaSF
 
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...Eric DeLabar
 
[Agile Testing Day] Behavior Driven Development (BDD)
[Agile Testing Day] Behavior Driven Development (BDD)[Agile Testing Day] Behavior Driven Development (BDD)
[Agile Testing Day] Behavior Driven Development (BDD)Cellenza
 

Destaque (20)

BDD training v5.0.1
BDD training  v5.0.1BDD training  v5.0.1
BDD training v5.0.1
 
Behavior Driven GUI Testing
Behavior Driven GUI TestingBehavior Driven GUI Testing
Behavior Driven GUI Testing
 
Building the "right" regression suite using Behavior Driven Testing (BDT)
Building the "right" regression suite using Behavior Driven Testing (BDT)Building the "right" regression suite using Behavior Driven Testing (BDT)
Building the "right" regression suite using Behavior Driven Testing (BDT)
 
Beyond Testing: Specs and Behavior Driven Development
Beyond Testing: Specs and Behavior  Driven DevelopmentBeyond Testing: Specs and Behavior  Driven Development
Beyond Testing: Specs and Behavior Driven Development
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
 
Startup Institute: JS Testing & Behavior Driven Development
Startup Institute: JS Testing & Behavior Driven DevelopmentStartup Institute: JS Testing & Behavior Driven Development
Startup Institute: JS Testing & Behavior Driven Development
 
Effective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven DevelopmentEffective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven Development
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Behavior driven development. Testing drupal using behat
Behavior driven development. Testing drupal using behatBehavior driven development. Testing drupal using behat
Behavior driven development. Testing drupal using behat
 
German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...
 
Calabash
CalabashCalabash
Calabash
 
Behavior Driven Testing for Multichannel Enterprise Applications
Behavior Driven Testing for Multichannel Enterprise ApplicationsBehavior Driven Testing for Multichannel Enterprise Applications
Behavior Driven Testing for Multichannel Enterprise Applications
 
Behavior Driven Testing of Web Services
Behavior Driven Testing of Web ServicesBehavior Driven Testing of Web Services
Behavior Driven Testing of Web Services
 
Behavior Driven Development with Rails
Behavior Driven Development with RailsBehavior Driven Development with Rails
Behavior Driven Development with Rails
 
Behavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shiftBehavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shift
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /Capybara
 
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
 
[Agile Testing Day] Behavior Driven Development (BDD)
[Agile Testing Day] Behavior Driven Development (BDD)[Agile Testing Day] Behavior Driven Development (BDD)
[Agile Testing Day] Behavior Driven Development (BDD)
 
Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)
 
Behavior Driven GUI Testing
Behavior Driven GUI TestingBehavior Driven GUI Testing
Behavior Driven GUI Testing
 

Semelhante a Behavior driven development

Introduction to Ext JS 4
Introduction to Ext JS 4Introduction to Ext JS 4
Introduction to Ext JS 4Stefan Gehrig
 
How to Better Manage Technical Debt While Innovating on DevOps
How to Better Manage Technical Debt While Innovating on DevOpsHow to Better Manage Technical Debt While Innovating on DevOps
How to Better Manage Technical Debt While Innovating on DevOpsDynatrace
 
Gw Pres Agile 4slideshare
Gw Pres Agile 4slideshareGw Pres Agile 4slideshare
Gw Pres Agile 4slideshareDave Burke
 
The Software Debt Bubble: Is It About to Burst
The Software Debt Bubble: Is It About to BurstThe Software Debt Bubble: Is It About to Burst
The Software Debt Bubble: Is It About to BurstChris Sterling
 
Releasemanagement in integration projects
Releasemanagement in integration projectsReleasemanagement in integration projects
Releasemanagement in integration projectsSven Bernhardt
 
Selecting SaaS providers
Selecting SaaS providersSelecting SaaS providers
Selecting SaaS providersDennis Howlett
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular SlidesJim Lynch
 
The Groop Welcome Kit Sample
The Groop Welcome Kit SampleThe Groop Welcome Kit Sample
The Groop Welcome Kit Samplethegroop
 
Revitalizing CS Component Studio
Revitalizing CS Component StudioRevitalizing CS Component Studio
Revitalizing CS Component StudioESUG
 
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...mCloud
 
Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...
Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...
Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...Compuware APM
 
How, why, and the roi kcdc '21
How, why, and the roi  kcdc '21How, why, and the roi  kcdc '21
How, why, and the roi kcdc '21Marcus Merrell
 
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ..."Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...Fwdays
 
Proceedit 20110308 Companys Short Presentation For Customers
Proceedit 20110308 Companys Short Presentation For CustomersProceedit 20110308 Companys Short Presentation For Customers
Proceedit 20110308 Companys Short Presentation For CustomersJosep Mª Cos i Riera
 
Enterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring BudgetEnterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring BudgetChris Tankersley
 
Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...Aggregage
 
Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...Hannah Flynn
 

Semelhante a Behavior driven development (20)

Introduction to Ext JS 4
Introduction to Ext JS 4Introduction to Ext JS 4
Introduction to Ext JS 4
 
Introduction to Ext JS 4
Introduction to Ext JS 4Introduction to Ext JS 4
Introduction to Ext JS 4
 
How to Better Manage Technical Debt While Innovating on DevOps
How to Better Manage Technical Debt While Innovating on DevOpsHow to Better Manage Technical Debt While Innovating on DevOps
How to Better Manage Technical Debt While Innovating on DevOps
 
Gw Pres Agile 4slideshare
Gw Pres Agile 4slideshareGw Pres Agile 4slideshare
Gw Pres Agile 4slideshare
 
The Software Debt Bubble: Is It About to Burst
The Software Debt Bubble: Is It About to BurstThe Software Debt Bubble: Is It About to Burst
The Software Debt Bubble: Is It About to Burst
 
Releasemanagement in integration projects
Releasemanagement in integration projectsReleasemanagement in integration projects
Releasemanagement in integration projects
 
Selecting SaaS providers
Selecting SaaS providersSelecting SaaS providers
Selecting SaaS providers
 
Product Development
Product DevelopmentProduct Development
Product Development
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
The Groop Welcome Kit Sample
The Groop Welcome Kit SampleThe Groop Welcome Kit Sample
The Groop Welcome Kit Sample
 
Revitalizing CS Component Studio
Revitalizing CS Component StudioRevitalizing CS Component Studio
Revitalizing CS Component Studio
 
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
 
Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...
Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...
Gomez / Universal Mind Webinar - Are You Ready? A New Approach for Ensuring Y...
 
How, why, and the roi kcdc '21
How, why, and the roi  kcdc '21How, why, and the roi  kcdc '21
How, why, and the roi kcdc '21
 
What drives your company by elan lennard
What drives your company by elan lennardWhat drives your company by elan lennard
What drives your company by elan lennard
 
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ..."Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
 
Proceedit 20110308 Companys Short Presentation For Customers
Proceedit 20110308 Companys Short Presentation For CustomersProceedit 20110308 Companys Short Presentation For Customers
Proceedit 20110308 Companys Short Presentation For Customers
 
Enterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring BudgetEnterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring Budget
 
Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...
 
Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...Create Success With Analytics: Living With Technical Debt - Balancing Quality...
Create Success With Analytics: Living With Technical Debt - Balancing Quality...
 

Último

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 

Último (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Behavior driven development

  • 1. BDD Behavior Driven Development in PHP Slide 1 TEQneers GmbH & Co. KG www.teqneers.de
  • 2. Development: back then and today Slide 2 TEQneers GmbH & Co. KG www.teqneers.de
  • 3. Dirty Hacking Slide 3 TEQneers GmbH & Co. KG www.teqneers.de
  • 4. Dirty Hacking ‣ No documentation ‣ No testing ‣ No clue if it still working ‣ Maintenance doesn’t really matter ‣ Code changes are a lottery ‣ Easy refactoring impossible Slide 4 TEQneers GmbH & Co. KG www.teqneers.de
  • 5. Automated testing Slide 5 TEQneers GmbH & Co. KG www.teqneers.de
  • 6. Automated Testing ✓Verify code or results ✓Can be automated ✓Code first, add tests later ‣ Time gap between development and testing ‣ Test not based on original requirements ‣ Tests influenced by code Slide 6 TEQneers GmbH & Co. KG www.teqneers.de
  • 7. Test-Driven Development Slide 7 TEQneers GmbH & Co. KG www.teqneers.de
  • 8. Test-Driven Development ✓Tests follow your original requirements ✓Code is an easy solution to the problem ✓Tests for all code Slide 8 TEQneers GmbH & Co. KG www.teqneers.de
  • 9. Test-Driven Development ‣ Write tests first, add code later ‣ Feels unnatural ‣ Tests written by developers ‣ Potential for over-design ‣ Customer unable to participate Slide 9 TEQneers GmbH & Co. KG www.teqneers.de
  • 10. Behavior-Driven Development Slide 10 TEQneers GmbH & Co. KG www.teqneers.de
  • 11. Audience Customer Slide 11 TEQneers GmbH & Co. KG www.teqneers.de
  • 12. Audience Customer Tester Slide 11 TEQneers GmbH & Co. KG www.teqneers.de
  • 13. Audience Customer Developer Tester Slide 11 TEQneers GmbH & Co. KG www.teqneers.de
  • 14. In order to finish a purchase we need to add VAT to the total. Customer Developer Tester Slide 12 TEQneers GmbH & Co. KG www.teqneers.de
  • 15. <?php foreach( $itemList as $item) { $total += $item[price] * $item[quantity]; } $total = $sum * 1.19; ?> Customer Developer Tester Slide 13 TEQneers GmbH & Co. KG www.teqneers.de
  • 16. Take all items add them up multiply by VAT total should be sum + VAT Customer Developer Tester Slide 14 TEQneers GmbH & Co. KG www.teqneers.de
  • 17. Translation Slide 15 TEQneers GmbH & Co. KG www.teqneers.de
  • 18. Translation Slide 16 TEQneers GmbH & Co. KG www.teqneers.de
  • 19. Goal ‣ Common language ‣ Tester writing tests ‣ Customer writing specs ‣ Common dictionary ‣ Specs == Tests Slide 17 TEQneers GmbH & Co. KG www.teqneers.de
  • 20. Behavior-Driven Development ‣ Writing tests first in a customer friendly language ‣ Your tests are your specifications and your specifications are your tests ‣ Dan North: “BDD takes the position that you can turn an idea for a requirement into implemented, tested, production-ready code simply and effectively, as long as the requirement is specific enough that everyone knows what’s going on.” Slide 18 TEQneers GmbH & Co. KG www.teqneers.de
  • 21. Gherkin ‣ Feature: Generating an invoice ‣ Scenario: Calculating gross total in Germany ‣ Given the customer is from Germany ‣ And the net total is 100 EUR ‣ When I calculate the gross total ‣ Then the final invoice total should be 119 EUR Slide 19 TEQneers GmbH & Co. KG www.teqneers.de
  • 22. Gherkin Compatible BDD Frameworks ‣ Ruby: Cucumber ‣ Java: Cucumber-JVM ‣ .NET: IronRuby ‣ Erlangen: cucumberl ‣ PHP: Behat Slide 20 TEQneers GmbH & Co. KG www.teqneers.de
  • 23. Behat ‣ Extendable PHP BDD Framework ‣ Mink: browser testing (e.g. Selenium) ‣ Symfony2: integration layer ‣ Jira: bug tracker interface ‣ Gearman: distributed testing ‣ ... Slide 21 TEQneers GmbH & Co. KG www.teqneers.de
  • 24. What’s testable in Behat? ‣ Business Intelligence/Models ‣ API’s ‣ Web Pages ‣ Single Scripts ‣ Server-Server-Interaction Slide 22 TEQneers GmbH & Co. KG www.teqneers.de
  • 25. How does it work? Slide 23 TEQneers GmbH & Co. KG www.teqneers.de
  • 26. What BDD is NOT ‣ No replacement for TDD ‣ Not a “real” spoken language ‣ Not a drop in solution ‣ Common language needs to be developed ‣ Developer still has to write glue code ‣ It’s not magic! Slide 24 TEQneers GmbH & Co. KG www.teqneers.de
  • 27. Good Practice ‣ Get everyone on board ‣ Define common language and syntax ‣ Define test scope ‣ Build project specific testing environment ‣ Don’t expect perfect solution from start ‣ Don’t make it too complicated Slide 25 TEQneers GmbH & Co. KG www.teqneers.de
  • 28. Questions? Slide 26 TEQneers GmbH & Co. KG www.teqneers.de
  • 29. Thanks for listening contact us if you have any questions email: oliver@php.net email: stefan@teqneers.de Have Fun! Slide 27 TEQneers GmbH & Co. KG www.teqneers.de

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. No extra code, not needed\n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. http://dannorth.net/whats-in-a-story/\n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. extension to TDD\nNatural language=more dynamic syntax (e.g. plural)\n\n
  26. Syntax: I -&gt; We, Uppercase, Tense, ...\nTest scope: API, GUI, Backend only, ...\nEnvironment: DB restore strategies, ...\nToo complicated = tests have to be tested\n
  27. \n
  28. \n