Reliability and Optimization for Resource-Constrained Embedded Systems