You should be tipping the server on their level of service. They did not prepare your food.
That's a good point that too many people don't understand. A waiter/waitress can't tell if your steak is medium as opposed to medium rare until you cut into it. But I do judge them on how they respond to problems. The server should spot glaring errors before you do (like getting chicken when you ordered steak) and should be able to effectively deal with problems you notice. If they can't do that then it will be reflected in their tip. But even then I still tip a decent amount for the rest of the service they provided, as long as that was done well.
If I get something that is obviously inedible and should have never left the kitchen then I consider it a major failing on the restaurant as a whole and I ask for the manager. Like the time I ordered crab legs and even before the waitress put the plate before me I could see that the crab legs were
gray. This restaurant is one of those that uses any available server to bring the food to the table (which I think is completely contradictory to the service model) and the girl who brought the food was clearly confused about what to do when I asked, "is it supposed to look like that?" A manager was nearby and I had to call him over and ask the same question because the mystery waitress had wandered off without doing anything. He fell all over himself apologizing, yanked the food and I could see him chewing the kitchen crews' asses before returning with a much improved version of my dish (along with a comped meal and a card giving me a future freebie as well.) The waitress who did everything but the actual serving of the meal was great, so she got a decent tip because I wasn't going to trash her for something that she had no involvement with.
We keep going to the same place because my wife always manages to get great food and loves it. My experience varies, sometimes the food is great and other times it's just okay. And the place has equally varying service levels as well. Sometimes the server is an outstanding professional, and a couple of times the service was as if it was delivered by an inexperienced teenager on their first day (it may have been). I did give a significantly reduced tip to one girl who was horrible, but I gave her a hint when she presented the check. "You know, it's usually customary to ask people if they're done before you take their plate away. Especially when there's still food on it." Seriously, I turned my head to talk to the person next to me and when I looked back my food was gone and she was disappearing into the back before I realized what had happened.
I've never not left a tip. My mom was a waitress and so was my wife at one time, so I just can't do it. But if the service was ever so horrible that I felt that way, it would probably be more justified to have a conversation with the manager explaining why I'm not ever coming back and why I'm not leaving a tip. If the service was that bad, the manager needs to be delivering the message to the server.