SlideShare a Scribd company logo
1 of 58
dal TDD al BDD
claudio.pattarello@gmail.com

IAD13
Chi sono?

dal TDD al BDD
Chi sono?

Claudio Pattarello

dal TDD al BDD
Chi sono?

Progetto e sviluppo software da 17 anni.

dal TDD al BDD
Chi sono?

Pratico TDD da più di 7 anni.

dal TDD al BDD
Agenda

dal TDD al BDD
Agenda

in questa sessione NON parleremo

dal TDD al BDD
Agenda

in questa sessione NON parleremo
delle differenze tra TDD e BDD

dal TDD al BDD
Agenda

in questa sessione NON parleremo

dal TDD al BDD
Agenda

in questa sessione NON parleremo
delle condizioni per scegliere TDD o BDD

dal TDD al BDD
Agenda

Allora... di cosa parleremo?

dal TDD al BDD
Agenda

come BDD può descrivere meglio TDD

dal TDD al BDD
BDD è sopra TDD

dal TDD al BDD
BDD è sopra TDD

Due definizioni

dal TDD al BDD
BDD è sopra TDD

Cosa è TDD?

dal TDD al BDD
Cosa è TDD?
è un processo di sviluppo software che si appoggia
sulla ripetizione di un breve ciclo di sviluppo:
scrivere un test case automatico (inizialmente
rosso) che definisce un requisito desiderato

produrre la quantità minima di codice per far
passare il test

refactoring del nuovo codice per portarlo ad uno
standard accettabile


BDD è sopra TDD

dal TDD al BDD
BDD è sopra TDD

Cosa è BDD?

dal TDD al BDD
Cosa è BDD?

è un processo di sviluppo software basato
su test-driven development (TDD)

BDD è sopra TDD

dal TDD al BDD
Cosa è BDD?

è un processo di sviluppo software basato
su test-driven development (TDD)
TDD + DDD + OOA + OOD

BDD è sopra TDD

dal TDD al BDD
Cosa è BDD?

è stato sviluppato da Dan North come
risposta ai problemi riscontrati insegnando
TDD

BDD è sopra TDD

dal TDD al BDD
Cosa è BDD?
Da dove cominciare nel processo

Che cosa mettere e non mettere
sotto test

Quante cose mettere sotto test in
una sola volta

Cosa chiamare nel test

Come capire perché un test fallisce


BDD è sopra TDD

dal TDD al BDD
Cosa è TDD?

TDD lavora con il format
AAA
Arrange – Act – Assert

BDD è sopra TDD

dal TDD al BDD
Cosa è BDD?

BDD lavora con il format
GWT
Given – When – Then

BDD è sopra TDD

dal TDD al BDD
Cosa è TDD?

TDD ha il focus sull'implementazione
del sistema

BDD è sopra TDD

dal TDD al BDD
Cosa è BDD?

BDD ha il focus sul comportamento
del sistema

BDD è sopra TDD

dal TDD al BDD
Esempio
+Scenario 1: Account is in credit+

Given the account is in credit
And the card is valid
And the dispenser contains cash
When the customer requests cash
Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned
Cosa è BDD?

dal TDD al BDD
Esempio
+Scenario 2: Account is overdrawn past the
overdraft limit+

Given the account is overdrawn
And the card is valid
When the customer requests cash
Then ensure a rejection message is displayed
And ensure cash is not dispensed
And ensure the card is returned
Cosa è BDD?

dal TDD al BDD
Passiamo alla pratica...
DEMO 1
BDD è sopra TDD

Quali sono i benefici di fondere il
comportamento con lo sviluppo
guidato dal test?

dal TDD al BDD
i benefici

maggiore leggibilità del test

BDD è sopra TDD

dal TDD al BDD
i benefici

migliore organizzazione dei tests

BDD è sopra TDD

dal TDD al BDD
i benefici

scrivere codice per coprire solo le
richieste business

BDD è sopra TDD

dal TDD al BDD
i benefici

suddivisione dei test per contesto

BDD è sopra TDD

dal TDD al BDD
i benefici

separazione delle verifiche

BDD è sopra TDD

dal TDD al BDD
i benefici

migliorare la documentazione
della feature

BDD è sopra TDD

dal TDD al BDD
Frameworks...
DEMO 2
Frameworks

ci sono due tipologie:

BDD è sopra TDD

dal TDD al BDD
Frameworks

xSpec

BDD è sopra TDD

dal TDD al BDD
Frameworks

xBehave

BDD è sopra TDD

dal TDD al BDD
xSpec
sono frameworks usualmente usati dagli
sviluppatori per scrivere codice con un
approccio che favorisce il test del
comportamento e della funzionalità.
Questi test sono solitamente più vicini agli unit
test per aspetto e granularità, ma con alcune
peculiarità.

Frameworks

dal TDD al BDD
xBehave
permette la scrittura di user story in formato
comprensibile da chiunque. Le storie possono
essere scritte dagli stessi utenti o da un gruppo
composto da sviluppatori, utenti e tester.
In genere la story è definita con un
DSL più vicino alla lingua del business,
poi mappa la storia in un test scritto
in codice dagli sviluppatori.
Frameworks

dal TDD al BDD
Frameworks

SpecFlow
progetto attivo:
tipo:
licenza:
nuget package:

BDD è sopra TDD

SI
xBehave
BSD style
SI

dal TDD al BDD
SpecFlow

Frameworks

dal TDD al BDD
Frameworks

Machine.Specifications (MSpec)
progetto attivo:
tipo:
licenza:
nuget package:

BDD è sopra TDD

SI
xSpec
xUnit and MS-PL
SI

dal TDD al BDD
MSpec

Frameworks

dal TDD al BDD
Frameworks

NSpec
progetto attivo:
tipo:
licenza:
nuget package:

BDD è sopra TDD

SI
xSpec
MIT License
SI

dal TDD al BDD
NSpec

Frameworks

dal TDD al BDD
Frameworks

NBehave
progetto attivo:
tipo:
licenza:
nuget package:

BDD è sopra TDD

SI
xBehave
BSD 3
SI

dal TDD al BDD
NBehave

Frameworks

dal TDD al BDD
Frameworks

StoryQ
progetto attivo:
tipo:
licenza:
nuget package:

BDD è sopra TDD

NO
xSpec ~ xBehave
MIT
SI

dal TDD al BDD
StoryQ

Frameworks

dal TDD al BDD
Quale sarà l'evoluzione?

BDD è sopra TDD

dal TDD al BDD
Quale sarà l'evoluzione?

TDD > BDD > ATDD

BDD è sopra TDD

dal TDD al BDD
Quale sarà l'evoluzione?
...
...
...

T e s t - D r iv e n
D e v e lo p m e n t
B e h a v io r - D r iv e n
D e v e lo p m e n t
A u to m a ted
t e s t in g
BDD è sopra TDD

T e s t - F ir s t
D e v e lo p m e n t
dal TDD al BDD
Riferimenti
Growing
Object-Oriented
Software,
Guided by Tests
www.growing-object-oriented-software.com

a.k.a.

GOOS
dal TDD al BDD
Il materiale
slideshare.net/cpattarello/dalTDDalBDD
dalTDDalBDD.codeplex.com
claudiopattarello.blogspot.it

dal TDD al BDD
Q&A

dal TDD al BDD
Grazie
claudio.pattarello@gmail.com

IAD13

More Related Content

Viewers also liked

Agile@scale - Agile Day 2013
Agile@scale - Agile Day 2013Agile@scale - Agile Day 2013
Agile@scale - Agile Day 2013Felice Pescatore
 
One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)
One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)
One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)Gaetano Mazzanti
 
Outcome not Output: A Story of Lean UX Adoption
Outcome not Output: A Story of Lean UX AdoptionOutcome not Output: A Story of Lean UX Adoption
Outcome not Output: A Story of Lean UX AdoptionSteve Maraspin
 
Lean anche io! No tu no! - Italian Agile Days 2013
Lean anche io! No tu no! - Italian Agile Days 2013Lean anche io! No tu no! - Italian Agile Days 2013
Lean anche io! No tu no! - Italian Agile Days 2013Andrea Scavolini
 
Se “Embrace Change” è difficile.
Se “Embrace Change” è difficile.Se “Embrace Change” è difficile.
Se “Embrace Change” è difficile.Fabio Mora
 
Effective Code Transformations in C++
Effective Code Transformations in C++Effective Code Transformations in C++
Effective Code Transformations in C++Marco Arena
 
Agile requirements - alla ricerca del filo rosso (iad 2013)
Agile requirements - alla ricerca del filo rosso (iad 2013)Agile requirements - alla ricerca del filo rosso (iad 2013)
Agile requirements - alla ricerca del filo rosso (iad 2013)Fabio Armani
 
Instilling Scrum Workshop
Instilling Scrum WorkshopInstilling Scrum Workshop
Instilling Scrum WorkshopRaoul Buzziol
 
Agileday Coderetreat 2013
Agileday Coderetreat 2013Agileday Coderetreat 2013
Agileday Coderetreat 2013Gabriele Lana
 

Viewers also liked (11)

Agile@scale - Agile Day 2013
Agile@scale - Agile Day 2013Agile@scale - Agile Day 2013
Agile@scale - Agile Day 2013
 
One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)
One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)
One, No One, One Hundred Thousand Projects (Uno, Nessuno, Centomila Progetti)
 
Agile in 45 minuti
Agile in 45 minutiAgile in 45 minuti
Agile in 45 minuti
 
Outcome not Output: A Story of Lean UX Adoption
Outcome not Output: A Story of Lean UX AdoptionOutcome not Output: A Story of Lean UX Adoption
Outcome not Output: A Story of Lean UX Adoption
 
TDD anche su iOS
TDD anche su iOSTDD anche su iOS
TDD anche su iOS
 
Lean anche io! No tu no! - Italian Agile Days 2013
Lean anche io! No tu no! - Italian Agile Days 2013Lean anche io! No tu no! - Italian Agile Days 2013
Lean anche io! No tu no! - Italian Agile Days 2013
 
Se “Embrace Change” è difficile.
Se “Embrace Change” è difficile.Se “Embrace Change” è difficile.
Se “Embrace Change” è difficile.
 
Effective Code Transformations in C++
Effective Code Transformations in C++Effective Code Transformations in C++
Effective Code Transformations in C++
 
Agile requirements - alla ricerca del filo rosso (iad 2013)
Agile requirements - alla ricerca del filo rosso (iad 2013)Agile requirements - alla ricerca del filo rosso (iad 2013)
Agile requirements - alla ricerca del filo rosso (iad 2013)
 
Instilling Scrum Workshop
Instilling Scrum WorkshopInstilling Scrum Workshop
Instilling Scrum Workshop
 
Agileday Coderetreat 2013
Agileday Coderetreat 2013Agileday Coderetreat 2013
Agileday Coderetreat 2013
 

Similar to dalTDDalBDD

Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioniOpen Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioniVendini-Italy
 
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con DelphiDelphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con DelphiMarco Breveglieri
 
Loosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain modelLoosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain modelFrancesca1980
 
Il computer dice no!
Il computer dice no!Il computer dice no!
Il computer dice no!Matteo Emili
 
SoftInstigate - Modelli di ingaggio nello sviluppo software
SoftInstigate - Modelli di ingaggio nello sviluppo softwareSoftInstigate - Modelli di ingaggio nello sviluppo software
SoftInstigate - Modelli di ingaggio nello sviluppo softwareSoftInstigate
 
Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)
Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)
Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)Ecommerce HUB
 
The simplest thing that could possibly work
The simplest thing that could possibly workThe simplest thing that could possibly work
The simplest thing that could possibly workEmanuele DelBono
 
2019 gennaio 27 XaaS informazione formazione agenti e partner
2019 gennaio 27 XaaS  informazione formazione agenti e partner2019 gennaio 27 XaaS  informazione formazione agenti e partner
2019 gennaio 27 XaaS informazione formazione agenti e partnerDaniel Rueda H
 
Continous Delivery & HQ Code
Continous Delivery & HQ CodeContinous Delivery & HQ Code
Continous Delivery & HQ CodeDaniele Mondello
 
Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2
Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2
Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2Yashi Italia
 
Agile Project Framework
Agile Project FrameworkAgile Project Framework
Agile Project FrameworkSimone Onofri
 
Prototipazione Low-Code con AWS Step Functions
Prototipazione Low-Code con AWS Step FunctionsPrototipazione Low-Code con AWS Step Functions
Prototipazione Low-Code con AWS Step FunctionsCommit University
 
Web X Aziende Scettiche Prova
Web X Aziende Scettiche ProvaWeb X Aziende Scettiche Prova
Web X Aziende Scettiche ProvaGabriella
 
Zurich Italia - IT Knowledge Base (Italian)
Zurich Italia - IT Knowledge Base (Italian)Zurich Italia - IT Knowledge Base (Italian)
Zurich Italia - IT Knowledge Base (Italian)Neo4j
 
Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017
Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017
Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017Daniele Pozzobon
 

Similar to dalTDDalBDD (20)

Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioniOpen Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
 
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con DelphiDelphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
 
Bdd
BddBdd
Bdd
 
Modernizziamo IBM i con PHP
Modernizziamo IBM i con PHPModernizziamo IBM i con PHP
Modernizziamo IBM i con PHP
 
Loosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain modelLoosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain model
 
3DD 1e 1 Agosto Def Roadmap
3DD 1e 1 Agosto Def Roadmap3DD 1e 1 Agosto Def Roadmap
3DD 1e 1 Agosto Def Roadmap
 
Il computer dice no!
Il computer dice no!Il computer dice no!
Il computer dice no!
 
SoftInstigate - Modelli di ingaggio nello sviluppo software
SoftInstigate - Modelli di ingaggio nello sviluppo softwareSoftInstigate - Modelli di ingaggio nello sviluppo software
SoftInstigate - Modelli di ingaggio nello sviluppo software
 
Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)
Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)
Marco Salvatore - Novità tecniche di PrestaShop 1.7.6 (and what’s next)
 
The simplest thing that could possibly work
The simplest thing that could possibly workThe simplest thing that could possibly work
The simplest thing that could possibly work
 
2019 gennaio 27 XaaS informazione formazione agenti e partner
2019 gennaio 27 XaaS  informazione formazione agenti e partner2019 gennaio 27 XaaS  informazione formazione agenti e partner
2019 gennaio 27 XaaS informazione formazione agenti e partner
 
Continous Delivery & HQ Code
Continous Delivery & HQ CodeContinous Delivery & HQ Code
Continous Delivery & HQ Code
 
Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2
Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2
Yashi Enterprise e Microsoft Perchè aggiornare a windows server 2012 r2
 
Agile Project Framework
Agile Project FrameworkAgile Project Framework
Agile Project Framework
 
Prototipazione Low-Code con AWS Step Functions
Prototipazione Low-Code con AWS Step FunctionsPrototipazione Low-Code con AWS Step Functions
Prototipazione Low-Code con AWS Step Functions
 
Web X Aziende Scettiche Prova
Web X Aziende Scettiche ProvaWeb X Aziende Scettiche Prova
Web X Aziende Scettiche Prova
 
Zurich Italia - IT Knowledge Base (Italian)
Zurich Italia - IT Knowledge Base (Italian)Zurich Italia - IT Knowledge Base (Italian)
Zurich Italia - IT Knowledge Base (Italian)
 
Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017
Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017
Using Visual Studio 2017 as a Fully Integrated DevOps Solution - VSSaturday 2017
 
OOP... Object Whaaat?
OOP... Object Whaaat?OOP... Object Whaaat?
OOP... Object Whaaat?
 
Test automatizzati & serenity bdd
Test automatizzati & serenity bddTest automatizzati & serenity bdd
Test automatizzati & serenity bdd
 

dalTDDalBDD