Regarding the electronics each and every PCB is ICT,Functional and HASS tested by their Supplier with every part being traceable.
I am very certain they also do a functional test (emulation) before giving it to a test driver and they will certainly test every single car during regular production.