Over optimizing/curve fitting/robustness/ out of set data

 
What is the best and most useful way to optimize An ea without over optimizing or curve fitting and accounting for robustness and also using in and out of set data...
Set by set would be amazing.
Thanks all