Friday, August 3, 2018

My Pre-TDD Years

When I was initially exposed to test-driven development's precursor, test-first programming, I immediately sensed the value.

Yet I didn't take the leap, right away. It required a change in my mindset and in my habits. Those things were hard and thus deferred. So years passed with me saying to myself "I really should write the tests for this, first".

What broke me out of the rut was when a test engineer said "I really love your code."

"Oh? Why?" I asked.

The question was smugly rhetorical but the answer surprised me.

"It makes it really easy for me to write unit tests."

Those words hit me like a bolt of lightning.

It was easy for someone else to write my tests after the fact and (generally) without any conversation. How easy would it be for me when I'm already thinking about a problem?

It provided the motivation I needed to start writing tests first and I've done so ever since.

I think that "Aha!" moment was a critical point in my life and started me down the path I'm on, today.