Earlier quoted context omitted.
They should invent a programming language that only compiles if the why is still true.
They have, but they're beyond grasp of most developers. Tests were invented to express the "why" for the normal guy. They don't strictly prevent compilation, but a proper workflow will see them halt your process in the same way, offering the same outcome. Granted, there are a lot of horribly written tests out there that don't tell you "why" — or, well, anything. As always, people will find a way to abuse anything you…
I'd also love it if this were applied to politics and laws.