Where's the red line?
It certainly seems that VW has crossed a line here, but I'm struggling to see exactly where that line lies. "Cheating" on tests is endemic to all the businesses I can think of. Wherever there is regulation or testing people try to present their product in the best possible light.
That the MPG figures for cars don't scale to the real world is well known. Cars have been designed to perform well in fuel consumption tests for years. So a precedent in the car industry clearly exists. CPU manufacturers and computer hardware/software producers design products that run benchmarks well. So the precedent for using computer technology to influence testing already exists.
When a (pre arranged) school inspection takes place and inspectors observe exemplary teaching, do they really think that evey lesson taught in that school will always be that good? Of course not. They know that schools oppose random inspections for a reason. So it is well established that average performance may be worse than tested performance. When the government imposes performance targets on the NHS or the Police, does anyone think that meeting them won't have adverse effects elsewhere? I don't think so. Everyone knows that targets distort the behaviour of organsations. When the Queen visits and the council cleans the streets and paints all the lamp-posts that she'll see, do we seriously think that Her Maj. will believe that the whole world looks like this? Faking it extends to all levels in our society.
So it looks to me as if most of the things that VW did already have precedents and that very probably most other motor manufacturers are doing the same - on the grounds that "everyone does it" and that it's an accepted consequence of the testing procedure being somewhat limited. I really can't see any other explanation for why they'd risk this, because the chance of being found out eventually must approach 100%. Most likely, they thought it was an acceptable (if somewhat shady) practice that would be tolerated, or they'd be given a mild ticking-off. Given all the precedents, I can see how they might reach that conclusion.
In my view, the red line that was crossed was to have an explicit "cheat mode" implemented in software. It's established that the cars submitted for testing must be production models. Some minor tweaking may be permitted, but swapping the car for another model is definitely cheating. In effect, by having a code branch, that's what VW did because a car is nowadays defined by its software. But the extent to which the two code branches behave differently is a matter of judgement - as to what is and isn't acceptable - and that, in turn, depends on how you present it (e.g. in the media). What VW did seems to have been over-reach, but I can see how they might arrive at that point without feeling any more guilty than normal.
The real failure, however, is in the testing. Testers know that manufacturers game the system and that they need to design tests to defeat this. Not to have recognised that this can be done in software is ridiculous and hopefully that error will now be fixed. Perhaps additional clarity is also needed about what is (and isn't) cheating because clearly some flexibility exists, although this went too far.
If it does turn out that 90% of all the cars on the road today have exploited what is an obvious loophole, then we might be better off chalking it up to experience, accept that an opportunity to drive down emissions has been missed and try to do better in future. We obviously also need to address the balance between CO2 and NOx emissions because it seems you can reduce either but not both. See-sawing between limits on one or the other isn't making things any easier.