German auto manufacturer Volkswagen is embroiled in a huge scandal after the U.S. Environmental Protection Agency (EPA) discovered that some of its diesel vehicles were performing much better in testing scenarios than in the real world. At the heart of the story is a piece of software that could detect when vehicles were being tested.
When it is evaluating vehicles, the EPA runs them on a stationary dyno so that their back wheels are still while the front wheels roll. Ordinarily, this would cause the car's stability and traction controls to kick in, so VW (and other manufacturers) developed software that would allow the car to determine that it was being tested and run without activating the safety mechanisms.
The problem with the VW testing mode is that it also alerted the car to use more catalytic fluid, which causes the car to pollute less. When the car wasn't in testing mode, it used much less of this fluid, causing vehicle emissions to skyrocket.
Why did VW deploy this software? The short answer appears to be that catalytic fluid is expensive—about $200 to $300 per refill—so the software saved VW drivers money.