Blog

The Saff Squeeze

June 10, 2026

From time to time, we encounter bugs in the software systems that we work on. That’s part of the life as a software developer. Often, we don’t know the root cause of the defect. So, in order to uncover what is going on we typically start a debugging session.

However, when we take a step back and think about defects from a higher level, we can conclude that every bug in the system actually corresponds to a missing test in the code base. An alternative to this default behavior is using the Saff Squeeze technique. The goal of this technique is to find that missing test.

The Saff Squeeze is a way to find bugs, starting with a high-level end-to-end test and working towards a small, unambiguous test that clearly demonstrates the defect.

Inline parts of a failing test until the reason for the failure becomes obvious.
— J.B. Rainsberger

The technique works by following these steps:

  1. Start with a failing high-level test that reproduces the defect.
  2. Inline the method(s) called on the system under test. (Breaking encapsulation is acceptable at this stage)
  3. Add assertions at the beginning of the test, gradually moving towards the failure while verifying all assumptions.
  4. Tidy up the test code and remove all irrelevant parts.
  5. Repeat until the test is minimal and the defect becomes obvious.

Some advantages of using this technique:

  • Leaves behind clear, reusable unit tests.
  • Turn defects into focused insights.
  • Encourages debugging through testing rather than relying on breakpoints or stepping through code.
  • Allows a steady pace from failure to fix.

Just give it a try. It’s a useful way to find defects while adding missing tests to your codebase.

References:

If you and your team want to learn more about how to write maintainable unit tests and get the most out of TDD practices, make sure to have look at my trainings and workshops or check out the books section. Feel free to reach out at infonull@nullprincipal-itnull.be.

Profile picture of Jan Van Ryswyck

Jan Van Ryswyck

Thank you for visiting my blog. I’m a professional software developer since Y2K. A blogger since Y2K+5. Author of Writing Maintainable Unit Tests. Teaching and coaching XP / Lean practices. Speaker at tech conferences. Curator of the Awesome Talks list. Thinking and learning about all kinds of technologies since forever.

Comments

About

Thank you for visiting my website. I’m a professional software developer since Y2K. A blogger since Y2K+5. Author of Writing Maintainable Unit Tests. Teaching and coaching XP / Lean practices. Speaker at tech conferences. Curator of the Awesome Talks list. Thinking and learning about all kinds of technologies since forever.

Contact information

(+32) 496 38 00 82

infonull@nullprincipal-itnull.be