Tuesday, July 31, 2018

Test-Driven Development as a Mindset

For what I consider to be a long time, I've been trying to help people adopt test-driven development. It always seems more challenging than it should be.

I think I might finally have identified the fundamental impediment: I'm trying to teach people something that cannot be taught, because it is not really a skill.

There are skills requisite to the successful application of TDD.
  • You need to understand a certain amount about software design.
  • You need to be able to refactor with a certain degree of discipline.
  • You need to find a way to make old code work with the new way of doing things.

Those are not TDD, though; they aren't even part of TDD. They are already necessary to the success of any modern software product and they deliver value on their own. They are standalone skills that just happen to enable test-driven development.

TDD is a frame of mind. A test-driven developer thinks about software development in a fundamentally-different way from a non-test-driven developer. Getting a test that could fail for the right reasons to pass for the right reasons is not something you do as part of software development. It is software development.

The question then becomes, "What's the best way to change your mindset?"