I just wonder how they thought they could get away with it, and how did they for so long.
Well, I can make a good guess. The only way to find this is to dig into source code on the ECM, AND to verify the on-road emissions are out of specification. The cars passed certification on a dyno in a lab.
The 2014 study that found the problem (WV Univ.) was pretty involved to get the test equipment in a car, was not small feat. It involved some complex piping of the exhaust, and addition of a 2Kw generator on the VWs and 2 generators on the BMW, and enough test equipment to account for the weight of 3 passengers.
I'm quite sure the engineers at VW who concocted this scheme figured it unlikely anyone would go to those extremes, when the cars passed the in lab tests consistently. The BMW did pass both, but the VW's did not.. that set off the additional tests by EPA and CARB.. where VW kept denying there was an issue (hmm.. sounds familiar, like the HPFP problem!). Only when the EPA said no to certification on the 2016 TDI cars held in port did VW finally come clean and confess to the issue.
It is going to be a rough go of it. The study on the ability to attain emissions I think was in part due to other OEMs who make TDIs not even trying to bring them to US market and EPA certifications.. the US is HALF the NOx for even the latest most strict EU standard for NOx, US is only diesel market that is now using DEF for compliance as I understand it (might be a few in EU now too as it is proving pretty reliable, more than the LNT system). US standards don't differentiate between Diesel and Gasoline powered cars.. NOx is hard to limit in Diesel, with higher combustion temperatures, so it make is hard for any OEM to make a compliant TDI for the passenger car emissions standard in the US. VW is in big trouble, but the EPA standards are also not reasonable and need to be reviewed in my opinion. The trade of for far less CO2 and overall emissions, for slightly more NOx on the TDI seems a reasonable one, compared to the VOC emissions of gasoline, which is an issue when not even in a car, just gasoline distribution and storage has emissions issues.. but I digress.