I'm sure some of this has changed with the advent of electronic transactions, but when I was a server, each employee had a minimum of 10% of their sales added to their W2 as tip income whether they made it or not.
For terrible service, I tip 10%, because the server has to pay taxes on that, and I certainly don't expect a server having a lousy day to actually pay the IRS for the privilege of waiting on me. "Bad service" is often beyond the server's control (kitchen issues, short staffed, no colverage for breaks, etc) Don't punish them.
"Black people don't tip"is a racist lie and self fulfilling prophecy. When you treat a customer with disregard, like you don't expect them to tip you, they can tell, and they won't.
www.npr.org
More from NPR, an interesting map.