
Reuse is key
Agile and waterfall have strengths and weaknesses as highlighted by previous comments.
With either method more emphasis has to be placed on reuse of known good coding patterns, and architectures (with my personal bias preferably Open Source).
Reuse improves quality through iteration, many eyes, and much testing. Given the time available it allows the coder to concentrate more on the overall design, and new code they are writing, reduces the chances of introducing new errors.
Focusing on Security Architecture patterns and controls can also help, www.opensecurity.architecture.org is a good place to start for this topic.