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.
- 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
- 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