The Bug Sandwich

Something is strange. jQuery isn't working. What? How could it not be working? You've used it hundreds of times before. Millions of people must have used it hundreds of times before. jQuery - the number 1 most battle tested JavaScript library in the! Why isn't working? W...T...F?

When something that's supposed to work is not working properly, it's a different kind of frustration. It feels as if you've lost something you had. But once you get past this sense of loss, realize that you can actually take advantage of this situation. All you need is one example of the thing that is supposed to work - working. With this working example - which I call the passing test case, plus your existing non-working code - which I call the failing test case, you can trap this bug from two sides - like a sandwich. Once you have the bug in a sandwich, it's a sure thing. For this bug - there will be no escape.

Watch Now Do the Homework