The thing is that the testing regs were drafted in a time before cars had supercomputers (relatively speaking) on board.
.
These days it's perfectly possibly, indeed desirable, for your car to work out that you are driving at altitude, or in a city on hot day or accelerating hard or cruising on a motorway or any of a thousand possible situations and tailor the engine management to suit.
.
The tests have always understood that there would be a difference between a brand new car going through a rigid routine and a car being driven in the real world by a lead footed human who uses cheap fuel and doesn't service their cars on schedule.
.
That's why there is provision for the performance of the cars on the road to not match the cars in the lab performance.
.
So having the ability to detect driving conditions and adjust the engine to suit and knowing that you only have to pass the federal test (not an on the road test) it's a short step (which may not even be illegal depending on the wording of the regulations) to add "sitting on a rolling road during a federal test" as one of the modes and tailor the performance accordingly.
.
Many countries and some states have MOT type tests where the actual on the day emissions of the car are tested. The pass level for these tests is lower than the "type tests" because it is recognised that cars wear and age over time and emissions will get worse.
.
Any VW car would have to get through these tests (and there is no suggestion that these tests were rigged*) to stay on the road so the emissions from VW (or any other car for that matter) will always be better than the "MOT test" limits.
.
IMHO the concept of rolling road tests is probably out of date. WHat they need to do is, on first "type" approval a dozen or so production cars are taken, fitted with mobile exhaust sensors and driven in typical daily traffic e.g. commuting, motorway, towing a trailer (if applicable), loaded etc. If they results are within limits (lower than current but the same as the MOT limits) the type then gets approved.
.
After that every year the approvals board picks at random (say) a dozen new cars from dealer lots and subjects them to the same tests. If all pass great, approval continued. If any fail then deeper investigation is warranted (might be a lemon of a car, might be bad fuel etc).
.
This "real world" testing would keep car manufacturers honest and provide actual realistic CO2, MPG etc figures for consumers
* I'm believe one large car maker used a bonnet switch and the engine management and make the car run much cleaner (at the expense of power and throttle response) if the engine was run when the bonnet was open. As the bonnet had to be open to fit the rpm sensors to the ignition this made cars much more likely to pass the MOT emissions tests.