I've always just done the float test, I don't know how reliable that is though.
I think grandma's advice is probably best: Don't crack eggs straight in to whatever you're making. Easier to fish out shell pieces, and you're not going to accidentally mix in a rotten egg.