Writing Your First Cucumber Test
Test-driven development is primarily a process for developers. Sometimes, customers and product owners want to see the results of automated tests too. Unfortunately, the humble unit test that is the foundation of TDD is simply too low-level to be helpful to non-developers. That’s where the idea of Behavior Driven Development (BDD) comes in.
BDD tests have a few characteristics that set them apart from the unit tests you’ve seen so far:
- They are end-to-end tests that operate across the entire system.
- They are written in natural language rather than code, which is understandable by non-coders and coders alike.
- They avoid making references to internal mechanics, instead focusing on the outward behavior of the system.
- The test definition describes itself (with unit tests, you need to write a test description that matches the code).
- The syntax is designed to ensure that your tests are written as examples, and as discrete...