Most people do not believe it is possible to fully specify software before writing it, until they are forced to.
Having part of my background in Functional Safety, I have seen it done many times, and it can most definitely be done.
It is just it can't be done in the sort of time frames that people who do not specify before coding, are used to.
But, if you can't afford to move fast and break tings, because it is an airplane, or train signaling system, or complicated elevator system with multiple cars in the same shaft, then you generally write no code until you know exactly what you want the code to do (and more importantly, not do).