mokacoding

unit and acceptance testing, automation, productivity

Working Backwards

Earlier this week, my son and I played with a Marvel Superheroes activity book. One of the activities was helping Drax find the right path to capture Nebula.

He took a natural approach to solve the puzzle. He picked the path closest to where he was sitting, tried it, and saw it wasn't the right one. He moved to the one next to it and saw it wasn't the right one either. He moved to the only one left and was pleased to see it was the correct one.

Animation on the path discovery starting from the start

My son "trial-and-errored" his way to the game's solution.

There's a faster way to do this, I told him. He could have started from Nebula and traveled the path backwards to find out the solution.

Animation on the path discovery starting from the end

When you know where you want to go, you can work your way backwards to where you need to start.

Starting with the end in mind makes it easier to define the milestones to get there and mitigates being overwhelmed by all the different options and opportunities. It's an effective way to plan; it helps to identify obstacles and stay focused.

Working backwards is so valuable that it's a core technique of one of the most successful companies in history: Amazon.

"We try to work backwards from the customer," wrote Ian McAllister, a former Amazon director, "rather than starting with an idea for a product and trying to bolt customers onto it."

An interesting tool from the working backwards toolbox is the mock press release, one introduced by Jeff Bezos himself, as Brad Stone narrates in The Everything Store. To pitch an idea, product managers issue an internal press release aimed at the customers for the product or feature they want to build. If the pitch is successful and the project moves into development, the press release is used as a guiding light to keep development focused. The team checks its progress and the shape the product is taking against the press release to ensure what they're building matches it. "This keeps product development focused on achieving the customer benefits and not building extraneous stuff that takes longer to build, takes resources to maintain, and doesn't provide real customer benefit."

There is research supporting working backwards' validity, too. Starting with the end in mind, visualizing the desired outcome and the benefits it would bring boost motivation and helps to stick with the plan, a 2017 study found. "When visualizing the endpoint, things seem clearer and more positive," explains study co-author William Hedgcock. "If you start at the present, you could go this way or that way — it can be more negative."

My son wasn't as impressed with my working backwards solution as I hoped he would be, but I hope I've been able to show you how powerful this technique actually is. So, next time you start planning something, take a moment to try working your way backwards from the outcome to identify the steps you need to get there.


Working backwards is at the foundation of my favorite software development practice: Test-Driven Development. In TDD, you write the test for the desired behavior first and use it to guide the software implementation. Starting from the test helps developers write only the necessary code and ensure their code works from the get-go.

If you want to know how to write code by working your backwards from at test for the desired behavior, check out my upcoming book Test-Driven Development in Swift with SwiftUI and Combine.

Want more of these posts?

Subscribe to receive new posts in your inbox.