Behat/Drupal Workshop

Behavior-Driven Development for Drupal with Behat

Behavior-Driven Development (BDD)

BDD is an evolution of test-driven development (TDD) and acceptance-test driven design, and is intended to make these practices more accessible and intuitive to newcomers and experts alike. It shifts the vocabulary from being test-based to behaviour-based, and positions itself as a design philosophy. JBehave Project Homepage

What It Is

Concepts and Principles

  1. Describe the behavior of the software to build (user stories)
  2. State the intent and business value of the software to build (feature description)
  3. Use business readable, domain-specific language in your spec that is understood by all participants in the development process (ubiqitous language)
  4. shared understanding and ownership of the software specification
  5. Work from the outside-in (spec to code)

Tooling

A BDD framework will:

  1. read the spec
  2. break up user stories (scenarios) into steps
  3. transfrom steps into parameters for tests
  4. execute tests step-by-step

Learn More