WTF TDD?
Jeremy Weiskotten
   Terrible Labs
WTF TDD?
@doctorzaius
The year was 1996...
Srsly.
So what changed?


• Open   source movement

• Agile, Lean, Scrum

• Extreme    Programming
EXTREME! PROGRAMMING!
        O/ LOL
• Shared   ownership

• Continuous    integration

• Sustainable   pace

• Pair   programming

• Test-Driven
 Development
 (TDD/BDD)
Red

 Green

Refactor
Refactoring

• Improving  the design of
  existing code (without
  changing its behavior)

• Make  a small change, run
  your tests.

• Ifit takes more than a day,
  you’re rewriting, not
  refactoring.
legacy_code/README


• “Legacy code” is code that
  doesn’t have tests.

• It’s
     always easier to test new
  code than to bring legacy
  code under test.
Stay loose.

• Loosely coupled objects are
 easier to test in isolation

• Dependency   injection,
 Strategy pattern

• “awkward
 collaborators” (Feathers)
Is TDD worth it?
ZOMG RESEARCH



• TDD   teams took 15-35% longer

• TDD   teams created 40-90% fewer bugs


        “If we control for defect rate, is TDD faster?”
        http://grokcode.com/439/test-driven-development-and-the-meaning-of-done/
We have the tools.
We have the talent.




                      Srsly.
Ruby Testing Frameworks

• Test::Unit

• RSpec

• MiniTest

• Shoulda

• TestRocket
 http://codebrawl.com/articles/contest-rundown-ruby-testing-libraries
Integration Testing

• watir

• webrat

• cucumber

• steak

• capybara

• capybara-webkit
Factories
                    because fixtures suck



• Factory   Girl

• Fabrication

• Machinist

• Sham

• Object    Daddy
Rails/ActiveRecord


• shoulda-matchers

• valid_attribute

• email-spec
Stubbin’ and Mockin’ and Fakin’

• mocha            • vcr

• FlexMock         • timecop

• rr               • faker, ffaker

• fakeweb          • bourne

• webmock          • Mock::Turtle

• faraday
Feedback, early & often

• spork

• autotest

• autospec

• ZenTest
Standards & Practices
• metric_fu              • reek

• flay                    • rcov

• flog                    • CoverMe

• roodi                  • SimpleCov

• rails_best_practices

• saikuro
We’re religious about testing.


• We   believe.

• We   argue about the details.

• Some     more than others!

• That’s   OK.
“I do not write tests for my code.”
WTF TDD?
Thanks for still being here!

More Related Content

PDF
Introduction to jest
PPTX
A tale of 3 databases
PDF
Can you TDD Rails?
PDF
Completely Test-Driven
PPT
Next generation frontend tooling
KEY
In-house web automation?
KEY
Freelancing and side-projects on Rails
PPTX
Introduction to TDD
Introduction to jest
A tale of 3 databases
Can you TDD Rails?
Completely Test-Driven
Next generation frontend tooling
In-house web automation?
Freelancing and side-projects on Rails
Introduction to TDD

What's hot (20)

PDF
JSFoo-2017 Takeaways
PDF
Rubyslava debugging with_pry
PDF
Conquering ORM with DataBoss
PPTX
Test-Driven Sitecore
PPTX
Real life unit testing tools and practices
PPT
Hacking on gems
PPTX
Thucydides - a brief review
PPTX
Production code without tests
PDF
Challenges of moving a java team to scala
PPTX
Automated Testing but like for PowerShell (April 2012)
PDF
Python to go
PDF
Riak at Posterous
PPTX
Power shell v3 session1
KEY
Introduction to atdd
PPTX
Day 8 - jRuby
KEY
Enterprise Strength Mobile JavaScript
PPTX
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
KEY
Week7
PDF
team++; making your team work better together
KEY
Contributing to rails
JSFoo-2017 Takeaways
Rubyslava debugging with_pry
Conquering ORM with DataBoss
Test-Driven Sitecore
Real life unit testing tools and practices
Hacking on gems
Thucydides - a brief review
Production code without tests
Challenges of moving a java team to scala
Automated Testing but like for PowerShell (April 2012)
Python to go
Riak at Posterous
Power shell v3 session1
Introduction to atdd
Day 8 - jRuby
Enterprise Strength Mobile JavaScript
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
Week7
team++; making your team work better together
Contributing to rails
Ad

Viewers also liked (7)

PPTX
Using the Twitter API
KEY
User Interface Trends09
PPT
Paisajes
PPT
Business & Company Resource Center Sgass May14 09
PPT
Haml, Sass and Compass for Sane Web Development
KEY
Grails at DMC Digital
Using the Twitter API
User Interface Trends09
Paisajes
Business & Company Resource Center Sgass May14 09
Haml, Sass and Compass for Sane Web Development
Grails at DMC Digital
Ad

Similar to WTF TDD? (20)

PDF
Rethinking Testing
PDF
PPTX
Rails automatic test driven development
PDF
WTF is TDD
KEY
Test Driven Development
PPTX
Testing Sap: Modern Methodology
PDF
Test and Behaviour Driven Development (TDD/BDD)
KEY
Best practices for writing good automated tests
PDF
Automated Testing with Ruby
PPTX
Regression Testing with Symfony
PDF
Rubyconf presentation
PDF
Intro to JavaScript Testing
KEY
Testing smells
PPT
Test Driven Development using QUnit
PPTX
TDD with RSpec
PDF
Introduction to-automated-testing
PDF
Introduction to Automated Testing
PPTX
Understanding TDD - theory, practice, techniques and tips.
ODP
Effective TDD - Less is more
Rethinking Testing
Rails automatic test driven development
WTF is TDD
Test Driven Development
Testing Sap: Modern Methodology
Test and Behaviour Driven Development (TDD/BDD)
Best practices for writing good automated tests
Automated Testing with Ruby
Regression Testing with Symfony
Rubyconf presentation
Intro to JavaScript Testing
Testing smells
Test Driven Development using QUnit
TDD with RSpec
Introduction to-automated-testing
Introduction to Automated Testing
Understanding TDD - theory, practice, techniques and tips.
Effective TDD - Less is more

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
STKI Israel Market Study 2025 version august
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Unlock new opportunities with location data.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
1 - Historical Antecedents, Social Consideration.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
O2C Customer Invoices to Receipt V15A.pptx
Developing a website for English-speaking practice to English as a foreign la...
STKI Israel Market Study 2025 version august
A comparative study of natural language inference in Swahili using monolingua...
Final SEM Unit 1 for mit wpu at pune .pptx
DP Operators-handbook-extract for the Mautical Institute
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
WOOl fibre morphology and structure.pdf for textiles
Getting started with AI Agents and Multi-Agent Systems
NewMind AI Weekly Chronicles – August ’25 Week III
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Benefits of Physical activity for teenagers.pptx
Enhancing emotion recognition model for a student engagement use case through...
Unlock new opportunities with location data.pdf
Assigned Numbers - 2025 - Bluetooth® Document

WTF TDD?

Editor's Notes

  • #2: \n
  • #3: I recently started Terrible Labs with Joe Lind. We’re a Rails, Node.js, and mobile development consultancy in Boston.\n
  • #4: I’m doctorzaius on Twitter.\n\nDr. Zaius is a character from Planet of the Apes. He had two contradictory titles: “Minister of Science” and “Chief Defender of the Faith”. It’s interesting how a scientific, rational mind can also form an irrational attachment to an idea, a tool, or a process. Zaius was afraid of new ideas. He was kind of a dick.\n\nI think Dr. Zaius was a doctor the same way Jerry Falwell is a doctor. I’m not actually a doctor either. I never even got a college degree. But if you want to give me an honorary degree, I would accept it and say really nice things about you whether they’re true or not.\n
  • #5: I got my first “real” job as a programmer in 1996 after high school, a few weeks before my 19th birthday.\n\nThings were different back then.\n\nInstead of user stories, we wrote - or more often we were given - big specifications with lots of signatures on them. These specs were rarely updated to reflect new knowledge, feature creep, or feature reduction.\n\nSoftware architects designed complex systems, often without ever writing a line of code to implement them. Sometimes they’re called “architecture astronauts”.\n\nInstead of writing unit tests, we had a QA department who wrote test plans based on the specs and clicked on a lot of stuff at the end of a long development cycle (sometimes months).\n\n
  • #6: It was a slow and expensive way to build software. I worked this way until around 2004. A lot of companies still work this way. Some of YOU might still work this way.\n
  • #7: \n
  • #8: Extreme programming is a stupid name for an awesome set of principles.\n\nShared ownership gives every developer the right to change others’ code. It also implies shared responsibility.\n\nContinuous integration means a shorter feedback cycle. You should know as soon as possible if your shit doesn’t work or if you broke something. The sooner you know, the cheaper it is to fix.\n\nA sustainable pace means we don’t work 16 hours a day and burn ourselves out. We do better work and are more valuable to our employers or clients when we have enough rest and spend time doing things other than programming.\n\nPair programming helps us focus and learn from each other.\n\nTDD helps us do these things. With a good set of tests, we can change other people’s code without breaking it as easily. We can easily and quickly run our automated tests when we integrate with other changes. We don’t spend as much time working on things that aren’t important.\n
  • #9: \n
  • #10: \n
  • #11: \n
  • #12: Because loosely coupled (single responsibility) objects are easier to test in isolation, when writing tests first the path of least resistance is a loosely coupled design. You don’t tend to write procedural code with TDD.\n
  • #13: \n
  • #14: \n
  • #15: \n
  • #16: Previous entries: context, matchy, bacon\n
  • #17: \n
  • #18: \n
  • #19: \n
  • #20: \n
  • #21: \n
  • #22: \n
  • #23: \n
  • #24: “I do not write tests for my code. I do not write very many comments. I change styles very frequently. And most of all, I shun the predominant styles of coding, because that would go against the very essence of experimentation. In short: all I do is muck around.”\n- Why the lucky stiff\n\nhttp://my.opera.com/adrnlnrsh/blog/show.dml/11402771\n
  • #25: \n
  • #26: \n