In an extraordinary rehearsal for the day when a rock threatens Earth, a NASA spacecraft successfully crashed into an asteroid at breakneck speed on Monday.