Chapter 2 of 17

A bug is the distance between what you expected and what you got

Start with something that has nothing to do with computers, because everything after this is built on it.

It is Monday and you drive to Walmart. You have been there a hundred times. You park the car, you walk through the door, and everywhere you look there is a red circle with a white dot in the middle of it. On the walls. On the signs. On the shirts the staff are wearing.

That is the Target logo. You are standing inside Walmart and you are looking at Target.

Tell me what happens in your head. Not what you think. What you feel, in the first second, before you have worked anything out. Why did I come to Target?

Nobody told you. Nobody handed you a document. You had a picture in your head of what the inside of Walmart looks like, and what was actually in front of you did not match the picture, and you knew in one second.

That gap is the whole subject of this book. You pay for a Toyota Corolla, they hand you the keys, and it is a Corolla. If they handed you something else, you would know before you sat down, and you would not need to be told. You have an expectation, and the thing in front of you either meets it or it does not.

Software is exactly the same. Go to Amazon and type apple into the search box. You expect apples. If the results come back with a watermelon and a goat, you do not need a computer science degree to know something is broken. You typed apple. You got a goat. That is a bug.

So write it down as a sentence you can keep: a bug is when the software does not meet the expectation.

You walked into the wrong store and you knew in one second, with no document and no training. So why would software ever need that written down in advance?

Because nobody has ever been inside this one. You had a hundred visits to Walmart in your memory, so the comparison cost you nothing. Software that does not exist yet has no memory attached to it. Nobody has been inside it, nobody has a picture of it, so there is nothing to compare it against until somebody sits down and decides, in writing, what right is going to mean here.