One of the reason software still works is that compilers are (mostly (
)) very easy to test. Just just need an input source code, and expected outcome (either compiler error, or the result when running the code). No intermediate state to consider, no concurrency, no test database to set up etc.Oh, and many serious compilers can compile themselves, so bootstrapping is a pretty good test too.
Another reason is that compilers simply must* work for software development to continue, so people have spend the necessary amount of energy to get implementation and tests "right".
(*) There are always exceptions, like when a compiler auto-parallelizes code and introduces a race condition that is rarely triggered. But those cases are blessedly rare.