Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You are here: Home / Programming / Maybe You Are Doing Too Much Test Driven Development

Maybe You Are Doing Too Much Test Driven Development

December 11, 2012 by Rob Bazinet 3 Comments

Tweet

I came across this StackOverflow post from 2008 where someone wanted to know when a developer can do too much testing. ?Simply brilliant summary by the father of test-driven development (TDD), Kent Beck:

I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris). If I don’t typically make a kind of mistake (like setting the wrong variables in a constructor), I don’t test for it. I do tend to make sense of test errors, so I’m extra careful when I have logic with complicated conditionals. When coding on a team, I modify my strategy to carefully test code that we, collectively, tend to get wrong.

Different people will have different testing strategies based on this philosophy, but that seems reasonable to me given the immature state of understanding of how tests can best fit into the inner loop of coding. Ten or twenty years from now we’ll likely have a more universal theory of which tests to write, which tests not to write, and how to tell the difference. In the meantime, experimentation seems in order.

I always find interesting to read so many blog posts about how to do TDD, including unit tests, integration tests, functional tests, factories, mocking and on and on. ?There are conferences dedicated to software quality and software craftsmanship where TDD is advocated as all-in and anything less is not doing the right thing.

Clients pay me to write code too and not tests. ?I write tests just enough to know the critical pieces of my system are working?.and continue to work. ?Developers could easily spend double their time writing completely tested systems and I’m not sure the customer gets 2X the value or ROI.

I think experimentation is certainly in order and see what best fits your situation. ?The biggest takeaway, step back and decide for yourself what’s the right amount of testing and don’t simply follow the pied pipers of TDD. ? Lots of great feedback from the others in response to the original question in that thread and great food for thought.

UPDATE: If you want to hear another developer’s perspective on TDD and using it as-needed, Marco Arment discusses how he uses testing in his very successful business on the latest Build and Analyze. ?Very timely to my post.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Related

Filed Under: Programming Tagged With: kent beck, tdd, tests

Care about your privacy? I do and use Fathom Analytics on this site.

Fathom Analytics

Recent Posts

  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur
  • RailsConf 2021 and the Future of Conferences
  • Fixing Out of Diskspace Errors on Amazon EC2

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Exactly this…. https://t.co/yWj7fZ01HR
    about 1 day ago
  • https://t.co/EmagdpLoNv "Introducing GitHub Copilot X · GitHub"
    about 2 days ago
  • RIP Gordon Moore: https://t.co/c5J9LaHrj8
    about 2 days ago
  • Our daughter works as a teaching assistant at a local K-8 public school. It’s become apparent that students today r… https://t.co/p2t912GVyc
    about 2 days ago
  • Working to wrap up my current consulting gig by mid-April. I will be looking for the next thing soon. If anyone has… https://t.co/sg3cSV9yqM
    about 3 days ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon