Jenga Debugging
Photo by Valery Fedotov on Unsplash
Have you ever played Jenga? It’s a child’s game, that’s still actually pretty enjoyable as an adult. It’s how some of us learned a few basics of engineering and physics before we could even sing the alphabet. I’m going to tell you about an unorthodox way of debugging applications that I’ve been perfecting for years that I call Jenga Debugging. By using this method for debugging I’ve saved countless hours I would’ve spent chasing red herrings and false leads and instead finding a fix that just works. It’s okay if this method doesn’t work for everyone, the diversity of minds is one of humanity’s greatest strengths! For anyone who — like me — often loses focus or has the mind wander, this method can turn that exact weakness into a strength.
The method is simple, yet unintuitive, but trust me it works.
First, learn the problematic functionality. Say aloud to yourself or your team member what your desired outcome is and reach a consensus. You can write it down if that helps, but you will need to be able to come back to it again and again for this method to work.
Second, determine what has been tried to solve the problem and what the outcome was. Repeat for each attempt made. Don’t forget to be kind! Write it down if you have to. Whiteboards or stickies — in the words of Tyler Joseph, “Some see a pen, I see a harpoon.”
This is the part of the method that gives Jenga Debugging its name: it’s step 3. You have a choice to either continue to iterate on the ideas already presented or come up with a new one. Step 3 assumes you brainstorm a new one the fly. Think of the problem as a Jenga tower and the wood blocks as the things you could try. In Jenga each player in the game must pull out a block from somewhere on the tower except the top and then place it on the top while not making any part of the tower fall down. Usually if you mess up the whole thing comes crashing down in a stressfully loud, yet satisfyingly dramatic collapse of wooden blocks. The trick to surviving to late game in Jenga is to remove only blocks which have the least amount of tension on them so if it’s removed then nothing shifts weight rapidly or drastically. With the analogy you want to come up with an idea, explore it for a few minutes and if it yields any new information that can help you more deeply understand the problem then continue following it for another few minutes. If it doesn’t yield helpful new information about either the problem or the solution, then you stop trying that solution and you return to the original problem.
Return to step 1. Re-state aloud the problem and the desired outcome. Skip then to step 3 and brainstorm another solution. Eventually one of the “Jenga blocks” will give way much easier than the rest did and you’ll find new information about either the problem or the solution coming very easily.
Here’s the DON’T DOS of this method:
Don’t spend an hour on just one idea, until you have performed step 3 at least 3 times — sometimes it will be over a dozen times. Consider several options and gather that critical information only trying those different options can give you. Eventually you will spend more time on one solution than the others and it will be that solution which seemed most likely to succeed based on the information you uncovered.Don’t lose sight of either the problem or the desired outcome! Sure it’s not useful to refuse to look at potential solutions — you have to pull a block on your turn or forfeit the game — but keep revisiting them after spending time examining a solution if it has so far failed to achieve progress.Avoid deep dives into breakpoint debugging. You will often use breakpoints, logs, printing to console, but if you’re spending more than a few minutes on it then ideally you’ve already discovered a loose Jenga block that’s likely to reveal more information or completely solve the problem.Don’t hijack the conversation and prevent your fellow debuggers from contributing. Jenga is playable solo, but it’s even more fun when played by others who understand the game! Seriously, different brains are some of your best resources when debugging. Allow others to form hypotheses and note them. This is also how you build confidence in others and form stronger working relationships and trust.
Let me know what you think of Jenga Debugging in the comments and if you too benefit from a similar approach or something totally different. I would love to hear what works for other types of minds. You all have greatness and potential within you.
Jenga Debugging was originally published in ngconf on Medium, where people are continuing the conversation by highlighting and responding to this story.