SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
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.

Contenu connexe

Tendances

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
 

Tendances (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.
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Dernier (20)

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
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 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.