I came into this late, if I'm repeating what others said, I'm sorry...
The reason the military does so much testing is because in the past they didn't test. It was left to the designers and manufacturers. The navy learned the hard way about shock damage in WWII. And if you haven't heard, the navy went into WWII with torpedoes that worked about 15% of the time. Not just sub torpedoes, but destroyer and aircraft torpedoes. All because they new design wasn't properly tested.
Bomb exploding near ships could damage optics, trip breakers, seize rudders, even knock shafts out of alignment. During the war, several ships had generators trip and equipment knocked off mountings by close misses. Along with the obvious damage to early electronics.
I rode several WWII built destroyers and one carrier. The late war builds had noticeable changes even in the same ship class, all from hard lessons learned.
Now the military spends millions, maybe billions, testing new weapons so the people getting shot at can count on their equipment. Anybody remember the M-16 jamming in combat during Vietnam? Or that only one LAWS rocket in three actually worked?