SlideShare a Scribd company logo
Test Driven


u           Development
                        andaid!


                  f
                 Gettin gP
        Rowan Merewood
Software Eng. / Team Lead
                 Ibuildings
WHO AM I?

Software Engineer &
Technical Team Lead
at Ibuildings UK

  I want to write good code
      and earn a living


   @rowan_m
                      m
Not ?
WHO AM I?




s
               i-am-not-a
             Cconsultant
            well-maybe-a-little
Not ?
WHO AM I?




s
             i-am-not
            selling-a
               book
Not ?
WHO AM I?




s
             i-am-not
            a-slave-to
            one=method
THE GOOD




                    @
Clean code, smart devs
  Latest technology
 Building your career

Elitist / Intimidating?



              DIFFERENT SITUATIONS
THE BAD




                     g
   Disgusting code
   Devs don't care
   Career dead-end

Changes break the app.
  Always bug-fixing


             DIFFERENT SITUATIONS
THE UGLY




                    c
 Good tests are hard
Writing tests takes time
     Time is money

 You're not an expert
        (yet...)


              DIFFERENT SITUATIONS
WHAT IS TDD?


1.Decide what you want to do
2.Write a test to show it working
3.Run the test and watch it fail
4.Write just enough code to pass the test
5.Re-run the test (and test suite)
6.Refactor (refine/improve)
7.Re-run tests
8.Repeat
WHAT IS TDD?


simplify
                  RED




H                GREEN


               REFACTOR
WHY IS THIS HARD?




l
 Do you know what
     you want

      before

    you code it?
WHY IS THIS HARD?




l   Does your client
      know what
      they want?

            Ever?
Train yourself to think like a scientist




1.Hypothesis
2.Repeatable Experiment
3.Conclusions
                             ]
ninja
  Train yourself to think like a scientist




                                  ]
            Kata
1.Hypothesis terally: "form")
  ( 型 or 形 , li
2.Repeatable movements
       A set of Experiment
3.Conclusionsain and again
    you repeat ag
                          ctly.
    un til can do it perfe



                                  Ninja weapon
!
DAVE THOMAS

 co-author of
The Pragmatic
 Programmer

                      Code Kata
                http://code
                            kata.pragpro
                                        g.co   m/
ROY OSHEROVE - TDD Kata
              http://osherove.com/tdd-kata-1/



      Create a simple String calculator
  with a method int Add(string numbers)


 The method can take 0, 1 or 2 numbers,
        and will return their sum
  (for an empty string it will return 0)
      for example “” or “1” or “1,2”
.
ROY OSHEROVE - TDD Kata




                     demo
Now you're an expert...


                    warning

Do not assume you can
just start to do this
in your project            D
DON'T BE A HERO


Introduce tests all at once...

●
    You will miss your deadline
●
    Your tests will not be maintained
●
    Your team will hate you
DIFFERENT APPROACHES


      Force tests
     on your client

    Make your client
     want the tests   L
FORCING TESTS




to your estimates.

Do not compromise
your principles.
                     L
Add a fixed percentage
SELLING TESTS




in creating tests.

Make the tests
a deliverable.
                       L
Use tests to define 'done'.

Involve the client
SELLING TESTS




Involve the client
in creating tests.

Make the tests
a deliverable.
                       L
Use tests to define 'done'.
                     Fitnesse Framework
                     http://fitnesse.org/
SELLING TESTS




Involve the client
in creating tests.

Make the tests
a deliverable.
                        L
Use tests to define 'done'.
                      Fitnesse Framework
                      http://fitnesse.org/


                           Selenium
                     http://seleniumhq.org/
DON'T BELIEVE THE HYPE


Make sure you don't over-promise.

Make sure you have the
infrastructure and skills

NO SILVER BULLETS
v
     INFRASTRUCTURE




1.Unit Testing
2.Acceptance Testing
3.Automated Deployment
4.Continuous Integration
5.Issue Tracking
Unit/Acceptanc
provides the tec
1.Unit Testing
                v
     INFRASTRUCTURE



                e testing
                hnical base


2.Acceptance Testing
3.Automated Deployment
4.Continuous Integration
5.Issue Tracking
Unit/
    Au s          v
      INFRASTRUCTURE



                   e testing
         Acceptanc eployment
            ate t d
        tomthe d echnical base
 provide a quick test env.
1.Unitows
    all Testing
2.Acceptance Testing
3.Automated Deployment
4.Continuous Integration
5.Issue Tracking
Unit/
    Au s    ate t dv
      INFRASTRUCTURE



                    e testing
         Acceptanc eployment
        tomthe d echnical rbasen
 provide ntinuouckIte
       Co s a qui
1.Unitow
        makes pr
                  s    eg atio
                     ntst env.
    all Testing ogress visible
2.Acceptance Testing
3.Automated Deployment
4.Continuous Integration
5.Issue Tracking
INFRASTRUCTURE




  Unit/
    Au s    ate t d
       Co s a qui
                  s v
                    e testing
         Acceptanc eployment
        tomthe d echnical rbasen
 provide ntinuouckIte
                        eg atio
                     ntst env.
                       ingviallows
1.UnitowIssue Traress sible
    all Testing og ck
        makes pr
2.Acceptance rting on TDD
            repo Testing
3.Automated Deployment
4.Continuous Integration
5.Issue Tracking
REPORTING


1.Code Coverage
2.Branch Coverage
3.Bug Origin:
  - tested code
  - untested code
4.Test/Dev Time:
  - per feature
  - per story
REPORTING

                                        c
                    Only trac k a metri
1.Code Coverage              is useful
                       if it
2.Branch Coverage              urages th
                                         e
                    and enco
3.Bug Origin:                behaviour
                                       !
                      right
  - tested code
  - untested code
4.Test/Dev Time:
  - per feature
  - per story
SKILLS & THE TEAM


               Owners not heroes

                Prepared to fail

              Honest & Disciplined
TDD DOES NOT
CREATE GOOD




a
    CODE

               Wait...
               What ?
TDD DOES NOT
CREATE GOOD    good plan




a
    CODE       good dev
               good code

               bad plan
               bad dev
               bad code
DISASTER RECOVERY
DISASTER RECOVERY



  Untestable code?

 Isolate and contain
         -or-
Create a testable API
DISASTER RECOVERY


   Running late?

    Drop features
         -or-
 Test the happy path
         -or-
    Test core only
DISASTER RECOVERY



   Broken build?

    Fix the test
        -or-
  Disable the test
   (or delete it)
DISASTER RECOVERY



  Team doesn't care

Use incentives/games
        -or-
  Find another job
   You 're worth it !
V                        QUESTIONS?

                          @rowan_m


              i n/3218
        joind.
 ttp://
h
                         thank-you

More Related Content

PPT
Test Driven Development Part 1
PDF
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
PPTX
TDD - Test Driven Development
KEY
TDD refresher
PDF
TDD vs. ATDD - What, Why, Which, When & Where
PDF
Introduction to TDD (Test Driven development) - Ahmed Shreef
PPTX
Test Driven Development (TDD) Preso 360|Flex 2010
PPTX
Agile and ATDD the perfect couple
Test Driven Development Part 1
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
TDD - Test Driven Development
TDD refresher
TDD vs. ATDD - What, Why, Which, When & Where
Introduction to TDD (Test Driven development) - Ahmed Shreef
Test Driven Development (TDD) Preso 360|Flex 2010
Agile and ATDD the perfect couple

What's hot (20)

PDF
TDD Flow: The Mantra in Action
PPTX
TDD with RSpec
PPTX
TDD - Agile
ODP
TDD - Test Driven Development
PDF
TDD CrashCourse Part2: TDD
PPTX
Test driven development(tdd)
PPT
TDD (Test Driven Design)
PDF
A Not-So-Serious Introduction to Test Driven Development (TDD)
PDF
An Introduction to Test Driven Development
PPTX
Tdd com Java
PDF
TDD and Simple Design Workshop - Session 1 - March 2019
PDF
Tdd practices
PPT
Test Driven Development
PDF
Atdd half day_new_1_up
PPTX
TDD = bra design?
PPT
Test Driven Development
ODP
Tdd in php a brief example
ZIP
Test Driven Development
TDD Flow: The Mantra in Action
TDD with RSpec
TDD - Agile
TDD - Test Driven Development
TDD CrashCourse Part2: TDD
Test driven development(tdd)
TDD (Test Driven Design)
A Not-So-Serious Introduction to Test Driven Development (TDD)
An Introduction to Test Driven Development
Tdd com Java
TDD and Simple Design Workshop - Session 1 - March 2019
Tdd practices
Test Driven Development
Atdd half day_new_1_up
TDD = bra design?
Test Driven Development
Tdd in php a brief example
Test Driven Development
Ad

Viewers also liked (17)

ODP
My app is secure... I think
PDF
Sensible scaling
PDF
Of Gaps, Fillers and Empty Spaces… Fronteers2015 closing keynote
PDF
Protect your users with Circuit breakers
PPTX
Designing irresistible apis
PPTX
Introducing Azure DocumentDB - NoSQL, No Problem
PPTX
DNS for Developers - NDC Oslo 2016
PDF
Living With Legacy Code
PDF
Getting Browsers to Improve the Security of Your Webapp
PDF
Microservices Minus the Hype: How to Build and Why
PDF
The Evolution and Future of Content Publishing
PPTX
DNS for Developers - ConFoo Montreal
PPTX
Get more than a cache back! - ConFoo Montreal
PDF
Securing MicroServices - ConFoo 2017
PPTX
Microservices
PDF
reveal.js 3.0.0
PDF
The Soul in The Machine - Developing for Humans
My app is secure... I think
Sensible scaling
Of Gaps, Fillers and Empty Spaces… Fronteers2015 closing keynote
Protect your users with Circuit breakers
Designing irresistible apis
Introducing Azure DocumentDB - NoSQL, No Problem
DNS for Developers - NDC Oslo 2016
Living With Legacy Code
Getting Browsers to Improve the Security of Your Webapp
Microservices Minus the Hype: How to Build and Why
The Evolution and Future of Content Publishing
DNS for Developers - ConFoo Montreal
Get more than a cache back! - ConFoo Montreal
Securing MicroServices - ConFoo 2017
Microservices
reveal.js 3.0.0
The Soul in The Machine - Developing for Humans
Ad

Similar to TDD and Getting Paid (20)

PDF
Test Driven Development
PDF
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
PPTX
Unit Testing and TDD 2017
PPTX
TDD Best Practices
KEY
Testing smells
PDF
Why Your Selenium Tests are so Dang Brittle, and What to Do About It
PPTX
Tdd is not about testing (C++ version)
PDF
Test Drive Development
PDF
iOS Test-Driven Development
PPT
Test Presentation
PDF
Should you be your own judge?
PPTX
Development without Testers: Myth or Real Option? (ConfeT&QA conference)
PDF
PPT
Test Driven
PPTX
Test Driven Development with Laravel
PDF
TDD reloaded - JUGTAA 24 Ottobre 2012
PPTX
Development without Testers: Myth or Real Option?
PPT
Simple testable code
PPTX
Test Driven Development
PPTX
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Test Driven Development
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Unit Testing and TDD 2017
TDD Best Practices
Testing smells
Why Your Selenium Tests are so Dang Brittle, and What to Do About It
Tdd is not about testing (C++ version)
Test Drive Development
iOS Test-Driven Development
Test Presentation
Should you be your own judge?
Development without Testers: Myth or Real Option? (ConfeT&QA conference)
Test Driven
Test Driven Development with Laravel
TDD reloaded - JUGTAA 24 Ottobre 2012
Development without Testers: Myth or Real Option?
Simple testable code
Test Driven Development
Getting started with Test Driven Development - Ferdous Mahmud Shaon

More from Rowan Merewood (6)

PDF
Estimation or, "How to Dig your Grave"
PDF
A Dependency Injection Primer
PDF
Practical Applications of Zend_Acl
PDF
Algorithm, Review, Sorting
ODP
Tools and Talent
ODP
State Machines to State of the Art
Estimation or, "How to Dig your Grave"
A Dependency Injection Primer
Practical Applications of Zend_Acl
Algorithm, Review, Sorting
Tools and Talent
State Machines to State of the Art

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Modernizing your data center with Dell and AMD
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
KodekX | Application Modernization Development
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Artificial Intelligence
NewMind AI Monthly Chronicles - July 2025
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Modernizing your data center with Dell and AMD
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
“AI and Expert System Decision Support & Business Intelligence Systems”

TDD and Getting Paid

  • 1. Test Driven u Development andaid! f Gettin gP Rowan Merewood Software Eng. / Team Lead Ibuildings
  • 2. WHO AM I? Software Engineer & Technical Team Lead at Ibuildings UK I want to write good code and earn a living @rowan_m m
  • 3. Not ? WHO AM I? s i-am-not-a Cconsultant well-maybe-a-little
  • 4. Not ? WHO AM I? s i-am-not selling-a book
  • 5. Not ? WHO AM I? s i-am-not a-slave-to one=method
  • 6. THE GOOD @ Clean code, smart devs Latest technology Building your career Elitist / Intimidating? DIFFERENT SITUATIONS
  • 7. THE BAD g Disgusting code Devs don't care Career dead-end Changes break the app. Always bug-fixing DIFFERENT SITUATIONS
  • 8. THE UGLY c Good tests are hard Writing tests takes time Time is money You're not an expert (yet...) DIFFERENT SITUATIONS
  • 9. WHAT IS TDD? 1.Decide what you want to do 2.Write a test to show it working 3.Run the test and watch it fail 4.Write just enough code to pass the test 5.Re-run the test (and test suite) 6.Refactor (refine/improve) 7.Re-run tests 8.Repeat
  • 10. WHAT IS TDD? simplify RED H GREEN REFACTOR
  • 11. WHY IS THIS HARD? l Do you know what you want before you code it?
  • 12. WHY IS THIS HARD? l Does your client know what they want? Ever?
  • 13. Train yourself to think like a scientist 1.Hypothesis 2.Repeatable Experiment 3.Conclusions ]
  • 14. ninja Train yourself to think like a scientist ] Kata 1.Hypothesis terally: "form") ( 型 or 形 , li 2.Repeatable movements A set of Experiment 3.Conclusionsain and again you repeat ag ctly. un til can do it perfe Ninja weapon
  • 15. ! DAVE THOMAS co-author of The Pragmatic Programmer Code Kata http://code kata.pragpro g.co m/
  • 16. ROY OSHEROVE - TDD Kata http://osherove.com/tdd-kata-1/ Create a simple String calculator with a method int Add(string numbers) The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example “” or “1” or “1,2”
  • 17. . ROY OSHEROVE - TDD Kata demo
  • 18. Now you're an expert... warning Do not assume you can just start to do this in your project D
  • 19. DON'T BE A HERO Introduce tests all at once... ● You will miss your deadline ● Your tests will not be maintained ● Your team will hate you
  • 20. DIFFERENT APPROACHES Force tests on your client Make your client want the tests L
  • 21. FORCING TESTS to your estimates. Do not compromise your principles. L Add a fixed percentage
  • 22. SELLING TESTS in creating tests. Make the tests a deliverable. L Use tests to define 'done'. Involve the client
  • 23. SELLING TESTS Involve the client in creating tests. Make the tests a deliverable. L Use tests to define 'done'. Fitnesse Framework http://fitnesse.org/
  • 24. SELLING TESTS Involve the client in creating tests. Make the tests a deliverable. L Use tests to define 'done'. Fitnesse Framework http://fitnesse.org/ Selenium http://seleniumhq.org/
  • 25. DON'T BELIEVE THE HYPE Make sure you don't over-promise. Make sure you have the infrastructure and skills NO SILVER BULLETS
  • 26. v INFRASTRUCTURE 1.Unit Testing 2.Acceptance Testing 3.Automated Deployment 4.Continuous Integration 5.Issue Tracking
  • 27. Unit/Acceptanc provides the tec 1.Unit Testing v INFRASTRUCTURE e testing hnical base 2.Acceptance Testing 3.Automated Deployment 4.Continuous Integration 5.Issue Tracking
  • 28. Unit/ Au s v INFRASTRUCTURE e testing Acceptanc eployment ate t d tomthe d echnical base provide a quick test env. 1.Unitows all Testing 2.Acceptance Testing 3.Automated Deployment 4.Continuous Integration 5.Issue Tracking
  • 29. Unit/ Au s ate t dv INFRASTRUCTURE e testing Acceptanc eployment tomthe d echnical rbasen provide ntinuouckIte Co s a qui 1.Unitow makes pr s eg atio ntst env. all Testing ogress visible 2.Acceptance Testing 3.Automated Deployment 4.Continuous Integration 5.Issue Tracking
  • 30. INFRASTRUCTURE Unit/ Au s ate t d Co s a qui s v e testing Acceptanc eployment tomthe d echnical rbasen provide ntinuouckIte eg atio ntst env. ingviallows 1.UnitowIssue Traress sible all Testing og ck makes pr 2.Acceptance rting on TDD repo Testing 3.Automated Deployment 4.Continuous Integration 5.Issue Tracking
  • 31. REPORTING 1.Code Coverage 2.Branch Coverage 3.Bug Origin: - tested code - untested code 4.Test/Dev Time: - per feature - per story
  • 32. REPORTING c Only trac k a metri 1.Code Coverage is useful if it 2.Branch Coverage urages th e and enco 3.Bug Origin: behaviour ! right - tested code - untested code 4.Test/Dev Time: - per feature - per story
  • 33. SKILLS & THE TEAM Owners not heroes Prepared to fail Honest & Disciplined
  • 34. TDD DOES NOT CREATE GOOD a CODE Wait... What ?
  • 35. TDD DOES NOT CREATE GOOD good plan a CODE good dev good code bad plan bad dev bad code
  • 37. DISASTER RECOVERY Untestable code? Isolate and contain -or- Create a testable API
  • 38. DISASTER RECOVERY Running late? Drop features -or- Test the happy path -or- Test core only
  • 39. DISASTER RECOVERY Broken build? Fix the test -or- Disable the test (or delete it)
  • 40. DISASTER RECOVERY Team doesn't care Use incentives/games -or- Find another job You 're worth it !
  • 41. V QUESTIONS? @rowan_m i n/3218 joind. ttp:// h thank-you