Please keep your Michael Bay/Bruce Willis/Ben Affleck jokes to the comments, okay?
Both NASA and the European Space Agency will conduct missions to test the ability to deflect an asteroid off its path (H/T The Mary Sue, Blastr and Space.com). The joint effort is called the Asteroid Impact and Deflection Assessment (AIDA) mission.
The ESA component, the Asteroid Impact Mission, would launch in 2020 toward the binary asteroid system 65803 Didymos. This is an Apollo asteroid, meaning it is close to Earth, not venturing out further than the orbit of Mars. The AIM would leave a lander on the smaller asteroid, and position itself so to maximize observations of the Didymos system. NASA would launch the Double Asteroid Redirection Test (DART) craft in 2021, and on arrival at the Didymos system, it would impact the smaller asteroid. AIM would then observe the changes on the smaller asteroid and the system as a whole. The measurements taken by AIM should help determine the necessary force to deflect an asteroid of a known mass by a particular amount.
The impact is scheduled for 2022.