Vässa kraven och förbättra samarbetet med hjälp av Behaviour Driven Development Anna Fallqvist Eriksson Kravhantering På Riktigt, 16 maj 2018
Anna Fallqvist Eriksson Agilista, Go See Talents linkedin.com/in/anfaer/ anna.fallqvist@goseetalents.com @goseetalents
Agenda Vad är BDD egentligen? Ett BDD-exempel Scenarios, acceptanskriterier, exempel, Given/When/Then Nästa BDD-exempel BDD - fördelar och utmaningar Komma igång
Behaviour Driven Development
Photo credit: Flickr. Vad är BDD?
GIVEN/WHEN/THEN
Vad är vad? Behaviour Driven Development Business Driven Development Test Driven Development Acceptance Test Driven Development Specification by Example
GIVEN WHEN THEN - ett exempel
The new service
Service X User story: - AS A - I WANT - SO THAT - GIVEN - WHEN - THEN - GIVEN - WHEN - THEN User story: - AS A - I WANT - SO THAT - GIVEN - WHEN -THEN
Service X AS A customer I WANT TO search for an e-invoice invoicer/creditor/company SO THAT I can sign up for e-invoice AS A customer I WANT TO sign up for e-invoices with my chosen companies SO THAT I don t have to pay the invoices manually AS A customer I WANT TO cancel an e-invoice agreement AS A customer I WANT TO view my e-invoice agreements SO THAT I know which ones I have AS A customer I WANT TO edit one of my e-invoice agreements SO THAT it s kept up to date with my current situation and my current wishes AS A customer I WANT TO view my upcoming e-invoices SO THAT I know which ones I need to approve AS A customer I WANT TO view my completed e-invoice payments SO THAT I can follow up on my transactions AS A customer I WANT TO cancel an upcoming e-invoice payment SO THAT the amount won t be withdrawn
Service X GIVEN xxx WHEN the customer performs an e-invoice search by giving the company name THEN an e-invoice search is performed GIVEN an e-invoice search is performed WHEN one or more matching results are found THEN the matching result(s) are presented in a list containing the following information: Company name, xxx, xxx AS A customer I WANT TO search for a e-invoice company SO THAT I can sign up for e-invoice GIVEN an e-invoice search is performed WHEN no matching results are found THEN xxx GIVEN an e-invoice search result is presented in a list WHEN the customer filters by choosing sector code(s)??? THEN xxx GIVEN the e-invoice search result is presented WHEN the customer chooses to view more information about the company/invoicer/creditor (?) THEN the following information is presented: Xxx, xxx, xxx GIVEN the e-invoice search result is presented WHEN the customer chooses one of the company/invoicer/creditor from the list AND requests to sign up for e-invoice with the particular company/invoicer/creditor THEN a mandate form is presented AND the customer is requested to fill in the mandate form AS A customer I WANT TO sign up for e-invoices with my chosen companies SO THAT I don t have to pay the invoices manually GIVEN the mandate form is presented WHEN the customer completes the form AND approves the terms and conditions for e-invoice THEN xxxx Controls??? AND the status of the e-invoice agreement is set to xxx GIVEN xxx WHEN the customer requests to read the terms and conditions for the e-invoice THEN the terms and conditions are presented as/in xxx
Scenario exempel - acceptanskriterie Hur vet vi att vi är klara med storyn?? När storyn är i produktion, hur vet vi att vi lyckats? Vad ska bli skillnaden? GIVEN som en förutsättning- passivt WHEN beteendet (vad ska systemet göra?) - aktivt THEN resultatet, vad är sant efteråt? - passivt GIVEN the trouble ticket has status Confirmed WHEN the operator requests to send the order THEN the trouble ticket status is set to Sent AND the order is placed in the queue to be sent
User story 1 Specificeras genom * Scenario User story VEM vill något, VAD vill denne och VARFÖR Får vara lite fluffig BEHOV eller PROBLEM Scenario, acceptanskriterie, exempel Explicit, otvetydig Är storyn testbar? Vilka förutsättningar ska vara sanna för att lösa problemet? Vilket är det förväntade beteendet? GIVEN/WHEN/THEN Prototyp etc
Nästa BDD-exempel
It shall be possible to follow the process of a specific trouble ticket on the web 5 why s AS AN operator I WANT the Reporter to be informed whenever there s an update in the trouble ticket he reported SO THAT he can keep himself informed and we can save time since he won t have to call us and ask
Tres amigos!
It shall be possible to follow the process of a specific trouble ticket on the web AS AN operator I WANT the Reporter to be informed whenever there s an update in the trouble ticket he reported SO THAT he can keep himself informed and we can save time since he won t have to call us and ask AS AN operator I WANT the Reporter to receive an email notification whenever there s an update in the trouble ticket he reported SO THAT he can keep himself informed and we can save time since he won t have to call us and ask
Photo cred: https://cucumber.io/blog/2015/12/08/example-mapping-introduction Example mapping
Structured Collaboration Workshop - by Anna Fallqvist Eriksson Prioritize Tres amigos Identify Clarify Structure Validate GIVEN WHEN THEN
Tres amigos!
Vilka frågor har vi? AS AN operator I WANT the Reporter to receive an email notification whenever there s an update in the trouble ticket he reported SO THAT he can keep himself informed and we can save time since he won t have to call us and ask Vart ska den skickas? Epostadressen måste finnas registrerad eller? När ska den skickas? Direkt? Vilka förändringar är det som triggar att epostmeddelandet ska skickas? Alla statusförändringar eller bara en del? Ska det lagras och visas någonstans att meddelandet skickats? Vad exakt ska meddelandet innehålla? Kan vi göra ett exempel? Hur ska det se ut? Layout? Vad kan gå fel? Etc etc
AC1: GIVEN there is an email address registered for the particular Reporter AND there s a trouble ticket registered for the particular Reporter AND the status of the trouble ticket is New WHEN the trouble ticket status is changed THEN an email notification is sent to the registered email address AS AN operator I WANT the Reporter to receive an email notification whenever there s an update in the trouble ticket he reported SO THAT he can keep himself informed and we can save time since he won t have to call us and ask AC2: GIVEN there is an email address registered for the particular Reporter AND there s a trouble ticket registered for the particular Reporter AND the status of the trouble ticket is Assigned WHEN the trouble ticket status is changed THEN an email notification is sent to the registered email address AC3: GIVEN there is no email address registered for the particular Reporter AND there s a trouble ticket registered for the particular Reporter WHEN the trouble ticket status is changed THEN message xxx is presented AC4: GIVEN the trouble ticket status has changed WHEN an email notification is sent to the registered email address THEN this is registered as an event on the trouble ticket, with the following information: Date/time, reporter email notification AC5: See attached file for email content and layout. Etc. etc...
Men räcker det här verkligen?
Man behöver inte ens nämna BDD
Förutsättningar Närvarande teammedlemmar Närvarande produktägare/kravställare Hög nivå av samarbete och kommunikation Tydliga prioriteringar Fokus Intresse Grym facilitering
Fördelar Färre missförstånd Delad förståelse Effektivt Delad dokumentation Roligt!
Takeaways! Inga stuprör arbeta tillsammans! Lämna inte över dokument lös problemen tillsammans Involvera verksamheten tidigt och genom hela processen Structured Collaboration Workshops Just in time Lös ett problem i taget Satsa på samarbetet först!
Kontaktinformation Anna Fallqvist Eriksson linkedin.com/in/anfaer/ anna.fallqvist@goseetalents.com @goseetalents Go See where you ll thrive. Stay when you find the right fit.