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

Hébergement d'un blog !

Bon il y a maintenant plusieurs semaines, j'ai lancé un blog sur l'expérience utilisateur (ux-fr.com) : hébergement sur le serveur gandi d'un ami, wordpress 2.8, un thème courant mais correct et les plug ins indispensables. Bon déjà le site était affreusement lent et enfin tout est tombé depuis une semaine impossible de relancer le wordpress. 80% de chance que ca vienne du site en lui même mais qui à tout refaire (j'ai quand même les articles normalement c'est déjà une chance énorme), j'aimerais faire cette fois un choix efficace, robuste et rapide. Le prix n'est pas vraiment le problème (enfin jusqu'a 100 euros par an, j'ai pas encore 10 000 visiteurs par jour). Par contre, je veux quelque chose qui ne demande de perdre du temps sur la partie technique. Niveau site, je pense que le mieux est de rester sur du Wordpress donc je cherche un bon hebergeur pour du php/mysql ce qu'il y a de plus classique. Je suis ouvert à des propositions innovantes p...