Accéder au contenu principal

Behaviour Driven Development at Zenika

I have assisted to the Zenika's conference about Behaviour Driven Development given by Mauro Talevi from Agilesque.

The presentation was mainly decomposed in 3 parts : Introduction to BDD, Presentation of JBehave (the API used to do BDD in java) and return on experience about a real project.

Introduction to BDD.

BDD brings together Test Driven Development and Domain Driven Design by
- describing behaviour is a better form of testing
- describing needs from from point of view of it's stakeholder

BDD relies on the use of a specific language to help communication between the business, developers, testers, analysts and managers. It improves presentation.
Behaviours are described by scenarios with a why ? the value, a who ? the actor and the what ? the feature.
BDD introduce a grammar of steps GIVEN a context, WHEN there is an event, THEN produce an outcome AND do other steps.
BDD offers step parametrisation, aliases for changing language or tabularisation for changing parameters for a given scenario.
Behaviours can also become regression tests.

Example of scenario (from wikipedia) : Refunded items should be returned to stock
Given a customer buys a black jumper
and I have three black jumpers left in stock
when he returns the jumper for a refund
then I should have four black jumpers in stock

See more info here :
http://en.wikipedia.org/wiki/Behavior_Driven_Development
http://behaviour-driven.org/

Use of Jbehave.
http://jbehave.org/introduction/

Jbehave is based on Java with command line, IDE and Web integration.
It supports classic parameters type and Custom for business objet (by implementing ParameterConverter).
The association with the project code is done with annotation and the scenario data are organised in table.
It provides a layer for web testing tool (Selenium for example).
There is a small tutorial here : http://jbehave.org/documentation/two-minute-tutorial/.

Retrospective from real project experience.

The good :
communication with scenario
confidence by making behaviours more readable and visible
allows aggressive re-factoring
Tool integration allowing developer to run scenarios before commit
Web runner allowing separates testing from development environment
pairing is very valuable between tester, developer and business

The bad :
Data formats don't re-factor well (XML, CSV) especially for large data-set
finding the « then » : best form of verification can be tricky for data-centric scenario
Developer are not behaviour driven
Scenario data can become unmanageable. Cut & paste is easy temptation.
Need times to improve scenarios

The conclusion from Mauro Talevi is that BDD represents a new paradigm : very useful and simple but not always as easy and needs time.

A good presentation in french : http://www.slideshare.net/ehsavoie/at2009-soigner-sa-schizophrenie-12

Commentaires

Posts les plus consultés de ce blog

Summary of 'Words are windows, Introduction to nonviolent communication' by Marshall Rosenberg

Summary of 'Words are windows, Introduction to nonviolent communication' by Marshall Rosenberg “Words are windows” is an introduction to non violent communication (abbreviated as NVC). Marshall Rosenberg presents in this book the process that allows us to communicate more serenely with others as well as with ourselves. This mode of communication allows us to become more and more caring, authentic, and empathic with others. It can therefore be used in all interactions of everyday life: as a couple, with our children, at work … NVC is proving to be a very effective way to manage conflicts, and also to better identify our own needs. At the source of Non Violent Communication NVC has 4 four key components: Observation – specific facts/data, no evaluation/judgment Feeling – state how we feel (many failure modes here) Need – the need underlying this feeling Request – must be specific action to address need First we observe what is really happening in a given situatio

Summary of 'Clean Architecture' by Robert C. Martin

Summary of 'Clean Architecture' by Robert C. Martin Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software. Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book. Clean Architecture leaves me with the same feeling, even if it’s pushing the development world to do better, has some good stories and present robust principles to build software. The book is build around 34 chapters organised in chapters. Programming paradigm After some introduction, there is an overview of three paradigm of programming: structured programming which imposes discipline on direct transfer of control object oriented programming which imposes discipline on indirect transfer of control functional programming which imposes discipline upon assignment Uncle Bob tells us

Le développeur incompétent est un mythe

Sous ce titre complètement arbitraire et très clairement provocateur, je vais passer un contre pied aux derniers articles que j'ai lus sur le métier de développeur. Par exemple : http://patricelamarche.net/2011/05/24/lincomptence-des-dveloppeurs/  http://blogs.codes-sources.com/tja/archive/2011/10/04/etre-un-bon-d-veloppeur-c-est-aussi-une-question-d-attitude-personnelle.aspx  Ça tombe bien c'est juste avant la soirée du Paris JUG sur le métier de développeur ! Et comme on se plaint que les présentateurs ne sont pas de vrais (?) développeurs, je vais en profiter pour donner mon avis. Alors voila, d'après ces articles, un bon développeur connait ses fondamentaux. Ok soit mais quelle est cette liste de fondamentaux ?  Chez certains, c'est les maths et l'algorithmie pure, d'autres c'est C++ par coeur et savoir retourner une chaine de caractère en moins de 3 instructions et une seule allocation mémoire, d'autres c'est Java JEE, ses 100 jsr et fra