What do writing and test-driven development have in common?

What do writing and test-driven development have in common?

This article was originally posted to my personal blog on 09/19/2023.

I'm watching a video from Nicholas Cole about writing headlines and it dawned on me; this is TDD for writing! Test-driven development is the concept of writing a test before writing code. The idea is that by writing a test first, you are setting the expectation for what the code should do. When you have a good test in place, it helps streamline the process of writing a function that fulfills the test. This is EXACTLY what headlines are for writers!

Headlines are the "North star" of the article

In the video, Nicholas said something that really stuck out to me: "The headline charts the path for what the content should be." It was at that moment that I made the connection between headlines and unit tests. Since the headline is the first thing a reader will see, the content MUST contain what the headline states as it is what the reader expects to get out of it. Just as incorrect code can never make a test pass, an article that doesn't provide what the headline promises will result in the reader feeling like they wasted their time. Going forward, I plan to try this approach out by spending time writing well-crafted headlines and THEN writing the body of the article.