Launch with Confidence! Behavior Driven Development (BDD) 101. Presented by: Shawn Smiley [Director of Engineering Operations]



Similar documents
Behavioral Driven Development with Behat

jenkins, drupal & testing automating every phing! miggle

Drupal Automated Testing: Using Behat and Gherkin

Software Continuous Integration & Delivery

DRUPAL CONTINUOUS INTEGRATION. Part I - Introduction

Installation Guide of the Change Management API Reference Implementation

Extending Remote Desktop for Large Installations. Distributed Package Installs

Installing Drupal on Your Local Computer

Software Automated Testing

i2b2 Installation Guide

Mastering Disaster Recovery: Business Continuity and Virtualization Best Practices W H I T E P A P E R

Tutorial: Packaging your server build

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Agile Web Application Testing

Best Practices for Improving the Quality and Speed of Your Agile Testing

Mink Documentation. Release 1.6. Konstantin Kudryashov (everzet)

Git - Working with Remote Repositories

Bring your intranet to the IBM i With Drupal and Zend Server

Using Application Insights to Monitor your Applications

Drupal Drush Guide. Drupal.org

LEARNING DRUPAL. Instructor : Joshua Owusu-Ansah Company : e4solutions Com. Ltd.

Build it with Drupal 8

Magento Search Extension TECHNICAL DOCUMENTATION

Continuous Integration

Develop a Native App (ios and Android) for a Drupal Website without Learning Objective-C or Java. Drupaldelphia 2014 By Joe Roberts

Service Definition Document Microsoft Dynamics CRM Training

Cucumber and Capybara

Profiling and Testing with Test and Performance Tools Platform (TPTP)

Vincent Gabriel. Summary. Experience. Senior Software Developer at Landmark Network

How To Install An Aneka Cloud On A Windows 7 Computer (For Free)

Testing Python. Applying Unit Testing, TDD, BDD and Acceptance Testing

OMU350 Operations Manager 9.x on UNIX/Linux Advanced Administration

Erie 1 BOCES/WNYRIC. Secure File Transfer. Upload/Download Wizard

Inteset Secure Lockdown ver. 2.0

Building Mobile Applications Creating ios applications with jquery Mobile, PhoneGap, and Drupal 7

HP Performance Center 11.5: What s New? Gurmeen Aneja

ADOBE REMOTE UPDATE MANAGER TECHNICAL NOTE

CanReg5 Webinar 6: Customization and Management

Python for Series 60 Platform

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

Streamline your drupal development workflow in a 3-tier-environment - A story about drush make and drush aliases

JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments. George Bochenek Randy Jones

CI:IRL. By Beth Tucker Long

Practice Fusion API Client Installation Guide for Windows

SAS Marketing Optimization. Windows Installation Instructions for Hot Fix 51mo14

HP Data Protector Integration with Autonomy IDOL Server

XMap 7 Administration Guide. Last updated on 12/13/2009

Digipass Plug-In for IAS. IAS Plug-In IAS. Microsoft's Internet Authentication Service. Installation Guide

GETTING STARTED WITH CONTINUOUS DELIVERY. Lana wcgp.co

Installing CM4D Reporter with Microsoft SQL Server Express R2 x64 for Windows 7

HarePoint Workflow Extensions for Office 365. Quick Start Guide

Test Automation Integration with Test Management QAComplete

SAP RAPID DEPLOYMENT FOR APPLICATION LIFECYCLE MANAGEMENT WAVE TEST MANAGEMENT INFORMATION SHEET FOR SERVICE DELIVERY

UFTP AUTHENTICATION SERVICE

SAS Marketing Automation 4.4. Unix Install Instructions for Hot Fix 44MA10

SafeNet KMIP and Google Cloud Storage Integration Guide

Team Foundation Server 2012 Installation Guide

Installing Magento Extensions

IS L06 Protect Servers and Defend Against APTs with Symantec Critical System Protection

Cloudwords Drupal Module. Quick Start Guide

Automated Testing with Magento. Meet-Magento DE

Simplify SSL Certificate Management Across the Enterprise

Single Sign On. SSO & ID Management for Web and Mobile Applications

SQL Server 2005: Report Builder

Installing and using XAMPP with NetBeans PHP

Request for Proposal (RFP)

REMOTE DEVELOPMENT OPTION

JAVA WEB START OVERVIEW

Ingenious Testcraft Technical Documentation Installation Guide

Web Developer Toolkit for IBM Digital Experience

IBM SmartCloud Workload Automation - Software as a Service. Agent Installation and Uninstallation Messages

Case Study. Portfolio Listing application Brainvire Infotech Pvt. Ltd Page 1 of 1

Content Management System

JD Edwards EnterpriseOne CRM Case Management

SOLUTIONS IT CONSULTANCY

SonicWALL CDP 5.0 Microsoft Exchange InfoStore Backup and Restore

Creating Value through Innovation MAGENTO 1.X TO MAGENTO 2.0 MIGRATION

Automating Testing and Configuration Data Migration in OTM/GTM Projects using Open Source Tools By Rakesh Raveendran Oracle Consulting

Web analytics, Dashboard & Optimization Experts. Web Analytics Audit Best Practices

About This Document 3. About the Migration Process 4. Requirements and Prerequisites 5. Requirements... 5 Prerequisites... 5

AJ Matrix V5. Installation Manual

The QlikView deployment framework

BROCADE PERFORMANCE MANAGEMENT SOLUTIONS

Installation manual SAP Business Objects Data Services XI 3.2 on a Microsoft Windows 7-64-bit machine

MSSQL quick start guide

How To Manage A Multi Site In Drupal

The Fastest Way to a Drupal Site: Think it, Plan it, Build it.

Transcription:

Launch with Confidence! Behavior Driven Development (BDD) 101 Presented by: Shawn Smiley [Director of Engineering Operations]

About Me LinkedIn: www.linkedin.com/in/shawnsmiley/" Twitter: @shawnsmiley" 3 Shawn S. Smiley Director of Engineering Operations at Achieve Internet 15+ years experience in Internet software and hosting 5+ years with Drupal Recently married

Agenda What is BDD? Why should I use it? How do I use it? Basic Syntax Getting Setup Writing Your First Test Writing custom steps 4

Achieve at a Glance legal name founded headquarters leadership mission primary contact info Achieve Internet, Inc." 1998" 1767 Grand Avenue, Suite #2 San Diego, CA 92109 U.S.A." Ron Huber, Chief Executive Officer" Achieve leverages best-in-class Open Source web application development experience, and tools to create optimized platforms for enterprise clients. " 800.618.8777 info@achieveinternet.com" Achieve is a leading software development company that leverages Drupal to develop advanced enterprise web and mobile solutions for an array of clients in varying verticals. Achieve has a singular goal: To help you launch your advanced digital platforms with confidence. Our ethos is it s not magic, it s excellence, and our all-star developers deliver on that promise with every new project we take on by consistently exceeding client expectations. 5

Key Clients: Media & Entertainment clients! 6

Additional Key Clients clients! 7

Achieve Services Application Development! Achieve builds custom enterprise IT management systems to solve the most complex business challenges. Platform! Integration! Achieve makes integration easy so you can focus on what is most important to your business your customers. Infrastructure Services! Optimize the performance of your web site or application to increase productivity and streamline operations. Achieve has vast experience in creating global web solutions that far out perform the competition. Globalization Services! Mobility & End User Services! Going Mobile is no longer an option. With Achieve you won t have to compromise design for utility. 8

What is BDD? 9

Where does BDD Fit? Type of Tes)ng Examples of Automated Tools When used? Unit Tes0ng phpunit, SimpleTest Tes0ng low level, single func0ons. Func0onal Tes0ng Behavioral Tes0ng Acceptance Tes0ng phpunit, SimpleTest Behat, Cucumber, Fitnesse Behat, Cucumber, Fitnesse Tes0ng larger structures such as classes, services or modules. Tes0ng business requirements. Tes0ng complex/composite func0onality. * All of these types of tes0ng can be done manually Verifying that the final product looks and behaves as designed. 10

What does it look like? 11

Why do BDD? 12

Benefits and Limitations Benefits Allows testing the sum rather than the parts Tests can be written in a human readable format Can test end-user interactions with a site Can test AJAX and other client side scripts (leveraging Selenium) Limitations Not for testing theming or presentation. Setup of the test framework can be a bit complicated to get working. Syntax, while human readable, is still very rigid/strict. 13

How to do BDD? 14

Basic syntax and usage File: features/<feature name>.feature Feature: <feature name> <feature descrip0on> Scenario: <scenario name> Given <there is some condi0on> When <I do something> Then <I should see something> Scenario: <scenario name> Given <there is some condi0on> When <I do something> Then <I should see something> 15

Basic syntax and usage: Example File: features/login.feature 16

Getting Set Up: Components Components: PHP 5.3 Composer (http://getcomposer.org) Behat (http://behat.org) Mink (https://github.com/behat/mink) Java Selenium Server (http://docs.seleniumhq.org) Drupal Library Behat Drupal Extension (https://drupal.org/project/drupalextension) This is the extension Drupal.org uses for their BDD tests and the one this presentation uses. Behat integration with Drupal (https://drupal.org/project/behat) Drupal Behat Testing (https://drupal.org/project/behat_testing) 17

Getting Setup Up: Install Prerequisites PHP 5.3 (I m assuming you already have this) Composer curl -s https://getcomposer.org/installer php Selenium Server Download & install Java for your platform Download Selenium from http://selenium.googlecode.com/files/ selenium-server-standalone-2.39.0.jar 18

Getting Setup Up: Create your project Create a folder for your project (e.g. mybddtests ) WARNING: Do not place this inside your docroot Change into your project folder (cd mybddtests) Create the file composer.json with the following content: { "require": { "drupal/drupal-extension": "*" }, "config": { "bin-dir": "bin/" } } run: php composer.phar install 19

Getting Setup Up: Create your project Create the file behat.yml with the following content: run: bin/behat --init 20

Basic Folder Structure <BDD Project Root> bin Contains the behat and webunit executable files. features Contains your actual test code in *.feature files. bootstrap Contains the site specific PHP scripts for your features. vendor Contains various libraries used by the test framework. 21

Getting Setup Up: Create your project Edit features/bootstrap/featurecontext.php Change the extends statement on the FeatureContext class to be Drupal\DrupalExtension\Context\DrupalContext Verify that everything is setup correctly by running bin/ behat dl You should see a long list of supported test patterns. 22

Getting Setup Up: Create your tests cd features Create a file named login.feature and open it in an editor Add the following content to the login.feature file: 23

Getting Setup Up: Run your test Go to the root of your project folder. Run: bin/behat You should see an output similar to the following: 24

Creating custom steps 25

Creating custom steps Create a new file features/nav_block_visible.feature with the following content: The step Then I should see a block titled Navigation is our new custom step. 26

Creating custom steps Run: bin/behat, you ll see an output similar to the following: Copy the output text and add it to features/bootstrap/ FeatureContext.php and rerun bin/behat. 27

Creating custom steps Set the content of the ishouldseeablocktitled() method: 28

Creating custom steps Rerun behat: bin/behat You should see the following: 29

Success! 30

Behavior Driven Development 31

References Behat - hyp://behat.org Gherkin Language - hyp://docs.behat.org/guides/1.gherkin.html Drupal.org BDD Tests - hyps://drupal.org/project/doobie Drupal.org BDD Tests Documenta0on Page - hyps://drupal.org/node/1551234 Behat Drupal Extension - hyps://drupal.org/project/drupalextension Dan North (Creator of BDD) - hyp://dannorth.net/category/bdd/ Behat Cheatsheet: hyp://blog.lepine.pro/wp- content/uploads/2012/03/behat- cheat- sheet- en.pdf 32

Interested in this topic? Want to know more? Want to be part of the team? Stop by the booth and let s chat! 33

Thank You Shawn Smiley! Director of Engineering Operations" shawn.smiley@achieveinternet.com" Drupal: shawn_smiley" 800.618.8777"

Connect with Achieve If you have any further questions or would like to get in touch with Achieve you can do so on these various channels: info@achieveinternet.com linkedin.com/company/achieve-internet plus.google.com/101805819007866218919 @AchieveInternet facebook.com/pages/achieve-internet 35

Q & A 36