1.) I worked fairly extensively with CakePHP and found it to be a pretty solid framework and pretty tweak-able for performance.
2.) In order to achieve that, I try to:
a.)try to design my code in such way, that I do not violate the Single Responsability Principle ( a class should do only one thing, and do it well), and other OO principles. (Try to be open for extension, but closed for modification)
b.)write unit-tests that test my code, so that I know that something works (or doesn't work)
the unit-tests also allow me to easily refactor my code if necessary. If I see a 'broken window' (code smell), I can easily fix it.
c.)use FxCop to do a static code analysis, so that it alerts me when I violate some design guidelines