Behaviour-driven development is such a good approach to maintain a plain workflow, wasting the time with what really matter: business value.

The common TDD approach, consists basically in writing unit tests, run, make it fail, write code, make it run, make it green. This is such a awesome practice, since you can build really trustable code, without wondering what can happen in the future of the project, thus creating a huge amount of code that doesn’t make sense. Aditionally, next steps use to be: do the same thing with functional, integration and acceptance tests.

Nevertheless, BDD brings new perspectives to you, one of them is the outside-in testing development. With this approach you can build your software starting with the most external layer, and go deeper until reach unitary tests.

Introducing Lettuce

Lettuce is a quite simple tool, it is mostly based on Cucumber, which is a honking great tool, and has a lot more features than Lettuce.

Although Lettuce aims on the most usual tasks on BDD, specially focusing on those that make BDD be so fun :)

Lettuce pragma

Give to developers ability to describe features in natural language, composing it with one one or more scenarios.

Each scenario has one possible behaviour of the feature you want to implement. To make the scenarios run python code, you define steps.

Hands on!

This documentation will drive you through all the Lettuce features. When you feel a bit comfortable, go to the first part of the tutorial, or go further on the reference.