WASHINGTON - NASA launched a spacecraft early Wednesday to test technology to alter the course of an asteroid by slamming into it, the world's first full-scale mission of its kind to better prepare for defending Earth against hazardous space objects.