I'd assume they have diagnostic tools to test it yes. And that's a good question, I know they can remotely log lots of things with the built in diagnostic apps via Apple Support.
As far as replacing it, here's a
guide on iFixit on how it would be preformed. At least by a third party, Apple may have their own way. Replacement via Apple costs $79 for all models from what I saw
here. Not cheap but when you've payed some $430 including tax for a 42mm Sport even it doesn't sound too crazy. But when it does go bad in a few more years or so who knows what it would even be worth at that point. Mine's already worth maybe $150 if that with it's scratches on it and such.
Find out when it starts happening on a more regular basis I suppose.