Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 923 Bytes

bdd.md

File metadata and controls

20 lines (13 loc) · 923 Bytes

Behaviour Driven Development

Behaviour Driven Development (BDD) as a process emerged from Test Driven Development (TDD). It combines techniques from TDD with ideas from Domain Driven Design. It uses a simple, domain-specific scripting language (DSL) which converts natural language statements into executable tests.

BDD Focuses On:

  • Where to start
  • What to test and what not to test
  • How much to test at once
  • What to name the tests
  • How to understand why a test fails

What a BDD Test Looks Like:

  • Acceptance tests should be written similar to a user story - "Given [context], when [event occurs], then [some outcome]"
  • Unit test names should be whole sentences starting with a conditional verb (should)
  • Expressive test names are helpful when a test fails

If a class is doing more than one thing, I usually take it as an indication that I should introduce other classes to do some of the work