Applications and infrastructure benefit greatly from relying on multiple security mechanisms layered on top of each other. If one security mechanism fails, there is a high probability that the subsequent layers of security will successfully defend against the attack.
A non-exhaustive list of these code protection ramparts includes the following:
Note that these layers must be simple enough to use in an everyday workflow. Security measures should not break usability.