There is a huge amount of testing at lots of levels before any flight software is released - I know, it's kept me in work for twenty years! - most of it is done at the vendor's site but the integration/systems/acceptance is done at the customer's. Many eyes look over each step, independent test and design teams to try to achieve objectivity.
VnV