Systematic framework for the optimization and validation of a compact optical system using commercial off-the-shelf