It is definitely possible, to what practical scale is the question.<p>And you need to define what failure actually means.<p>eg while the software might not fail, the specification very well might, meaning the software does exactly as asked, but asked to do something that creates an overall failure.<p>Many failures relate to specification, not execution. Failure in specification is the very difficult problem to solve.<p>But even just looking at the software component, it would involve coding everything from the ground up, generating code from specifications proven by formal methods and so on. Likely meaning no third party libraries.<p>The code generation tools themselves would require specification and validation by formal methods.<p>You could rapidly end up at a place where easily your greatest risks were hardware failure or hacking.<p>As someone who designs safety critical systems for a living, most code created these days is on a "near enough" basis and the benefits are so immense that occasional downsides are tolerable.<p>So we have evolved to a quagmire for consumer grade software that will never get any better without a total restart or rethink, but that is probably ok, because the benefits far outweigh the risks, in general.<p>Think about something slightly similar. The risk of dying in a car or bike incident is very real, but if you asked anyone would they rather take that risk or walk everywhere, they would happily take the risk.<p>Same as people doing their banking on PC.
Plus, in the PC banking context, other systems have evolved outside to ameliate that risk. (eg ability of the banks to roll back transactions).
So the cost of seeking ultimate infallibility just isn't worth the results.<p>Ultimately, everything is a trade-off.