Quantum Steps

Share this post

Test First vs Last: Introduction

read.ceilfors.com

Discover more from Quantum Steps

Optimise developer productivity and judgement through small yet impactful steps. Essays from experience and research straight to your inbox.
Continue reading
Sign in

Test First vs Last: Introduction

A psychological comparison of writing test first and last.

Wisen Tanasa
Jul 6, 2023
Share this post

Test First vs Last: Introduction

read.ceilfors.com
3
Share
Article voiceover
1×
0:00
-3:32
Audio playback is not supported on your browser. Please upgrade.

The two essays I've recently published on Test-Driven Development (TDD) prompt familiar questions:

  1. Why should I switch to writing tests first if I’m already writing tests last?

  2. Do you always do TDD, even in your startup?

This post introduces my experiment on publishing a series in this newsletter containing smaller, more digestible insights. If you have similar questions to the ones above, follow along. Hopefully, they’ll be answered at some point.

Thanks for reading Quantum Steps! Subscribe for free to receive new posts and support my work.

What is being compared?

What’s going to be compared in this series will be the reduced version of Test-Driven Development (TDD) and Test-Last Development (TLD). I’ll be focusing solely on the difference in the sequence of writing tests, despite TDD containing more principles. I’ve hinted previously that the sequence of steps matters more than you might think, as explained in Making a Nice Cup of TDD, and I plan to delve even deeper. Because of this focus, I’ve intentionally chosen not to name the series “TDD vs TLD”. Besides, these two acronyms are hard to distinguish with one letter difference.

Ultimately, we’ll be comparing writing tests first and tests last. We’ll assume that in both methodologies, engineers will have the discipline to refactor after.

What you should expect from this comparison will be less about the code, as that’s been covered very often. Rather, I’ll compare what’s happening in my mind - the psychological experience in practising these two techniques. This follows my previous theme of exploring our cognitive limits and the DevEx framework in my other essay, Why TDD Enhances Developer Productivity.

Having said that, you may wonder if my views are entirely objective or if there’s a preference for one technique over the other.

Will this series contain a bias towards TDD?

Short answer: Possibly.

However, in more depth, I attempt to be as objective as possible. I’m not really interested in siding in a certain technique, I’m more interested in understanding what to practice, when, and why, but inevitably I may conclude that one is better than the other.

I can be objective in this comparison because I have practised both writing test first and test last. Most TDD practitioners I know have practised writing tests last too before they learned about TDD, and that’s how they started. Writing test last was the default for me too.

I also coach teams to practice TDD. Therefore, I can see what engineers are noticing when they write tests last. When the emotion hits them hard, I can see it. They share a similar experience as when I practice writing tests last.

These aspects should hopefully maintain my objectivity throughout the series, so stay tuned!

Share this post

Test First vs Last: Introduction

read.ceilfors.com
3
Share
3 Comments
Share this discussion

Test First vs Last: Introduction

read.ceilfors.com
author
Wisen Tanasa
Jul 6Author

Apologies for those of you who are seeing 7 subscribe buttons at the bottom of your email. This is a bug from Substack. The buttons didn't appear in the browser but appeared in the emails 🤦🏻‍♂️

Expand full comment
Reply
Share
Roy Straub
Writes CodeCraftr
Jul 13

Thanks for the write-up, I like the angle you’re taking! Coincidentally I embarked on writing a series on this comparison as well, so I’m curious to see what aspects you’ll cover 😄

Expand full comment
Reply
Share
1 reply by Wisen Tanasa
1 more comment...
Top
New
Community

No posts

Ready for more?

© 2023 Wisen Tanasa
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing