DEV Community

Alexey Voinov
Alexey Voinov

Posted on

One tiny detail about The Saff Squeeze

The Saff Squeeze technique, introduced by Kent Beck few years ago is very nice. (Unfortunately, the original article has long gone, but there's an archived copy: Hit 'Em High, Hit 'Em Low) There's just one extra detail, worth noting. If you write a failing test, then on every failure, you'll need to check how exactly how it failed. Because if the reason for failure has changed, it means you did something wrong, and it's time to go one step back. But there's a trick. If you rewrite the test so it asserts on the wrong behaviour, it will be green (until you fix the code, of course). And what it means, is that your code is failing in a certain known way. No surprises. I find this variation to be a bit more convenient.

Top comments (0)