eph baum dot dev

← Back to blog

Test Tangential Development - TTD

Published on 02/11/2021 07:15 PM by Eph Baum

We have all heard the TDD Test-Driven Development. This is, of course, the Right Way™. I am certain that in the last decade or so I have heard TDD evangelized at least a couple times year during various conferences, meetups, podcast, talk tracks, etc.

Stop me if you’ve heard this one: “To demonstrate TDD, I’m going to create a [Blog, TODO App, API Endpoint, FizzBuzz] using TDD!”

This is all well and good if you’re building something you’re well familiar with or is dead simple. Sure, with FizzBuzz you know what to expect, it’s not deeply challenging. That’s why people will ask you to whiteboard it during a job interview (that’s a whole other topic of discussion though).

The problem with TDD is that it often seems to work best during certain optimal conditions:

Stray too far outside of optimal conditions and TDD feels like it’s just getting in your way.

Often in the engineering world you’re under resourced and flying by the seat of your pants. You don’t have an architect, business analyst, project manager, or anyone else available to provide you with bullet proof and extremely clear requirements. A common reality is that you are asked by someone in the business to do something to make a client happy. If you’re lucky this thing hasn’t already promised to the client with a timeline that is so woefully inaccurate as to possibly push the limits on your poker face when presented.

In a room filled with flames and smoke an oblivious little dog in a hat sits at a table next to a coffee cup. The caption reads "This Is Fine". Grabbed from memgenerator.net

This is fine.

Another common scenario might simply be trying to build a solution to overcome a difficult challenge of some kind. This could be something blocking critical functionality or a hard left an otherwise straight development path.

In these cases you are often doing an ugly form of rapid prototyping. Rapid prototyping, also known as the spaghetti method, is a process by which you try to make a thing using code very quickly so that you can test it and then either iterate or throw it away and start over depending on the results. (Please don’t @ me, I’m just trying to keep this stupidly simple)

The difficulty in TDD here is that you may have literally no idea what to start testing. The testing itself becomes a blocker to your progress as opposed to the almost magical way of validating your expectations.

This is where I recommend what I call TTD - Test Tangential Development. This is where you start by doing, drag your testing along with you until you reach the point that can fill out your tests and use them to wrap up your development.

This may look something like this:

Doing this iteratively lets you keep falling back into your tests and continue to validate your progress as you go. Eventually, however, like any journey, your destination becomes clearer, you’ll reach a point where you can let testing take the lead and drive.

I want to be absolutely clear: TDD is an extremely valuable tool and should be utilized. When it makes sense to so.

You just should’t let yourself become get caught up in idea that you must utilize TDD from start to finish in every project. Testing is extremely important, if it wasn’t we wouldn’t keep talking about it. Important or not, however, don’t let testing stand in the way of getting your work done. Instead, build rapport with testing, bring it along with you on your journey.

Find your TTD flow.

If you’re doing it this way, you’re fine. It works. <3

Written by Eph Baum

← Back to blog
  • 50 Stars - Puzzle Solver (of Little Renown)

    50 Stars - Puzzle Solver (of Little Renown)

    Join Eph Baum as they recount their journey through the Advent of Code 2023. For the first time, Eph completes all puzzles, leveraging resources like GPT-4 and Code Llama. Despite the challenges and time constraints, Eph not only stays on top of the puzzles but also lands on the top 1,000 leaderboard. Dive into this post to explore the role of generative AIs in problem-solving and the joy of coding puzzles. - GitHub Co-pilot

  • Don't Trust AI - An Advent of Code Tale

    Don't Trust AI - An Advent of Code Tale

    Join Eph Baum in 'Don't Trust AI - An Advent of Code Tale' as they navigate the Advent of Code 2023. Despite the December rush, Eph is determined to complete all puzzles. This post shares an intriguing incident where an AI-generated code line proves less than helpful. Eph's journey underscores the importance of verifying AI suggestions, especially when optimizing code. Dive in to explore the challenges and triumphs of coding puzzles, and the role of AI in this process. - GitHub CoPilot

  • Condoning Another Pi Day

    Condoning Another Pi Day

    Placeholder description for imported post from Ghost Blog

  • ANSI Terminal Colors

    ANSI Terminal Colors

    Placeholder description for imported post from Ghost Blog

  • WTF is Idiomatic

    WTF is Idiomatic

    Placeholder description for imported post from Ghost Blog

  • From Early Return in OOP to Control Flow in Elixir - A Transition Guide

    From Early Return in OOP to Control Flow in Elixir - A Transition Guide

    Placeholder description for imported post from Ghost Blog