Tasks like diagnosis, failure-modes-and-effects analysis (FMEA), and therapy proposal involve reasoning about variables and parameters deviating from some reference state. In model-based systems, one tries to capture this kind of inferences by models that describe how such deviations are emerging and propagated through a system. Several techniques and systems have been developed that address this issue, in particular in the area of qualitative modeling. However, to our knowledge, a rigorous mathematical foundation and a “recipe” for how to construct such compositional deviation models has not been presented in the literature, despite the widespread use of the idea and the techniques. In this paper, we present a general mathematical formalization of deviation models. Based on this, aspects of constructing libraries of deviation models, their properties, and their application in consistency-based diagnosis and prediction-based FMEA in a componentoriented framework are analyzed.