In the SW design process the concept of quality is strictly connected to the number of faults the software will be affected by when the customer uses it. Even if this number is kept small, when the system is complex sometimes it can take weeks to isolate and correct a single fault with the customer losing their money and reviewing their opinion about the quality of your software. Designing good software also means providing the SW architecture with a set of non-intrusive features to facilitate product maintenance. The aim of this class is to suggest a simple approach to the fault detection problem and offer some hints to design debug features in embedded systems with real-time constraints and lack of memory resources. Topics of the class will be: Fault localization: which elements are necessary to isolate a fault, how to collect useful data from a fault, how to trace runtime events, post mortem debug and diagnostics. This class addresses issues critical to embedded SW designers dealing with systems for real-time high-speed applications. The class presents detailed examples taken from a tested embedded system architecture including microprocessors and system-on-chip equipped with DSPs, memories and peripherals. The class integrates with some costs data related to a real project and few case studies about the usage of debug features from a live system.