that has nothing to do with bugs wtf. Unit Test,integrations test and so on are all test done to ensure a correct value is going back. this is not how bugs functions…
Bugs can happen at any given time due to a error in the computing. or calculation, there are far more reason as to why it can bug. simply put the programmers are partly to blame. But they are far from the once who to blame fully… and also not all companies sadly got the money or time to do those test on each and every build why? because its VERY expensive. and takes well time and money. and no they cannot be automated. each and every line of code would need a test for it. and simply put when u got 10000s lines of code. that turns into 10-100 times more coding in order to make sure the values that u get back are correct.