SlideShare une entreprise Scribd logo
1  sur  74
Télécharger pour lire hors ligne
MILAN november 28th/29th 2014 
Riccardo Franconi e Francesco Tassi 
! 
BDD Tutta questione di comunicazione 
Raccontiamo il BDD in un progetto reale 
rf@ideato.it ftassi@ideato.it - ideato
MILAN november 28th/29th 2014 
@ftassi 
Francesco Tassi 
@ricfrank 
Riccardo Franconi
MILAN november 28th/29th 2014
MILAN november 28th/29th 2014 
BDD 
• Vediamo cos’è 
• La nostra esperienza 
• Cosa abbiamo imparato
MILAN november 28th/29th 2014 
“behavior-driven development (abbreviato in 
BDD e traducibile in Sviluppo guidato dal 
comportamento) è una metodologia di sviluppo 
del software basata sul test-driven development 
(TDD)” 
– Wikipedia
MILAN november 28th/29th 2014 
“Non basta scrivere software correttamente, 
bisogna anche scrivere il software corretto” 
– “BDD in Action” John Ferguson Smart
MILAN november 28th/29th 2014 
BDD in breve 
• Esempi non test 
• Linguaggio condiviso 
• Business Value
MILAN november 28th/29th 2014 
Esempi non test
MILAN november 28th/29th 2014 
Esempi non test 
public function testSomma(){ 
//... 
}
MILAN november 28th/29th 2014 
Esempi non test 
Scenario: Somma 
Dato che inserisco due numeri 
Allora Ottengo la loro somma 
public function 
testOperazioneSommaDovrebbeSommareDueNumeri() 
{ 
//... 
}
MILAN november 28th/29th 2014 
Linguaggio condiviso
MILAN november 28th/29th 2014
MILAN november 28th/29th 2014
MILAN november 28th/29th 2014
MILAN november 28th/29th 2014
MILAN november 28th/29th 2014 
“Le parole sono importanti” 
– Moretti
MILAN november 28th/29th 2014 
Linguaggio condiviso 
Scenario: Guest deve confermare la data prima 
di continuare con la prenotazione
MILAN november 28th/29th 2014 
Linguaggio condiviso 
WTF!?! 
Scenario: Guest deve confermare la data prima 
di continuare con la prenotazione
MILAN november 28th/29th 2014 
Linguaggio condiviso 
Scenario: Il giocatore deve confermare la 
data prima di continuare con la prenotazione
MILAN november 28th/29th 2014 
Business value
MILAN november 28th/29th 2014 
delivering 
Business value
MILAN november 28th/29th 2014 
Come
MILAN november 28th/29th 2014 
Come Discussione 
Obiettivo FFeFeaeatuaturteuresress 
Specifiche 
Eseguibili 
Specifiche 
Eseguibili 
EEsseemmppi i Specifiche 
Esempi 
Eseguibili
MILAN november 28th/29th 2014 
Obiettivo 
(SMART)
MILAN november 28th/29th 2014 
Obiettivo 
“Voglio aumentare il fatturato del 5% entro fine anno 
ricevendo più prenotazioni”
MILAN november 28th/29th 2014 
Features 
Gherkin
MILAN november 28th/29th 2014 
Features 
Gli strumenti che permettono di raggiungere l’obiettivo
MILAN november 28th/29th 2014 
Esempi 
Gherkin
MILAN november 28th/29th 2014 
Esempi 
Descrive come l’utente utilizza la feature
MILAN november 28th/29th 2014 
Specifiche eseguibili 
Behat - PHPSpec
MILAN november 28th/29th 2014 
Specifiche eseguibili 
Scenario: Prenotazione con email non valida! 
Dato che un giocatore ha scelto di prenotare un campo per "domani"! 
Quando completa la prenotazione con una mail non valida! 
Allora visualizza che deve inserire una mail valida! 
!! 
/**! 
* @Given /^che un ospite ha scelto di prenotare un campo per "domani"$/! 
*/! 
public function haSceltoDiPrenotarePerIl($bookingDate = null){…}
MILAN november 28th/29th 2014 
Bola
MILAN november 28th/29th 2014 
Obiettivo 
Per avere un vantaggio competitivo rispetto ai miei 
concorrenti 
Voglio avere un sistema di prenotazione online 
Che permetta ai miei clienti di prenotare da computer o 
smartphone
MILAN november 28th/29th 2014 
Features 
Feature: Prenotazione campo 
Per rendere più semplice e aumentare il 
numero delle prenotazioni ricevute 
Come giocatore 
Voglio poter prenotare online un campo
MILAN november 28th/29th 2014 
Esempi 
Scenario: Visualizzazione dei campi 
disponibili 
Scenario: Prenotazione di un campo 
Scenario: Mail di conferma della 
prenotazione 
Scenario: Prenotazione ricorrente 
....
MILAN november 28th/29th 2014 
Esempi 
Scenario: Visualizzazione dei campi disponibili! 
Quando l'utente autenticato visita la pagina dei campi! 
Allora può vedere i campi divisi per sport
MILAN november 28th/29th 2014 
Esempi 
Autenticato!?! 
Scenario: Visualizzazione dei campi disponibili! 
Quando l'utente autenticato visita la pagina dei campi! 
Allora può vedere i campi divisi per sport
MILAN november 28th/29th 2014 
Esempi 
-Q: “Ma l’utente quindi è un utente 
registrato?” 
Scenario: Visualizzazione dei campi disponibili! 
- A: “Si” 
- Q: “Perché?” 
- A: “Perché così lo posso rintracciare” 
- Q: “Ma, non basta il numero di telefono?” 
Quando l'utente autenticato visita la pagina dei campi! 
Allora può vedere i campi divisi per sport 
-A: “Beh, si” Autenticato!?!
MILAN november 28th/29th 2014 
Esempi 
Scenario: Visualizzazione dei campi disponibili! 
Quando l'utente autenticato il giocatore visita la 
pagina dei campi! 
Allora può vedere i campi divisi per sport
MILAN november 28th/29th 2014 
Esempi 
Scenario: Visualizzazione dei campi disponibili! 
Quando il giocatore visita la pagina dei campi! 
Allora può vedere i campi divisi per sport 
—- spreco
MILAN november 28th/29th 2014 
Esempi 
Scenario: Prenotazione ricorrente! 
Quando l’admin sceglie un campo! 
E seleziona il prossimo martedì! 
E seleziona la data di fine ripetizione tra 4 martedì! 
E la ripetizione "settimanale"! 
E completa la prenotazione! 
Allora ha prenotato quel campo per i prossimi 4 martedì
MILAN november 28th/29th 2014 
Esempi 
Scenario: Prenotazione ricorrente! 
Quando l’admin sceglie un campo! 
E seleziona il prossimo martedì! 
E seleziona la data di fine ripetizione tra 4 martedì! 
E la ripetizione "settimanale"! 
E completa la prenotazione! 
Allora ha prenotato quel campo per i prossimi 4 martedì 
se non è disponibile!?!
MILAN november 28th/29th 2014 
Esempi 
- Q: “cosa succede?” 
- A: “Salviamo solo le valide” 
- Q: “E delle altre come tieni traccia?” 
- A: “Inviami un elenco di quelle 
Scenario: Prenotazione ricorrente! 
l’admin sovrapposte” 
Quando sceglie un campo! 
E seleziona il prossimo martedì! 
E seleziona la data di fine ripetizione tra 4 martedì! 
E la ripetizione "settimanale"! 
E completa la prenotazione! 
Allora ha prenotato quel disponibile!?! 
campo per i prossimi 4 martedì non è se
MILAN november 28th/29th 2014 
Esempi 
Scenario: Prenotazione ricorrente sovrapposta! 
Dato che il giocatore ha completato una 
prenotazione! 
Quando l'admin crea una prenotazione ricorrente 
che si sovrappone a quella esistente! 
Allora ha prenotato quel campo solo per le 
giornate disponibili! 
E riceve un riepilogo delle prenotazioni 
sovrapposte
MILAN november 28th/29th 2014 
Esempi 
++ conoscenza del dominio 
Scenario: Prenotazione ricorrente sovrapposta! 
Dato che il giocatore ha completato una 
prenotazione! 
Quando l'admin crea una prenotazione ricorrente 
che si sovrappone a quella esistente! 
Allora ha prenotato quel campo solo per le 
giornate disponibili! 
E riceve un riepilogo delle prenotazioni 
sovrapposte
MILAN november 28th/29th 2014 
Specifiche eseguibili 
Scenari espressivi - Outside in - Page Object pattern
MILAN november 28th/29th 2014 
Scenari espressivi 
Scenario: Prenotazione! 
Quando un giocatore visita la pagina dei campi! 
E ne sceglie uno! 
E seleziona il giorno dalla select "booking_day"! 
E seleziona il mese dalla select "booking_month"! 
E seleziona l'anno dalla select "booking_year"! 
...
MILAN november 28th/29th 2014 
Scenari espressivi 
Scenario: Prenotazione! 
Quando un giocatore visita la pagina dei campi! 
E ne sceglie uno! 
E seleziona il giorno dalla select "booking_day"! 
E seleziona il mese dalla select "booking_month"! 
E seleziona l'anno dalla select "booking_year"! 
...
MILAN november 28th/29th 2014 
Scenari espressivi 
Scenario: Prenotazione! 
Quando un giocatore visita la pagina dei campi! 
E ne sceglie uno! 
E seleziona la data! 
...
MILAN november 28th/29th 2014 
Scenari espressivi 
Scenario: Prenotazione con email non valida! 
! 
Quando un giocatore visita la pagina dei campi! 
E ne sceglie uno! 
E seleziona la data! 
E completa la prenotazione con una mail non valida! 
Allora visualizza che deve inserire una mail valida
MILAN november 28th/29th 2014 
Scenari espressivi 
Scenario: Prenotazione con email non valida! 
! 
Quando un giocatore visita la pagina dei campi! 
E ne sceglie uno! 
E seleziona la data! 
E completa la prenotazione con una mail non valida! 
Allora visualizza che deve inserire una mail valida
MILAN november 28th/29th 2014 
Scenari espressivi 
Background:! 
Quando un giocatore visita la pagina dei campi! 
E ne sceglie uno! 
E seleziona la data! 
! 
Scenario: Prenotazione con email non valida! 
E completa la prenotazione con una mail non valida! 
Allora visualizza che deve inserire una mail valida
MILAN november 28th/29th 2014 
Codice espressivo 
/**! 
* @Given /^completa la prenotazione con una mail non valida$/! 
*/! 
public function completaLaPrenotazioneConUnaMailNonValida()! 
{!! 
$page = $this->mink->getSession()->getPage();! 
! 
! $this->player = $this->createPlayer();! 
! $this->player->email = 'fooinvalidemail';! 
! $page->fillField('firstName', $this->player->firstName);! 
! $page->fillField('lastName', $this->player->lastName);! 
! $page->fillField('email', $this->player->email);! 
! $page->fillField('phone', $this->player->phoneNumber);! 
! 
! $page->pressButton('book');! 
}
MILAN november 28th/29th 2014 
Codice espressivo 
/**! 
* @Given /^completa la prenotazione con una mail non valida$/! 
*/! 
public function completaLaPrenotazioneConUnaMailNonValida()! 
{!! 
$page = $this->mink->getSession()->getPage();! 
! 
! $this->player = $this->createPlayer();! 
! $this->player->email = 'fooinvalidemail';! 
! $page->fillField('firstName', $this->player->firstName);! 
! $page->fillField('lastName', $this->player->lastName);! 
! $page->fillField('email', $this->player->email);! 
! $page->fillField('phone', $this->player->phoneNumber);! 
! 
! $page->pressButton('book');! 
}
MILAN november 28th/29th 2014 
Codice espressivo 
/**! 
* @Given /^completa la prenotazione con una mail non valida$/! 
*/! 
public function completaLaPrenotazioneConUnaMailNonValida()! 
{!! 
$bookingPage = $this->getBookingPage();! 
! 
! $this->player = $this->createPlayer();! 
! $this->player->email = 'fooinvalidemail';! 
! $this->bookingPage->book($this->player);! 
}
MILAN november 28th/29th 2014 
class BookingPage ! 
{! 
! public function book($player)! 
! {! 
! ! $this->page->fillField('firstName', $player->firstName);! 
! $this->page->fillField('lastName', $player->lastName);! 
! $this->page->fillField('email', $player->email);! 
! $this->page->fillField('phone', $player->phoneNumber);! 
! 
! $this->page->pressButton('book');! 
}! 
} 
Codice espressivo
MILAN november 28th/29th 2014 
Outside in 
1 
2 
3 
5 4 
phpspec 
Behat 
6 
1 - Discussione di uno scenario 
2 - Step rosso 
3 - Spec rossa 
4 - Implementazione 
7 
5 - Refactoring 
6 - Step verde 
7 - Refactoring
MILAN november 28th/29th 2014 
Cosa abbiamo imparato
MILAN november 28th/29th 2014 
Comunicazione 
Migliore verso il cliente
MILAN november 28th/29th 2014 
Comunicazione 
Migliore nel team
MILAN november 28th/29th 2014 
Comprendi la funzionalità 
tramite esempi
MILAN november 28th/29th 2014 
Non sviluppare oggi quello 
che puoi sviluppare domani
MILAN november 28th/29th 2014 
Fai emergere 
problematiche impreviste
MILAN november 28th/29th 2014 
Non dare niente per 
scontato
MILAN november 28th/29th 2014 
Documentazione
MILAN november 28th/29th 2014 
Comprensibile 
anche per non tecnici
MILAN november 28th/29th 2014 
Compilabile 
Non obsoleta
MILAN november 28th/29th 2014 
Ostacoli
MILAN november 28th/29th 2014 
Cliente non partecipa
MILAN november 28th/29th 2014 
È già tutto deciso
MILAN november 28th/29th 2014 
Se lo sai descrivere l’hai 
capito
MILAN november 28th/29th 2014 
Thanks
MILAN november 28th/29th 2014 
https://joind.in/12837
MILAN november 28th/29th 2014 
Risorse 
• http://www.ideato.it/tag/bdd! 
• Bdd in Action: Behavior-driven Development for the Whole Software Lifecycle di John 
Ferguson Smart! 
• Specification by Example: How Successful Teams Deliver the Right Software di Gojko 
Adzic! 
• The RSpec Book: Behaviour Driven Development di Dave Astels, Bryan Helmkamp, Dan 
North, Zac David Chelimsky

Contenu connexe

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

BDD tutta questione di comunicazione

  • 1. MILAN november 28th/29th 2014 Riccardo Franconi e Francesco Tassi ! BDD Tutta questione di comunicazione Raccontiamo il BDD in un progetto reale rf@ideato.it ftassi@ideato.it - ideato
  • 2. MILAN november 28th/29th 2014 @ftassi Francesco Tassi @ricfrank Riccardo Franconi
  • 4. MILAN november 28th/29th 2014 BDD • Vediamo cos’è • La nostra esperienza • Cosa abbiamo imparato
  • 5. MILAN november 28th/29th 2014 “behavior-driven development (abbreviato in BDD e traducibile in Sviluppo guidato dal comportamento) è una metodologia di sviluppo del software basata sul test-driven development (TDD)” – Wikipedia
  • 6. MILAN november 28th/29th 2014 “Non basta scrivere software correttamente, bisogna anche scrivere il software corretto” – “BDD in Action” John Ferguson Smart
  • 7. MILAN november 28th/29th 2014 BDD in breve • Esempi non test • Linguaggio condiviso • Business Value
  • 8. MILAN november 28th/29th 2014 Esempi non test
  • 9. MILAN november 28th/29th 2014 Esempi non test public function testSomma(){ //... }
  • 10. MILAN november 28th/29th 2014 Esempi non test Scenario: Somma Dato che inserisco due numeri Allora Ottengo la loro somma public function testOperazioneSommaDovrebbeSommareDueNumeri() { //... }
  • 11. MILAN november 28th/29th 2014 Linguaggio condiviso
  • 16. MILAN november 28th/29th 2014 “Le parole sono importanti” – Moretti
  • 17. MILAN november 28th/29th 2014 Linguaggio condiviso Scenario: Guest deve confermare la data prima di continuare con la prenotazione
  • 18. MILAN november 28th/29th 2014 Linguaggio condiviso WTF!?! Scenario: Guest deve confermare la data prima di continuare con la prenotazione
  • 19. MILAN november 28th/29th 2014 Linguaggio condiviso Scenario: Il giocatore deve confermare la data prima di continuare con la prenotazione
  • 20. MILAN november 28th/29th 2014 Business value
  • 21. MILAN november 28th/29th 2014 delivering Business value
  • 23. MILAN november 28th/29th 2014 Come Discussione Obiettivo FFeFeaeatuaturteuresress Specifiche Eseguibili Specifiche Eseguibili EEsseemmppi i Specifiche Esempi Eseguibili
  • 24. MILAN november 28th/29th 2014 Obiettivo (SMART)
  • 25. MILAN november 28th/29th 2014 Obiettivo “Voglio aumentare il fatturato del 5% entro fine anno ricevendo più prenotazioni”
  • 26. MILAN november 28th/29th 2014 Features Gherkin
  • 27. MILAN november 28th/29th 2014 Features Gli strumenti che permettono di raggiungere l’obiettivo
  • 28. MILAN november 28th/29th 2014 Esempi Gherkin
  • 29. MILAN november 28th/29th 2014 Esempi Descrive come l’utente utilizza la feature
  • 30. MILAN november 28th/29th 2014 Specifiche eseguibili Behat - PHPSpec
  • 31. MILAN november 28th/29th 2014 Specifiche eseguibili Scenario: Prenotazione con email non valida! Dato che un giocatore ha scelto di prenotare un campo per "domani"! Quando completa la prenotazione con una mail non valida! Allora visualizza che deve inserire una mail valida! !! /**! * @Given /^che un ospite ha scelto di prenotare un campo per "domani"$/! */! public function haSceltoDiPrenotarePerIl($bookingDate = null){…}
  • 33. MILAN november 28th/29th 2014 Obiettivo Per avere un vantaggio competitivo rispetto ai miei concorrenti Voglio avere un sistema di prenotazione online Che permetta ai miei clienti di prenotare da computer o smartphone
  • 34. MILAN november 28th/29th 2014 Features Feature: Prenotazione campo Per rendere più semplice e aumentare il numero delle prenotazioni ricevute Come giocatore Voglio poter prenotare online un campo
  • 35. MILAN november 28th/29th 2014 Esempi Scenario: Visualizzazione dei campi disponibili Scenario: Prenotazione di un campo Scenario: Mail di conferma della prenotazione Scenario: Prenotazione ricorrente ....
  • 36. MILAN november 28th/29th 2014 Esempi Scenario: Visualizzazione dei campi disponibili! Quando l'utente autenticato visita la pagina dei campi! Allora può vedere i campi divisi per sport
  • 37. MILAN november 28th/29th 2014 Esempi Autenticato!?! Scenario: Visualizzazione dei campi disponibili! Quando l'utente autenticato visita la pagina dei campi! Allora può vedere i campi divisi per sport
  • 38. MILAN november 28th/29th 2014 Esempi -Q: “Ma l’utente quindi è un utente registrato?” Scenario: Visualizzazione dei campi disponibili! - A: “Si” - Q: “Perché?” - A: “Perché così lo posso rintracciare” - Q: “Ma, non basta il numero di telefono?” Quando l'utente autenticato visita la pagina dei campi! Allora può vedere i campi divisi per sport -A: “Beh, si” Autenticato!?!
  • 39. MILAN november 28th/29th 2014 Esempi Scenario: Visualizzazione dei campi disponibili! Quando l'utente autenticato il giocatore visita la pagina dei campi! Allora può vedere i campi divisi per sport
  • 40. MILAN november 28th/29th 2014 Esempi Scenario: Visualizzazione dei campi disponibili! Quando il giocatore visita la pagina dei campi! Allora può vedere i campi divisi per sport —- spreco
  • 41. MILAN november 28th/29th 2014 Esempi Scenario: Prenotazione ricorrente! Quando l’admin sceglie un campo! E seleziona il prossimo martedì! E seleziona la data di fine ripetizione tra 4 martedì! E la ripetizione "settimanale"! E completa la prenotazione! Allora ha prenotato quel campo per i prossimi 4 martedì
  • 42. MILAN november 28th/29th 2014 Esempi Scenario: Prenotazione ricorrente! Quando l’admin sceglie un campo! E seleziona il prossimo martedì! E seleziona la data di fine ripetizione tra 4 martedì! E la ripetizione "settimanale"! E completa la prenotazione! Allora ha prenotato quel campo per i prossimi 4 martedì se non è disponibile!?!
  • 43. MILAN november 28th/29th 2014 Esempi - Q: “cosa succede?” - A: “Salviamo solo le valide” - Q: “E delle altre come tieni traccia?” - A: “Inviami un elenco di quelle Scenario: Prenotazione ricorrente! l’admin sovrapposte” Quando sceglie un campo! E seleziona il prossimo martedì! E seleziona la data di fine ripetizione tra 4 martedì! E la ripetizione "settimanale"! E completa la prenotazione! Allora ha prenotato quel disponibile!?! campo per i prossimi 4 martedì non è se
  • 44. MILAN november 28th/29th 2014 Esempi Scenario: Prenotazione ricorrente sovrapposta! Dato che il giocatore ha completato una prenotazione! Quando l'admin crea una prenotazione ricorrente che si sovrappone a quella esistente! Allora ha prenotato quel campo solo per le giornate disponibili! E riceve un riepilogo delle prenotazioni sovrapposte
  • 45. MILAN november 28th/29th 2014 Esempi ++ conoscenza del dominio Scenario: Prenotazione ricorrente sovrapposta! Dato che il giocatore ha completato una prenotazione! Quando l'admin crea una prenotazione ricorrente che si sovrappone a quella esistente! Allora ha prenotato quel campo solo per le giornate disponibili! E riceve un riepilogo delle prenotazioni sovrapposte
  • 46. MILAN november 28th/29th 2014 Specifiche eseguibili Scenari espressivi - Outside in - Page Object pattern
  • 47. MILAN november 28th/29th 2014 Scenari espressivi Scenario: Prenotazione! Quando un giocatore visita la pagina dei campi! E ne sceglie uno! E seleziona il giorno dalla select "booking_day"! E seleziona il mese dalla select "booking_month"! E seleziona l'anno dalla select "booking_year"! ...
  • 48. MILAN november 28th/29th 2014 Scenari espressivi Scenario: Prenotazione! Quando un giocatore visita la pagina dei campi! E ne sceglie uno! E seleziona il giorno dalla select "booking_day"! E seleziona il mese dalla select "booking_month"! E seleziona l'anno dalla select "booking_year"! ...
  • 49. MILAN november 28th/29th 2014 Scenari espressivi Scenario: Prenotazione! Quando un giocatore visita la pagina dei campi! E ne sceglie uno! E seleziona la data! ...
  • 50. MILAN november 28th/29th 2014 Scenari espressivi Scenario: Prenotazione con email non valida! ! Quando un giocatore visita la pagina dei campi! E ne sceglie uno! E seleziona la data! E completa la prenotazione con una mail non valida! Allora visualizza che deve inserire una mail valida
  • 51. MILAN november 28th/29th 2014 Scenari espressivi Scenario: Prenotazione con email non valida! ! Quando un giocatore visita la pagina dei campi! E ne sceglie uno! E seleziona la data! E completa la prenotazione con una mail non valida! Allora visualizza che deve inserire una mail valida
  • 52. MILAN november 28th/29th 2014 Scenari espressivi Background:! Quando un giocatore visita la pagina dei campi! E ne sceglie uno! E seleziona la data! ! Scenario: Prenotazione con email non valida! E completa la prenotazione con una mail non valida! Allora visualizza che deve inserire una mail valida
  • 53. MILAN november 28th/29th 2014 Codice espressivo /**! * @Given /^completa la prenotazione con una mail non valida$/! */! public function completaLaPrenotazioneConUnaMailNonValida()! {!! $page = $this->mink->getSession()->getPage();! ! ! $this->player = $this->createPlayer();! ! $this->player->email = 'fooinvalidemail';! ! $page->fillField('firstName', $this->player->firstName);! ! $page->fillField('lastName', $this->player->lastName);! ! $page->fillField('email', $this->player->email);! ! $page->fillField('phone', $this->player->phoneNumber);! ! ! $page->pressButton('book');! }
  • 54. MILAN november 28th/29th 2014 Codice espressivo /**! * @Given /^completa la prenotazione con una mail non valida$/! */! public function completaLaPrenotazioneConUnaMailNonValida()! {!! $page = $this->mink->getSession()->getPage();! ! ! $this->player = $this->createPlayer();! ! $this->player->email = 'fooinvalidemail';! ! $page->fillField('firstName', $this->player->firstName);! ! $page->fillField('lastName', $this->player->lastName);! ! $page->fillField('email', $this->player->email);! ! $page->fillField('phone', $this->player->phoneNumber);! ! ! $page->pressButton('book');! }
  • 55. MILAN november 28th/29th 2014 Codice espressivo /**! * @Given /^completa la prenotazione con una mail non valida$/! */! public function completaLaPrenotazioneConUnaMailNonValida()! {!! $bookingPage = $this->getBookingPage();! ! ! $this->player = $this->createPlayer();! ! $this->player->email = 'fooinvalidemail';! ! $this->bookingPage->book($this->player);! }
  • 56. MILAN november 28th/29th 2014 class BookingPage ! {! ! public function book($player)! ! {! ! ! $this->page->fillField('firstName', $player->firstName);! ! $this->page->fillField('lastName', $player->lastName);! ! $this->page->fillField('email', $player->email);! ! $this->page->fillField('phone', $player->phoneNumber);! ! ! $this->page->pressButton('book');! }! } Codice espressivo
  • 57. MILAN november 28th/29th 2014 Outside in 1 2 3 5 4 phpspec Behat 6 1 - Discussione di uno scenario 2 - Step rosso 3 - Spec rossa 4 - Implementazione 7 5 - Refactoring 6 - Step verde 7 - Refactoring
  • 58. MILAN november 28th/29th 2014 Cosa abbiamo imparato
  • 59. MILAN november 28th/29th 2014 Comunicazione Migliore verso il cliente
  • 60. MILAN november 28th/29th 2014 Comunicazione Migliore nel team
  • 61. MILAN november 28th/29th 2014 Comprendi la funzionalità tramite esempi
  • 62. MILAN november 28th/29th 2014 Non sviluppare oggi quello che puoi sviluppare domani
  • 63. MILAN november 28th/29th 2014 Fai emergere problematiche impreviste
  • 64. MILAN november 28th/29th 2014 Non dare niente per scontato
  • 65. MILAN november 28th/29th 2014 Documentazione
  • 66. MILAN november 28th/29th 2014 Comprensibile anche per non tecnici
  • 67. MILAN november 28th/29th 2014 Compilabile Non obsoleta
  • 68. MILAN november 28th/29th 2014 Ostacoli
  • 69. MILAN november 28th/29th 2014 Cliente non partecipa
  • 70. MILAN november 28th/29th 2014 È già tutto deciso
  • 71. MILAN november 28th/29th 2014 Se lo sai descrivere l’hai capito
  • 73. MILAN november 28th/29th 2014 https://joind.in/12837
  • 74. MILAN november 28th/29th 2014 Risorse • http://www.ideato.it/tag/bdd! • Bdd in Action: Behavior-driven Development for the Whole Software Lifecycle di John Ferguson Smart! • Specification by Example: How Successful Teams Deliver the Right Software di Gojko Adzic! • The RSpec Book: Behaviour Driven Development di Dave Astels, Bryan Helmkamp, Dan North, Zac David Chelimsky