Up to a point, sure. But it's definitely a field full of "unknown unknowns", and I don't envy them. That said, good architecture and principles are important, which is why for example *nix has a better security track record than older Windows versions.