SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
BEHAVIOUR DRIVEN
DEVELOPMENT
ALEXANDRU BADIU
BEHAVIOUR DRIVEN DEVELOPMENT
ALEXANDRU BADIU
Drupal developer for 10 years.	

Drupal Romania founding member.	

I work at Demotix / Corbis.	


!
http://alexandrubadiu.ro	

http://twitter.com/voidberg

Drupalcamp Tirgu Mures 2013
BDD IS A SECOND-GENERATION,
OUTSIDE–IN, PULL-BASED,
MULTIPLE- STAKEHOLDER,
MULTIPLE-SCALE, 	

HIGH- AUTOMATION, 	

AGILE METHODOLOGY.
BEHAVIOUR DRIVEN DEVELOPMENT
WAIT, WHAT?
BEHAVIOUR DRIVEN DEVELOPMENT
TDD’S SHORTCOMINGS

• Unit tests, Inside - out.	

• Write the unit test before the code.	

• Typically written by the programmer.	

• Can’t test everything: full functional tests?	

• Can’t refactor as you wish: dependent on early tests.

Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BDD FEATURES

• It picks up where TDD leaves off.	

• Rethinking the approach to unit and acceptance testing.	

• Uses a common language that everyone can use from
all chains of command.	

• Becomes a test, a piece of documentation, a
specification.	

• Supported by a wide range of tools: Gherkin, Cucumber,
Behat, Travis, Jenkins, Jira and so on.
Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BDD FEATURES

• Test code or describe behaviour?	

• Both.	

• TDD is about ensuring behaviour.	

• BDD is about describing behaviour.

Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BDD FEATURES

• User story.	

• Stakeholder, effect, value.	

• Acceptance criteria or scenarios.	

• Steps.	

• Initial conditions.	

• Triggers.	

• Outcomes.
Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BDD FEATURES
Feature: Authentication!

!
In order to change my information and add sessions!
As a registered Drupalcamp user!
I need to be able to authenticate!
!
Scenario: User login!
Given I am on "/"!
When I follow "Log in"!
And I fill in "name" with "bddtest"!
And I fill in "pass" with "bddtest"!
And I press "Log in"!
Then I should see "My account" !

!
Scenario: User logout!
Given I am logged in!
And I am on "/"!
When I follow "Log out"!
Then I should see "Log in"

Drupalcamp Tirgu Mures 2013
BDD IS A SECONDGENERATION, OUTSIDE–IN,
PULL-BASED, MULTIPLESTAKEHOLDER, MULTIPLE-SCALE, 	

HIGH- AUTOMATION, 	

AGILE METHODOLOGY.
BEHAVIOUR DRIVEN DEVELOPMENT
BDD IN PHP

• Behat.	

• OSS.	

• Cucumber “language”.	

• Mink for testing web apps.	

• Different drivers: Selenium, zombie.js, goutte etc.

Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
COMPOSER.JSON
{!
"require": {!
"behat/behat": "2.4.*@stable",!
"behat/mink": "1.5.*@stable",!
"behat/mink-extension": "*",!
"behat/mink-goutte-driver": "*",!
"behat/mink-selenium-driver": "*",!
"behat/mink-selenium2-driver": "*",!
"behat/mink-sahi-driver": "*",!
"behat/mink-zombie-driver": "*",!
},!
"minimum-stability": "dev",!
"config": {!
"bin-dir": "bin/"!
}!
}!

Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
INSTALL
curl http://getcomposer.org/installer | php!
php composer.phar install —prefer-source!
!
bin/behat —init!
!
+d features - place your *.feature files here!
+d features/bootstrap - place bootstrap scripts and
static files here!
+f features/bootstrap/FeatureContext.php - place your
feature related code here

Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BEHAT.YML
default:!
extensions:!
BehatMinkExtensionExtension:!
base_url: http://drupalcamp.ro/!
goutte: ~!
zombie: ~!
sahi:!
port: 9999!
selenium2:!
wd_host: "http://127.0.0.1:4444/wd/hub"!
!
default_session: 'selenium2'!
javascript_session: 'selenium2'!

Drupalcamp Tirgu Mures 2013
DEMO
BEHAVIOUR DRIVEN DEVELOPMENT
BDD IN DRUPAL

• Behat Drupal Extension.	

• Provides step definitions for common testing scenarios
specific to Drupal sites.
Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BDD IN DRUPAL
composer.json!

!
!
!
!
!

"require": {!
! "drupal/drupal-extension": "*"!
!
},!

behat.yml!

!
!

DrupalDrupalExtensionExtension:!
blackbox: ~

Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BDD IN DRUPAL
Given I am logged in as a user with the "authenticated
user" role!
!
Then I should see the heading “History"!
!
Then I should see the heading "User login" in the "left
sidebar" region!
!
Given the cache has been cleared!
!
When I run cron!
!

Drupalcamp Tirgu Mures 2013
BEHAVIOUR DRIVEN DEVELOPMENT
BDD IN DRUPAL
Given "page" nodes:!
| title
|!
| Page one |!
| Page two |!
!
And "article" nodes:!
| title
|!
| First article |!
| Second article |!
!
Given "article" nodes:!
| title
| promote
| First article with fields |
1
!
Given users:!
| name
| mail
| status
| Joe User | joe@example.com | 1

| body
|!
| PLACEHOLDER BODY |!

|!
|

Drupalcamp Tirgu Mures 2013
THANK YOU
Alexandru Badiu

ALEXANDRUBADIU.RO
We’re hiring!	

AngularJS, Node.js.	

Come talk to me if you’re interested.

Weitere ähnliche Inhalte

Was ist angesagt?

The JAVA Training Workshop in Ahmedabad
The JAVA Training Workshop in AhmedabadThe JAVA Training Workshop in Ahmedabad
The JAVA Training Workshop in AhmedabadTOPS Technologies
 
Full-Stack Development
Full-Stack DevelopmentFull-Stack Development
Full-Stack DevelopmentDhilipsiva DS
 
PHP 2014/15 - Visión global del ecosistema PHP
PHP 2014/15 - Visión global del ecosistema PHPPHP 2014/15 - Visión global del ecosistema PHP
PHP 2014/15 - Visión global del ecosistema PHPCarlos Buenosvinos
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...Evan Mullins
 
Morden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web AppsMorden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web AppsCaesar Chi
 
Getting Involved with Joomla - Why and how to contribute
Getting Involved with Joomla - Why and how to contributeGetting Involved with Joomla - Why and how to contribute
Getting Involved with Joomla - Why and how to contributeParth Lawate
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteChristian Heilmann
 
Prototyping UX Solutions with Playgrounds and Lightning Web Components
Prototyping UX Solutions with Playgrounds and Lightning Web ComponentsPrototyping UX Solutions with Playgrounds and Lightning Web Components
Prototyping UX Solutions with Playgrounds and Lightning Web ComponentsYeurDreamin'
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGapAlex S
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.Bobby Schultz
 

Was ist angesagt? (13)

Mobileweb
MobilewebMobileweb
Mobileweb
 
The JAVA Training Workshop in Ahmedabad
The JAVA Training Workshop in AhmedabadThe JAVA Training Workshop in Ahmedabad
The JAVA Training Workshop in Ahmedabad
 
Full-Stack Development
Full-Stack DevelopmentFull-Stack Development
Full-Stack Development
 
PHP 2014/15 - Visión global del ecosistema PHP
PHP 2014/15 - Visión global del ecosistema PHPPHP 2014/15 - Visión global del ecosistema PHP
PHP 2014/15 - Visión global del ecosistema PHP
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
 
Morden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web AppsMorden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web Apps
 
Java training in ahmedabad
Java training in ahmedabadJava training in ahmedabad
Java training in ahmedabad
 
Getting Involved with Joomla - Why and how to contribute
Getting Involved with Joomla - Why and how to contributeGetting Involved with Joomla - Why and how to contribute
Getting Involved with Joomla - Why and how to contribute
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynote
 
Prototyping UX Solutions with Playgrounds and Lightning Web Components
Prototyping UX Solutions with Playgrounds and Lightning Web ComponentsPrototyping UX Solutions with Playgrounds and Lightning Web Components
Prototyping UX Solutions with Playgrounds and Lightning Web Components
 
Kickstart Jpa
Kickstart JpaKickstart Jpa
Kickstart Jpa
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGap
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.
 

Andere mochten auch

Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven DevelopmentBen Goldin
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven DevelopmentRichard Ruiter
 
Behaviour-Driven Development
Behaviour-Driven DevelopmentBehaviour-Driven Development
Behaviour-Driven DevelopmentKerry Buckley
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven developmentStephen Fuqua
 
Bahaviour Driven Development
Bahaviour Driven DevelopmentBahaviour Driven Development
Bahaviour Driven Developmentbuildmaster
 
Changing Your Mindset: Getting Started With Test-Driven Development
Changing Your Mindset: Getting Started With Test-Driven DevelopmentChanging Your Mindset: Getting Started With Test-Driven Development
Changing Your Mindset: Getting Started With Test-Driven DevelopmentViget Labs
 
Informed & Agile: Test Driven Design w/ Jon Innes
Informed & Agile: Test Driven Design w/ Jon InnesInformed & Agile: Test Driven Design w/ Jon Innes
Informed & Agile: Test Driven Design w/ Jon InnesUserZoom
 
Introduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentIntroduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentChristophe Achouiantz
 
BDD - Keep love alive
BDD - Keep love aliveBDD - Keep love alive
BDD - Keep love aliveRory Preddy
 
Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Naresh Jain
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven developmenttoteb5
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)Brian Rasmussen
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
 
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
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven DevelopmentViraf Karai
 

Andere mochten auch (18)

Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
 
Using Features
Using FeaturesUsing Features
Using Features
 
bdd behaviour driven development
bdd behaviour driven developmentbdd behaviour driven development
bdd behaviour driven development
 
Behaviour-Driven Development
Behaviour-Driven DevelopmentBehaviour-Driven Development
Behaviour-Driven Development
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven development
 
TDD, BDD and mocks
TDD, BDD and mocksTDD, BDD and mocks
TDD, BDD and mocks
 
Bahaviour Driven Development
Bahaviour Driven DevelopmentBahaviour Driven Development
Bahaviour Driven Development
 
Changing Your Mindset: Getting Started With Test-Driven Development
Changing Your Mindset: Getting Started With Test-Driven DevelopmentChanging Your Mindset: Getting Started With Test-Driven Development
Changing Your Mindset: Getting Started With Test-Driven Development
 
Informed & Agile: Test Driven Design w/ Jon Innes
Informed & Agile: Test Driven Design w/ Jon InnesInformed & Agile: Test Driven Design w/ Jon Innes
Informed & Agile: Test Driven Design w/ Jon Innes
 
Introduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentIntroduction to Behaviour Driven Development
Introduction to Behaviour Driven Development
 
BDD - Keep love alive
BDD - Keep love aliveBDD - Keep love alive
BDD - Keep love alive
 
Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven development
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
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
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven Development
 

Ähnlich wie Behavior Driven Development with Drupal

Improving WordPress Performance: Xdebug and PHP profiling
Improving WordPress Performance: Xdebug and PHP profilingImproving WordPress Performance: Xdebug and PHP profiling
Improving WordPress Performance: Xdebug and PHP profilingSeravo
 
Auf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und GradleAuf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und Gradleinovex GmbH
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpressRan Bar-Zik
 
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)Hyun-woo Park
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradleinovex GmbH
 
UMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, ChicagoUMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, Chicagobrockfanning
 
PlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo Radulovski
PlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo RadulovskiPlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo Radulovski
PlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo RadulovskiPlovDev Conference
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Eugenio Minardi
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpAhmed Abdou
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMartinSotirov
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToRaymond Camden
 
Introduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentIntroduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentÖzcan Zafer AYAN
 
BUILDING WEB APPS WITH ASP.NET MVC AND NOSQL
BUILDING WEB APPS WITH ASP.NET MVC AND NOSQLBUILDING WEB APPS WITH ASP.NET MVC AND NOSQL
BUILDING WEB APPS WITH ASP.NET MVC AND NOSQLMichael Kennedy
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Eugenio Minardi
 
Samsung Devcon - State of HTML5 - Chris Heilmann
Samsung Devcon - State of HTML5 - Chris HeilmannSamsung Devcon - State of HTML5 - Chris Heilmann
Samsung Devcon - State of HTML5 - Chris HeilmannChristian Heilmann
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseOSSCube
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers dssprakash
 

Ähnlich wie Behavior Driven Development with Drupal (20)

Improving WordPress Performance: Xdebug and PHP profiling
Improving WordPress Performance: Xdebug and PHP profilingImproving WordPress Performance: Xdebug and PHP profiling
Improving WordPress Performance: Xdebug and PHP profiling
 
Auf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und GradleAuf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und Gradle
 
Android Studio und gradle
Android Studio und gradleAndroid Studio und gradle
Android Studio und gradle
 
Don't screw it up! How to build durable API
Don't screw it up! How to build durable API Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpress
 
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
 
UMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, ChicagoUMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, Chicago
 
PlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo Radulovski
PlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo RadulovskiPlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo Radulovski
PlovDev 2016: Drupal 8 Evolution & Kickstart by Ivo Radulovski
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to Native
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
 
Introduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentIntroduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App Development
 
BUILDING WEB APPS WITH ASP.NET MVC AND NOSQL
BUILDING WEB APPS WITH ASP.NET MVC AND NOSQLBUILDING WEB APPS WITH ASP.NET MVC AND NOSQL
BUILDING WEB APPS WITH ASP.NET MVC AND NOSQL
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 
Samsung Devcon - State of HTML5 - Chris Heilmann
Samsung Devcon - State of HTML5 - Chris HeilmannSamsung Devcon - State of HTML5 - Chris Heilmann
Samsung Devcon - State of HTML5 - Chris Heilmann
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for Eclipse
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers
 

Mehr von Alexandru Badiu

Drupal as a first class mobile platform
Drupal as a first class mobile platformDrupal as a first class mobile platform
Drupal as a first class mobile platformAlexandru Badiu
 
Cloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloudCloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloudAlexandru Badiu
 
Cloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloudCloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloudAlexandru Badiu
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal APIAlexandru Badiu
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?Alexandru Badiu
 
Drupal, Android and iPhone
Drupal, Android and iPhoneDrupal, Android and iPhone
Drupal, Android and iPhoneAlexandru Badiu
 
Concepte de programare functionala in Javascript
Concepte de programare functionala in JavascriptConcepte de programare functionala in Javascript
Concepte de programare functionala in JavascriptAlexandru Badiu
 

Mehr von Alexandru Badiu (13)

Drupal 8
Drupal 8Drupal 8
Drupal 8
 
Drupal as a first class mobile platform
Drupal as a first class mobile platformDrupal as a first class mobile platform
Drupal as a first class mobile platform
 
Cloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloudCloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloud
 
REST Drupal
REST DrupalREST Drupal
REST Drupal
 
Cloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloudCloud to the rescue? How I learned to stop worrying and love the cloud
Cloud to the rescue? How I learned to stop worrying and love the cloud
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal API
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
 
Drupal, Android and iPhone
Drupal, Android and iPhoneDrupal, Android and iPhone
Drupal, Android and iPhone
 
Publish and Subscribe
Publish and SubscribePublish and Subscribe
Publish and Subscribe
 
Using Features
Using FeaturesUsing Features
Using Features
 
Concepte de programare functionala in Javascript
Concepte de programare functionala in JavascriptConcepte de programare functionala in Javascript
Concepte de programare functionala in Javascript
 
Drupal and Solr
Drupal and SolrDrupal and Solr
Drupal and Solr
 
Prezentare Wurbe
Prezentare WurbePrezentare Wurbe
Prezentare Wurbe
 

Kürzlich hochgeladen

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
"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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 

Kürzlich hochgeladen (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
"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 ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 

Behavior Driven Development with Drupal

  • 2. BEHAVIOUR DRIVEN DEVELOPMENT ALEXANDRU BADIU Drupal developer for 10 years. Drupal Romania founding member. I work at Demotix / Corbis. ! http://alexandrubadiu.ro http://twitter.com/voidberg Drupalcamp Tirgu Mures 2013
  • 3. BDD IS A SECOND-GENERATION, OUTSIDE–IN, PULL-BASED, MULTIPLE- STAKEHOLDER, MULTIPLE-SCALE, HIGH- AUTOMATION, AGILE METHODOLOGY.
  • 5. BEHAVIOUR DRIVEN DEVELOPMENT TDD’S SHORTCOMINGS • Unit tests, Inside - out. • Write the unit test before the code. • Typically written by the programmer. • Can’t test everything: full functional tests? • Can’t refactor as you wish: dependent on early tests. Drupalcamp Tirgu Mures 2013
  • 6. BEHAVIOUR DRIVEN DEVELOPMENT BDD FEATURES • It picks up where TDD leaves off. • Rethinking the approach to unit and acceptance testing. • Uses a common language that everyone can use from all chains of command. • Becomes a test, a piece of documentation, a specification. • Supported by a wide range of tools: Gherkin, Cucumber, Behat, Travis, Jenkins, Jira and so on. Drupalcamp Tirgu Mures 2013
  • 7. BEHAVIOUR DRIVEN DEVELOPMENT BDD FEATURES • Test code or describe behaviour? • Both. • TDD is about ensuring behaviour. • BDD is about describing behaviour. Drupalcamp Tirgu Mures 2013
  • 8. BEHAVIOUR DRIVEN DEVELOPMENT BDD FEATURES • User story. • Stakeholder, effect, value. • Acceptance criteria or scenarios. • Steps. • Initial conditions. • Triggers. • Outcomes. Drupalcamp Tirgu Mures 2013
  • 9. BEHAVIOUR DRIVEN DEVELOPMENT BDD FEATURES Feature: Authentication! ! In order to change my information and add sessions! As a registered Drupalcamp user! I need to be able to authenticate! ! Scenario: User login! Given I am on "/"! When I follow "Log in"! And I fill in "name" with "bddtest"! And I fill in "pass" with "bddtest"! And I press "Log in"! Then I should see "My account" ! ! Scenario: User logout! Given I am logged in! And I am on "/"! When I follow "Log out"! Then I should see "Log in" Drupalcamp Tirgu Mures 2013
  • 10. BDD IS A SECONDGENERATION, OUTSIDE–IN, PULL-BASED, MULTIPLESTAKEHOLDER, MULTIPLE-SCALE, HIGH- AUTOMATION, AGILE METHODOLOGY.
  • 11. BEHAVIOUR DRIVEN DEVELOPMENT BDD IN PHP • Behat. • OSS. • Cucumber “language”. • Mink for testing web apps. • Different drivers: Selenium, zombie.js, goutte etc. Drupalcamp Tirgu Mures 2013
  • 12. BEHAVIOUR DRIVEN DEVELOPMENT COMPOSER.JSON {! "require": {! "behat/behat": "2.4.*@stable",! "behat/mink": "1.5.*@stable",! "behat/mink-extension": "*",! "behat/mink-goutte-driver": "*",! "behat/mink-selenium-driver": "*",! "behat/mink-selenium2-driver": "*",! "behat/mink-sahi-driver": "*",! "behat/mink-zombie-driver": "*",! },! "minimum-stability": "dev",! "config": {! "bin-dir": "bin/"! }! }! Drupalcamp Tirgu Mures 2013
  • 13. BEHAVIOUR DRIVEN DEVELOPMENT INSTALL curl http://getcomposer.org/installer | php! php composer.phar install —prefer-source! ! bin/behat —init! ! +d features - place your *.feature files here! +d features/bootstrap - place bootstrap scripts and static files here! +f features/bootstrap/FeatureContext.php - place your feature related code here Drupalcamp Tirgu Mures 2013
  • 14. BEHAVIOUR DRIVEN DEVELOPMENT BEHAT.YML default:! extensions:! BehatMinkExtensionExtension:! base_url: http://drupalcamp.ro/! goutte: ~! zombie: ~! sahi:! port: 9999! selenium2:! wd_host: "http://127.0.0.1:4444/wd/hub"! ! default_session: 'selenium2'! javascript_session: 'selenium2'! Drupalcamp Tirgu Mures 2013
  • 15. DEMO
  • 16. BEHAVIOUR DRIVEN DEVELOPMENT BDD IN DRUPAL • Behat Drupal Extension. • Provides step definitions for common testing scenarios specific to Drupal sites. Drupalcamp Tirgu Mures 2013
  • 17. BEHAVIOUR DRIVEN DEVELOPMENT BDD IN DRUPAL composer.json! ! ! ! ! ! "require": {! ! "drupal/drupal-extension": "*"! ! },! behat.yml! ! ! DrupalDrupalExtensionExtension:! blackbox: ~ Drupalcamp Tirgu Mures 2013
  • 18. BEHAVIOUR DRIVEN DEVELOPMENT BDD IN DRUPAL Given I am logged in as a user with the "authenticated user" role! ! Then I should see the heading “History"! ! Then I should see the heading "User login" in the "left sidebar" region! ! Given the cache has been cleared! ! When I run cron! ! Drupalcamp Tirgu Mures 2013
  • 19. BEHAVIOUR DRIVEN DEVELOPMENT BDD IN DRUPAL Given "page" nodes:! | title |! | Page one |! | Page two |! ! And "article" nodes:! | title |! | First article |! | Second article |! ! Given "article" nodes:! | title | promote | First article with fields | 1 ! Given users:! | name | mail | status | Joe User | joe@example.com | 1 | body |! | PLACEHOLDER BODY |! |! | Drupalcamp Tirgu Mures 2013
  • 21. We’re hiring! AngularJS, Node.js. Come talk to me if you’re interested.