Just like Agile unit tests came about as a fashion. I think the history is a bit murky but Kent Beck was one of the proponents and he also happens to be one of the signatories on the Agile Manifesto. Let's say circa 1997.
There was plenty of very well written software in existence at that point. Large applications, operating systems, databases, games, embedded applications etc. etc.
That's not to say there's anything bad about unit tests just like there's nothing bad about the Agile principles. They don't prove your code works though, that's not really possible. A useful tool- sure.