SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
AMIR BARYLKO

                     WHY TDD?



                       WPG RUBY UG 2011


Amir Barylko - TDD                        MavenThought Inc.
INTRO
                     Why projects fail?
                      Reality Check
                     No more excuses
                       Why TDD?



Amir Barylko - TDD                        MavenThought Inc.
WHY PROJECTS FAIL?

  • Delivering          late or over budget
  • Delivering          the wrong thing
  • Unstable           in production
  • Costly           to maintain


Amir Barylko - TDD                            MavenThought Inc.
REALITY CHECK

  • It is impossible to gather all the requirements at
     the beginning of a project.
  • Whatever   requirements you do gather are
     guaranteed to change.
  • There will always be more to do than time and
     money will allow.

Amir Barylko - TDD                             MavenThought Inc.
NO MORE EXCUSES

  • It   works on my computer!          • We need a satellite
                                         connection in order to
  • Itwas like that when I got           run it!
    here!
                                        • We can’t reproduce the
  • The  previous developer              error!
    didn’t know XXXX!
                                        • We   can’t test that!


Amir Barylko - TDD Workshop PRDC 2011                        MavenThought Inc.
WHY TDD?

  • Prove       that your code          • Regression   tests as
    works                                byproduct
  • Avoid waste                         • Makechanges with
    (debugging)                          condence
  • Increment           code quality    • Bring
                                              back the joy of
                                         coding!
  • Better       design
Amir Barylko - TDD Workshop PRDC 2011                     MavenThought Inc.
APPLYING TDD
                          Iteration 0 .. N
                        Quality as a Driver
                      Red - Green - Refactor




Amir Barylko - TDD                             MavenThought Inc.
ITERATION 0

  • Flush    out architecture.

  • Setup Testing    harness for TDD and BDD.

  • Setup     continuous integration.

  • Setup     scripts to build, deploy, etc.

  • Setup     visual communication tools.


Amir Barylko - TDD                              MavenThought Inc.
ITERATION 1.. N
  • Start    by Story Planning

     • Pair   programming (switching often)   Every day!

     • Daily    Scrum

  • End    with Retrospective




Amir Barylko - TDD                                    MavenThought Inc.
QUALITY AS A DRIVER
                                Red
                                BDD

                                Red




     Refactor        Refactor   TDD   Green   Green




Amir Barylko - TDD                              MavenThought Inc.
RED

  •Write             a test that fails
  •Relax, is           ok if it compiles




Amir Barylko - TDD                         MavenThought Inc.
GREEN

  • Try     to make the test pass
  • Do      a simple solution
  • Use      default values (not throwing exceptions)
  • Don’t        worry if the code “smells”


Amir Barylko - TDD                               MavenThought Inc.
REFACTOR

  • Avoid        repeating code
  • Avoid        hardcoding dependencies
  • Avoid “write        only” code
  • Refactor         with confidence!
  • Run      all tests if possible
Amir Barylko - TDD                         MavenThought Inc.
DEMO
                     MediaLibrary
                        Add
                       Top10




Amir Barylko - TDD                  MavenThought Inc.
SUMMARY
                        Limits
                       Benets
                      Challenges
                      Adoption



Amir Barylko - TDD                 MavenThought Inc.
LIMITS OF TDD

  • Unit    test

  • Integration      test

  • Acceptance        test




Amir Barylko - TDD                      MavenThought Inc.
BENEFITS

  • Let     the methodology drive
  • It   will save your bacon!
  • High       quality the whole way!
  • Very       few bugs!
  • Do      your duty as developer!
Amir Barylko - TDD                      MavenThought Inc.
CHALLENGES

  • Very     different from conventional testing
  • Many      developers find it complex to learn at first
  • Hard      to start without a Mentor
  • Management           buy in
  • Difficult         to keep under deadline pressure
  • Beware           of code coverage!
Amir Barylko - TDD                                     MavenThought Inc.
ADOPTION

  • Find     Mentor/Couch/Trainer
  • Small     iterations
  • Have      metrics ready (velocity, etc)
  • Do     whatever works for you
  • Find     out which tools will benefit you
  • Automate,          automate, automate!
Amir Barylko - TDD                             MavenThought Inc.
QUESTIONS?




Amir Barylko - TDD                MavenThought Inc.

Weitere ähnliche Inhalte

Was ist angesagt?

The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practices
Bill Buchan
 
YEG-Agile-planning
YEG-Agile-planningYEG-Agile-planning
YEG-Agile-planning
Amir Barylko
 
Nathan Parsons
Nathan ParsonsNathan Parsons
Nathan Parsons
Nate Parsons
 

Was ist angesagt? (16)

The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practices
 
Testing in agile
Testing in agileTesting in agile
Testing in agile
 
The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...
The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...
The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...
 
Flexing your Agile Muscle - Agile Technical Concepts Explained
Flexing your Agile Muscle - Agile Technical Concepts ExplainedFlexing your Agile Muscle - Agile Technical Concepts Explained
Flexing your Agile Muscle - Agile Technical Concepts Explained
 
agile-planning
agile-planningagile-planning
agile-planning
 
Paving the Way for Agile Engineering Practices
Paving the Way for Agile Engineering PracticesPaving the Way for Agile Engineering Practices
Paving the Way for Agile Engineering Practices
 
Inside Behavior Driven Development
Inside Behavior Driven DevelopmentInside Behavior Driven Development
Inside Behavior Driven Development
 
Test drive on driven development process
Test drive on driven development processTest drive on driven development process
Test drive on driven development process
 
YEG-Agile-planning
YEG-Agile-planningYEG-Agile-planning
YEG-Agile-planning
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Adapting Agility: Getting your Agile Transformation Unstuck
Adapting Agility: Getting your Agile Transformation UnstuckAdapting Agility: Getting your Agile Transformation Unstuck
Adapting Agility: Getting your Agile Transformation Unstuck
 
Agile planning
Agile planningAgile planning
Agile planning
 
Surviving SOA - delivering (somewhat) continuously on a hostile planet
Surviving SOA - delivering (somewhat) continuously on a hostile planetSurviving SOA - delivering (somewhat) continuously on a hostile planet
Surviving SOA - delivering (somewhat) continuously on a hostile planet
 
Growing Manual Testers into Automators
Growing Manual Testers into AutomatorsGrowing Manual Testers into Automators
Growing Manual Testers into Automators
 
Nathan Parsons
Nathan ParsonsNathan Parsons
Nathan Parsons
 
Tdd
TddTdd
Tdd
 

Andere mochten auch (6)

Edward Scissorhands Analysis
Edward Scissorhands Analysis Edward Scissorhands Analysis
Edward Scissorhands Analysis
 
경영혁신2
경영혁신2경영혁신2
경영혁신2
 
Financial planning strategy 1 powerpoint ppt slides.
Financial planning strategy 1 powerpoint ppt slides.Financial planning strategy 1 powerpoint ppt slides.
Financial planning strategy 1 powerpoint ppt slides.
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep dive
 
No estimates
No estimatesNo estimates
No estimates
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 

Ähnlich wie why-tdd

prdc10-tdd-patterns
prdc10-tdd-patternsprdc10-tdd-patterns
prdc10-tdd-patterns
Amir Barylko
 
Jvm-bdd-quality-driven
Jvm-bdd-quality-drivenJvm-bdd-quality-driven
Jvm-bdd-quality-driven
Amir Barylko
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
Amir Barylko
 
prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-world
Amir Barylko
 
Testing and beyond at startups
Testing and beyond at startupsTesting and beyond at startups
Testing and beyond at startups
Mona Soni
 

Ähnlich wie why-tdd (20)

prdc10-tdd-patterns
prdc10-tdd-patternsprdc10-tdd-patterns
prdc10-tdd-patterns
 
Jvm-bdd-quality-driven
Jvm-bdd-quality-drivenJvm-bdd-quality-driven
Jvm-bdd-quality-driven
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 
prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-world
 
Testing and beyond at startups
Testing and beyond at startupsTesting and beyond at startups
Testing and beyond at startups
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
 
Leandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & RightLeandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & Right
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with Laravel
 
Real Developers Don't Need Unit Tests
Real Developers Don't Need Unit TestsReal Developers Don't Need Unit Tests
Real Developers Don't Need Unit Tests
 
What to Avoid When Writing Unit Tests - Robert Fornal
What to Avoid When Writing Unit Tests - Robert FornalWhat to Avoid When Writing Unit Tests - Robert Fornal
What to Avoid When Writing Unit Tests - Robert Fornal
 
Agile Australia 2016 - Rescuing Legacy Software from Impending Doom
Agile Australia 2016 - Rescuing Legacy Software from Impending DoomAgile Australia 2016 - Rescuing Legacy Software from Impending Doom
Agile Australia 2016 - Rescuing Legacy Software from Impending Doom
 
Metrics-driven Continuous Delivery
Metrics-driven Continuous DeliveryMetrics-driven Continuous Delivery
Metrics-driven Continuous Delivery
 
Completely Test-Driven
Completely Test-DrivenCompletely Test-Driven
Completely Test-Driven
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
Jdojo@Gbg Introduction
Jdojo@Gbg IntroductionJdojo@Gbg Introduction
Jdojo@Gbg Introduction
 
Quality in Project Management
Quality in Project ManagementQuality in Project Management
Quality in Project Management
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsJavascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
 
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CD
 
CPL12-Agile-planning
CPL12-Agile-planningCPL12-Agile-planning
CPL12-Agile-planning
 

Mehr von Amir Barylko

Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
Amir Barylko
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
Amir Barylko
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & Coffeescript
Amir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
Amir Barylko
 

Mehr von Amir Barylko (20)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting training
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomeness
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6
 
Productive teams
Productive teamsProductive teams
Productive teams
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other side
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivity
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Refactoring
RefactoringRefactoring
Refactoring
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilities
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & Coffeescript
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescript
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patterns
 

KĂźrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

KĂźrzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

why-tdd

  • 1. AMIR BARYLKO WHY TDD? WPG RUBY UG 2011 Amir Barylko - TDD MavenThought Inc.
  • 2. INTRO Why projects fail? Reality Check No more excuses Why TDD? Amir Barylko - TDD MavenThought Inc.
  • 3. WHY PROJECTS FAIL? • Delivering late or over budget • Delivering the wrong thing • Unstable in production • Costly to maintain Amir Barylko - TDD MavenThought Inc.
  • 4. REALITY CHECK • It is impossible to gather all the requirements at the beginning of a project. • Whatever requirements you do gather are guaranteed to change. • There will always be more to do than time and money will allow. Amir Barylko - TDD MavenThought Inc.
  • 5. NO MORE EXCUSES • It works on my computer! • We need a satellite connection in order to • Itwas like that when I got run it! here! • We can’t reproduce the • The previous developer error! didn’t know XXXX! • We can’t test that! Amir Barylko - TDD Workshop PRDC 2011 MavenThought Inc.
  • 6. WHY TDD? • Prove that your code • Regression tests as works byproduct • Avoid waste • Makechanges with (debugging) condence • Increment code quality • Bring back the joy of coding! • Better design Amir Barylko - TDD Workshop PRDC 2011 MavenThought Inc.
  • 7. APPLYING TDD Iteration 0 .. N Quality as a Driver Red - Green - Refactor Amir Barylko - TDD MavenThought Inc.
  • 8. ITERATION 0 • Flush out architecture. • Setup Testing harness for TDD and BDD. • Setup continuous integration. • Setup scripts to build, deploy, etc. • Setup visual communication tools. Amir Barylko - TDD MavenThought Inc.
  • 9. ITERATION 1.. N • Start by Story Planning • Pair programming (switching often) Every day! • Daily Scrum • End with Retrospective Amir Barylko - TDD MavenThought Inc.
  • 10. QUALITY AS A DRIVER Red BDD Red Refactor Refactor TDD Green Green Amir Barylko - TDD MavenThought Inc.
  • 11. RED •Write a test that fails •Relax, is ok if it compiles Amir Barylko - TDD MavenThought Inc.
  • 12. GREEN • Try to make the test pass • Do a simple solution • Use default values (not throwing exceptions) • Don’t worry if the code “smells” Amir Barylko - TDD MavenThought Inc.
  • 13. REFACTOR • Avoid repeating code • Avoid hardcoding dependencies • Avoid “write only” code • Refactor with condence! • Run all tests if possible Amir Barylko - TDD MavenThought Inc.
  • 14. DEMO MediaLibrary Add Top10 Amir Barylko - TDD MavenThought Inc.
  • 15. SUMMARY Limits Benets Challenges Adoption Amir Barylko - TDD MavenThought Inc.
  • 16. LIMITS OF TDD • Unit test • Integration test • Acceptance test Amir Barylko - TDD MavenThought Inc.
  • 17. BENEFITS • Let the methodology drive • It will save your bacon! • High quality the whole way! • Very few bugs! • Do your duty as developer! Amir Barylko - TDD MavenThought Inc.
  • 18. CHALLENGES • Very different from conventional testing • Many developers nd it complex to learn at rst • Hard to start without a Mentor • Management buy in • Difcult to keep under deadline pressure • Beware of code coverage! Amir Barylko - TDD MavenThought Inc.
  • 19. ADOPTION • Find Mentor/Couch/Trainer • Small iterations • Have metrics ready (velocity, etc) • Do whatever works for you • Find out which tools will benet you • Automate, automate, automate! Amir Barylko - TDD MavenThought Inc.
  • 20. QUESTIONS? Amir Barylko - TDD MavenThought Inc.