BDD with Drupal using Behat – Use Behat and DrupalExtension to automate testing of Drupal applications. – Behaviour Driven Development



BDD with Drupal using Behat – Use Behat and DrupalExtension to automate testing of Drupal applications. – Behaviour Driven Development

0 0


bdd-behat-presentation

Presentation for BDD with Behat. Initially created for Drupal Minicamp Bangalore.

On Github hussainweb / bdd-behat-presentation

BDD with Drupal using Behat

Use Behat and DrupalExtension to automate testing of Drupal applications.

By Hussain Abbas / @hussainweb for Drupal Bangalore Mini-camp

That's me

We're Hiring!

Behaviour Driven Development

  • Based on TDD approach
    • Test First
    • Implement the unit
    • Verify that the tests succeed
  • What's different?
    • More specific tests
    • What should be tested?
    • How it should be tested?
“BDD is a second-generation, outside-in, pull-based, multi stakeholder, multiple scale, high automation, agile technology.” — Dan North

Make it simpler

“BDD is when you use examples in conversations to illustrate behaviour.” — Liz Keogh

Why BDD?

“... test software the matters.”

We Deliver Waste

in name of features

Clients don't care about:

  • Scope
  • Budget

They care about their business.

Conversation

Start Talking

  • Ask Business questions
  • Business Examples
  • Can you give me an example?
  • Less about features, more about software that matters

Conversation

  • More important than capturing it.
  • More important than automating it.

Features

  • Why would anyone want this feature?
  • Who will benefit?
  • What does he need to do?

Ubiquitous Language

Used everywhere.

  • Language of business and developers.
  • Product owners able to understand developers.
  • And correct them.

Bad Features

  • Implementation specific
  • Too specific to technology
#language: en
Feature: Login

  Scenario: Login without filling any detail
    Given I am on "/user"
    When I press "Log in"
    And I should see the following <error messages>
    | error messages             |
    | Username field is required |
    | Password field is required |

Good Features

  • Readable
  • Business Conversation
  • Gives Examples
  • Answers more questions
    • How to name things?
#language: en
Feature: Login

  Scenario: Create users
    Given users:
    | name     | mail            | status |
    | Joe User | joe@example.com | 1      |
    And I am logged in as a user with the "administrator" role
    When I visit "admin/people"
    Then I should see the link "Joe User"

Demo

Links

THE END

BY Hussain Abbas / hussainweb

@hussainweb, hussainweb.me, blog.husainad.com

AxelerantWe're Hiring