BDD

Define and test your value

MASMOVIL TECHNOLOGY

BEHAVIOR

DRIVEN

DEVELOPMENT

It's not about testing

it's about how we build software

INFLUENCES

Test Driven Development evolution

Agile => Specs

Lean => Focused on business value

Domain Driven Development => Ubiquitous Language

Object Oriented Programming => Page Objects

TOOLING

cucumber => tool

gherkin => syntax

A Node.js tool to automate end-to-end web testing.

  • No Webdriver required
  • Crossplatform
  • CrossBrowser

Collaboration Platform for Behavior Driven Development

  • CI integration
  • Scale BDD

THREE AMIGOS!

Business

QA

DevTeam

THREE AMIGOS!

Business => What problem are we trying to solve?

 

Development => How might we build a solution to solve that problem?

 

Testing => What about this, what could possibly happen?

SCENARIOS

Scenario: Finding some cheese
   Given I am on the Google search page
   When I search for "Cheese!"
   Then the page title should start with "cheese"

Write "drafts" with business or domain experts.

Refine it with Testing and DevTeam to ensure best practices.

EXECUTABLE SPECS

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running hellocucumber.RunCucumberTest
Feature: Is it Friday yet?
  Everybody wants to know when it's Friday

  Scenario Outline: Today is or is not Friday # hellocucumber/is_it_friday_yet.feature:4
    Given today is <day>                      # hellocucumber/is_it_friday_yet.feature:5
    When I ask whether it's Friday yet        # hellocucumber/is_it_friday_yet.feature:6
    Then I should be told <answer>            # hellocucumber/is_it_friday_yet.feature:7

  Scenario: Sunday isn't Friday        # hellocucumber/is_it_friday_yet.feature:4
    Given today is Sunday              # Stepdefs.today_is_Sunday()
    When I ask whether it's Friday yet # Stepdefs.i_ask_whether_it_s_Friday_yet()
    Then I should be told "Nope"       # Stepdefs.i_should_be_told(String)

    Examples:
      | day              | answer |
      | "Friday"         | "TGIF" |
      | "Sunday"         | "Nope" |
      | "anything else!" | "Nope" |

3 scenarios (3 passed)
9 steps (9 passed)
0m0.255s

SPECS STATUS

Base Project

REFERENCES

Q&A

@anthanh | #frontend-general | #tech-chat

SURVEY TIME!

WEB PERFORMANCE DAY

08/07

Thanks!

BDD - Define and test your value

By Anthanh

BDD - Define and test your value

How we define and test our value. With example repo at https://github.com/anthanh/cucumber-testcafe-example

  • 803