SlideShare une entreprise Scribd logo
1  sur  12
TDD Outside-In
CODING DOJO DU 24 NOVEMBRE 2015
Sponsors
Fusion
du
Coding Dojo
et du
Software Craftsmanship
http://www.meetup.com/fr/Software-Craftsmanship-Lyon/
Evènements à venir
 01/12: CARA Lyon
“SAFe vu par des "clients" certifiés Scaled Agile Academy”
 07/12: Software Craftsmanship Lyon
“Event Storming sur un vrai projet”
 http://www.lyontechhub.org/
TDD Classique
« Chicago school »
• Le TDD enseigné par Kent
Beck, Uncle Bob…
• Le TDD généralement mis
en œuvre dans les kata
• Concepts associés :
• Baby steps
• Design émergent (Refactoring)
• Utilise peu de Mock
TDD
RED
GREENREFACTOR
A
D
B C
class ClassAShould
{
do_something()…
do_something_else()…
do_this_other_thing()…
do…
do…
do…
}
TDD Outside-in
« London school »
• Réflexion sur les
responsabilités en amonts
• Approche « Mockist »
• Le design se fait dans le
« Red »
• Part toujours de l’exterieur
vers l’interieur
TDD
(Outside-in)
RED
GREEN
REFACTOR
A
C
B A
D
DB
UT
A
B
B
A
C
IMD
B
C’
B’
UT
C’
UT
IT
AT
Crédit : Sandro MANCUSO
@sandromancuso
Acceptance
Test
TDD
Ecrire un T.U
en échec
Le faire
passer
Refactoriser
Considérer un test
en échec
N itérations
Bank Kata
 Application bancaire simple :
 Déposer sur un compte
 Retirer d’un compte
 Imprimer un relevé de banque dans la console
 Critère d’acceptation :
Le relevé doit avoir le format suivant :
DATE | AMOUNT | BALANCE
10/04/2014 | 500.00 | 1400.00
02/04/2014 | -100.00 | 900.00
01/04/2014 | 1000.00 | 1000.00
 Commencer par un test d’acceptation
Account Service
public class AccountService {
public void deposit(int amount);
public void withdraw(int amount);
public void printStatement();
}
Proposed acceptance test starting point;
@RunWith(MockitoJUntiRunner.class)
public class PrintStatementFeature {
@Mock Console console;
@Test public void
print_statement_containing_transactions_in_reverse_chronological_order() {
AccountService accountService = new AccountService();
accountService.deposit(1000);
accountService.withdraw(100);
accountService.deposit(500);
accountService.printStatement();
InOrder inOrder = inOrder(console);
inOrder.verify(console).printLine("DATE | AMOUNT | BALANCE");
inOrder.verify(console).printLine("10/04/2014 | 500.00 | 1400.00");
inOrder.verify(console).printLine("02/04/2014 | -100.00 | 900.00");
inOrder.verify(console).printLine("01/04/2014 | 1000.00 | 1000.00");
}
}

Contenu connexe

En vedette

Décès par valvulopathie attribuables au mediator
Décès par valvulopathie attribuables au mediatorDécès par valvulopathie attribuables au mediator
Décès par valvulopathie attribuables au mediatorAgnès Fournier
 
Analytics in Learning and Knowledge - George Siemens
Analytics in Learning and Knowledge - George SiemensAnalytics in Learning and Knowledge - George Siemens
Analytics in Learning and Knowledge - George SiemensOpenKnowledge srl
 
The Top 5 Reasons to Use a Learning Management System (small business edition)
The Top 5 Reasons to Use a Learning Management System (small business edition)The Top 5 Reasons to Use a Learning Management System (small business edition)
The Top 5 Reasons to Use a Learning Management System (small business edition)Infopro Learning, Inc.
 
Property key terms you may not know
Property key terms you may not knowProperty key terms you may not know
Property key terms you may not knowChelsea Aston
 
Liderando a transformação digital
Liderando a transformação digital  Liderando a transformação digital
Liderando a transformação digital Thoughtworks
 
Continuous Deployment Strategies
Continuous Deployment StrategiesContinuous Deployment Strategies
Continuous Deployment StrategiesThoughtworks
 

En vedette (9)

Décès par valvulopathie attribuables au mediator
Décès par valvulopathie attribuables au mediatorDécès par valvulopathie attribuables au mediator
Décès par valvulopathie attribuables au mediator
 
Analytics in Learning and Knowledge - George Siemens
Analytics in Learning and Knowledge - George SiemensAnalytics in Learning and Knowledge - George Siemens
Analytics in Learning and Knowledge - George Siemens
 
The Top 5 Reasons to Use a Learning Management System (small business edition)
The Top 5 Reasons to Use a Learning Management System (small business edition)The Top 5 Reasons to Use a Learning Management System (small business edition)
The Top 5 Reasons to Use a Learning Management System (small business edition)
 
cours
courscours
cours
 
Creating a Culture of Learning in the New Year
Creating a Culture of Learning in the New YearCreating a Culture of Learning in the New Year
Creating a Culture of Learning in the New Year
 
Property key terms you may not know
Property key terms you may not knowProperty key terms you may not know
Property key terms you may not know
 
Code retreat
Code retreatCode retreat
Code retreat
 
Liderando a transformação digital
Liderando a transformação digital  Liderando a transformação digital
Liderando a transformação digital
 
Continuous Deployment Strategies
Continuous Deployment StrategiesContinuous Deployment Strategies
Continuous Deployment Strategies
 

Similaire à TDD outside in - Coding Dojo Lyon

Les craft.wo.men Confiné.e.s - Agile en Seine 2021
Les craft.wo.men Confiné.e.s - Agile en Seine 2021Les craft.wo.men Confiné.e.s - Agile en Seine 2021
Les craft.wo.men Confiné.e.s - Agile en Seine 2021Agile En Seine
 
Agile Tour 2012 Paris - Nouveaux Outils Agile MS
Agile Tour 2012 Paris - Nouveaux Outils Agile MS Agile Tour 2012 Paris - Nouveaux Outils Agile MS
Agile Tour 2012 Paris - Nouveaux Outils Agile MS Cédric Leblond
 
Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012
Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012
Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012Chipway
 
Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...
Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...
Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...Scaleway
 
Mockito - Design + tests par Brice Duteil
Mockito - Design + tests par Brice DuteilMockito - Design + tests par Brice Duteil
Mockito - Design + tests par Brice DuteilNormandy JUG
 
meetup devops aix-marseille 27/10/2022
meetup devops aix-marseille 27/10/2022meetup devops aix-marseille 27/10/2022
meetup devops aix-marseille 27/10/2022Frederic Leger
 
Tech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobilesTech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobilesMichael Laguerre
 
MWCP21 - Introduction GitHub et SharePoint Framework
MWCP21 - Introduction GitHub et SharePoint FrameworkMWCP21 - Introduction GitHub et SharePoint Framework
MWCP21 - Introduction GitHub et SharePoint FrameworkLaurent Sittler
 
Dev ops - Contiuous delivery
Dev ops - Contiuous deliveryDev ops - Contiuous delivery
Dev ops - Contiuous deliveryPatrice Ferlet
 
lebiklab_cr971_fablab_prez_2.pdf
lebiklab_cr971_fablab_prez_2.pdflebiklab_cr971_fablab_prez_2.pdf
lebiklab_cr971_fablab_prez_2.pdfowatte1
 
Surmonter les anti-patrons culturels nuisant à DevOps
Surmonter les anti-patrons culturels nuisant à DevOpsSurmonter les anti-patrons culturels nuisant à DevOps
Surmonter les anti-patrons culturels nuisant à DevOpsAgile Montréal
 
20131024 qualité de code et sonar - mug lyon
20131024   qualité de code et sonar - mug lyon20131024   qualité de code et sonar - mug lyon
20131024 qualité de code et sonar - mug lyonClement Bouillier
 
Agile Tour 2010 - Mise en place d'un projet agile
Agile Tour 2010 - Mise en place d'un projet agileAgile Tour 2010 - Mise en place d'un projet agile
Agile Tour 2010 - Mise en place d'un projet agileLaurent Deséchalliers
 
AT2010 Mise place d'un projet Agile
AT2010 Mise place d'un projet AgileAT2010 Mise place d'un projet Agile
AT2010 Mise place d'un projet AgileNormandy JUG
 
SalonBI 2012
SalonBI 2012SalonBI 2012
SalonBI 2012agileDSS
 
Fabien Bezagu : Présentation XP et DDD
Fabien Bezagu : Présentation XP et DDDFabien Bezagu : Présentation XP et DDD
Fabien Bezagu : Présentation XP et DDDagiletourbordeaux
 
Keynote drupagora 2015 7
Keynote drupagora 2015 7Keynote drupagora 2015 7
Keynote drupagora 2015 7Core-Techs
 
Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013
Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013
Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013Xavier NOPRE
 
Maquette numérique BIM pour la collaboration en conception/construction. Prat...
Maquette numérique BIM pour la collaboration en conception/construction. Prat...Maquette numérique BIM pour la collaboration en conception/construction. Prat...
Maquette numérique BIM pour la collaboration en conception/construction. Prat...Sylvain Kubicki
 
Le Rapid Prototyping, ça marche !
Le Rapid Prototyping, ça marche !Le Rapid Prototyping, ça marche !
Le Rapid Prototyping, ça marche !Catherine Verfaillie
 

Similaire à TDD outside in - Coding Dojo Lyon (20)

Les craft.wo.men Confiné.e.s - Agile en Seine 2021
Les craft.wo.men Confiné.e.s - Agile en Seine 2021Les craft.wo.men Confiné.e.s - Agile en Seine 2021
Les craft.wo.men Confiné.e.s - Agile en Seine 2021
 
Agile Tour 2012 Paris - Nouveaux Outils Agile MS
Agile Tour 2012 Paris - Nouveaux Outils Agile MS Agile Tour 2012 Paris - Nouveaux Outils Agile MS
Agile Tour 2012 Paris - Nouveaux Outils Agile MS
 
Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012
Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012
Bonnes pratiques-drupal-dans-cahier-des-charges conference-dc-lyon-2012
 
Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...
Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...
Des bancs de l’école à la réalité en entreprise, retour d’expérience sur...
 
Mockito - Design + tests par Brice Duteil
Mockito - Design + tests par Brice DuteilMockito - Design + tests par Brice Duteil
Mockito - Design + tests par Brice Duteil
 
meetup devops aix-marseille 27/10/2022
meetup devops aix-marseille 27/10/2022meetup devops aix-marseille 27/10/2022
meetup devops aix-marseille 27/10/2022
 
Tech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobilesTech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobiles
 
MWCP21 - Introduction GitHub et SharePoint Framework
MWCP21 - Introduction GitHub et SharePoint FrameworkMWCP21 - Introduction GitHub et SharePoint Framework
MWCP21 - Introduction GitHub et SharePoint Framework
 
Dev ops - Contiuous delivery
Dev ops - Contiuous deliveryDev ops - Contiuous delivery
Dev ops - Contiuous delivery
 
lebiklab_cr971_fablab_prez_2.pdf
lebiklab_cr971_fablab_prez_2.pdflebiklab_cr971_fablab_prez_2.pdf
lebiklab_cr971_fablab_prez_2.pdf
 
Surmonter les anti-patrons culturels nuisant à DevOps
Surmonter les anti-patrons culturels nuisant à DevOpsSurmonter les anti-patrons culturels nuisant à DevOps
Surmonter les anti-patrons culturels nuisant à DevOps
 
20131024 qualité de code et sonar - mug lyon
20131024   qualité de code et sonar - mug lyon20131024   qualité de code et sonar - mug lyon
20131024 qualité de code et sonar - mug lyon
 
Agile Tour 2010 - Mise en place d'un projet agile
Agile Tour 2010 - Mise en place d'un projet agileAgile Tour 2010 - Mise en place d'un projet agile
Agile Tour 2010 - Mise en place d'un projet agile
 
AT2010 Mise place d'un projet Agile
AT2010 Mise place d'un projet AgileAT2010 Mise place d'un projet Agile
AT2010 Mise place d'un projet Agile
 
SalonBI 2012
SalonBI 2012SalonBI 2012
SalonBI 2012
 
Fabien Bezagu : Présentation XP et DDD
Fabien Bezagu : Présentation XP et DDDFabien Bezagu : Présentation XP et DDD
Fabien Bezagu : Présentation XP et DDD
 
Keynote drupagora 2015 7
Keynote drupagora 2015 7Keynote drupagora 2015 7
Keynote drupagora 2015 7
 
Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013
Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013
Mix-IT 2013 - Agilistes : n'oubliez pas la technique - mix-it 2013
 
Maquette numérique BIM pour la collaboration en conception/construction. Prat...
Maquette numérique BIM pour la collaboration en conception/construction. Prat...Maquette numérique BIM pour la collaboration en conception/construction. Prat...
Maquette numérique BIM pour la collaboration en conception/construction. Prat...
 
Le Rapid Prototyping, ça marche !
Le Rapid Prototyping, ça marche !Le Rapid Prototyping, ça marche !
Le Rapid Prototyping, ça marche !
 

Plus de florentpellet

Split my monolith - Devoxx
Split my monolith - DevoxxSplit my monolith - Devoxx
Split my monolith - Devoxxflorentpellet
 
Comment faire un mur végétal chez soi ?
Comment faire un mur végétal chez soi ?Comment faire un mur végétal chez soi ?
Comment faire un mur végétal chez soi ?florentpellet
 
Global Day of Coderetreat - Lyon 2015
Global Day of Coderetreat - Lyon 2015Global Day of Coderetreat - Lyon 2015
Global Day of Coderetreat - Lyon 2015florentpellet
 
CARA Coding Dojo - Outils de tests
CARA Coding Dojo - Outils de testsCARA Coding Dojo - Outils de tests
CARA Coding Dojo - Outils de testsflorentpellet
 
CARA Coding dojo - Golden Master
CARA Coding dojo - Golden MasterCARA Coding dojo - Golden Master
CARA Coding dojo - Golden Masterflorentpellet
 
CARA Coding Dojo - SOLID
CARA Coding Dojo - SOLIDCARA Coding Dojo - SOLID
CARA Coding Dojo - SOLIDflorentpellet
 
HumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du tout
HumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du toutHumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du tout
HumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du toutflorentpellet
 
CARA Coding Dojo TDD Palindrome (décembre 2014)
CARA Coding Dojo TDD Palindrome (décembre 2014)CARA Coding Dojo TDD Palindrome (décembre 2014)
CARA Coding Dojo TDD Palindrome (décembre 2014)florentpellet
 
GWAB Lyon - Legacy code atelier
GWAB Lyon - Legacy code atelierGWAB Lyon - Legacy code atelier
GWAB Lyon - Legacy code atelierflorentpellet
 
Single Page Application: Enrichissez l'expérience utilisateur
Single Page Application: Enrichissez l'expérience utilisateurSingle Page Application: Enrichissez l'expérience utilisateur
Single Page Application: Enrichissez l'expérience utilisateurflorentpellet
 

Plus de florentpellet (14)

Split my monolith - Devoxx
Split my monolith - DevoxxSplit my monolith - Devoxx
Split my monolith - Devoxx
 
Comment faire un mur végétal chez soi ?
Comment faire un mur végétal chez soi ?Comment faire un mur végétal chez soi ?
Comment faire un mur végétal chez soi ?
 
Lyon Tech Hub
Lyon Tech HubLyon Tech Hub
Lyon Tech Hub
 
Global Day of Coderetreat - Lyon 2015
Global Day of Coderetreat - Lyon 2015Global Day of Coderetreat - Lyon 2015
Global Day of Coderetreat - Lyon 2015
 
201506 mug intro
201506 mug intro201506 mug intro
201506 mug intro
 
Event storming
Event stormingEvent storming
Event storming
 
CARA Coding Dojo - Outils de tests
CARA Coding Dojo - Outils de testsCARA Coding Dojo - Outils de tests
CARA Coding Dojo - Outils de tests
 
CARA Coding dojo - Golden Master
CARA Coding dojo - Golden MasterCARA Coding dojo - Golden Master
CARA Coding dojo - Golden Master
 
CARA Coding Dojo - SOLID
CARA Coding Dojo - SOLIDCARA Coding Dojo - SOLID
CARA Coding Dojo - SOLID
 
HumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du tout
HumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du toutHumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du tout
HumanTalk - Commentaires, je t'aime un peu, beaucoup, à la folie, pas du tout
 
CARA Coding Dojo TDD Palindrome (décembre 2014)
CARA Coding Dojo TDD Palindrome (décembre 2014)CARA Coding Dojo TDD Palindrome (décembre 2014)
CARA Coding Dojo TDD Palindrome (décembre 2014)
 
GWAB Lyon - Legacy code atelier
GWAB Lyon - Legacy code atelierGWAB Lyon - Legacy code atelier
GWAB Lyon - Legacy code atelier
 
Crafting workshop
Crafting workshopCrafting workshop
Crafting workshop
 
Single Page Application: Enrichissez l'expérience utilisateur
Single Page Application: Enrichissez l'expérience utilisateurSingle Page Application: Enrichissez l'expérience utilisateur
Single Page Application: Enrichissez l'expérience utilisateur
 

TDD outside in - Coding Dojo Lyon

  • 1. TDD Outside-In CODING DOJO DU 24 NOVEMBRE 2015
  • 3. Fusion du Coding Dojo et du Software Craftsmanship http://www.meetup.com/fr/Software-Craftsmanship-Lyon/
  • 4. Evènements à venir  01/12: CARA Lyon “SAFe vu par des "clients" certifiés Scaled Agile Academy”  07/12: Software Craftsmanship Lyon “Event Storming sur un vrai projet”  http://www.lyontechhub.org/
  • 5. TDD Classique « Chicago school » • Le TDD enseigné par Kent Beck, Uncle Bob… • Le TDD généralement mis en œuvre dans les kata • Concepts associés : • Baby steps • Design émergent (Refactoring) • Utilise peu de Mock TDD RED GREENREFACTOR
  • 7. TDD Outside-in « London school » • Réflexion sur les responsabilités en amonts • Approche « Mockist » • Le design se fait dans le « Red » • Part toujours de l’exterieur vers l’interieur TDD (Outside-in) RED GREEN REFACTOR
  • 9. Acceptance Test TDD Ecrire un T.U en échec Le faire passer Refactoriser Considérer un test en échec N itérations
  • 10. Bank Kata  Application bancaire simple :  Déposer sur un compte  Retirer d’un compte  Imprimer un relevé de banque dans la console  Critère d’acceptation : Le relevé doit avoir le format suivant : DATE | AMOUNT | BALANCE 10/04/2014 | 500.00 | 1400.00 02/04/2014 | -100.00 | 900.00 01/04/2014 | 1000.00 | 1000.00  Commencer par un test d’acceptation
  • 11. Account Service public class AccountService { public void deposit(int amount); public void withdraw(int amount); public void printStatement(); }
  • 12. Proposed acceptance test starting point; @RunWith(MockitoJUntiRunner.class) public class PrintStatementFeature { @Mock Console console; @Test public void print_statement_containing_transactions_in_reverse_chronological_order() { AccountService accountService = new AccountService(); accountService.deposit(1000); accountService.withdraw(100); accountService.deposit(500); accountService.printStatement(); InOrder inOrder = inOrder(console); inOrder.verify(console).printLine("DATE | AMOUNT | BALANCE"); inOrder.verify(console).printLine("10/04/2014 | 500.00 | 1400.00"); inOrder.verify(console).printLine("02/04/2014 | -100.00 | 900.00"); inOrder.verify(console).printLine("01/04/2014 | 1000.00 | 1000.00"); } }

Notes de l'éditeur

  1. AT : Acceptance Test. UT : Unit Test. IT : Integration Test,